From 51977e921c07c5ef4e04aaec9358208a0bf97241 Mon Sep 17 00:00:00 2001 From: mancini <mancini@astron.nl> Date: Fri, 15 Jul 2022 10:59:28 +0200 Subject: [PATCH] Address referee comments --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 9 ++++++- tests/test_metadata.py | 4 ++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 666da20..fd041cd 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,56 @@ The Scintillation Pipeline produces from LOFAR scintillation dataproducts a set of previews and metadata able to describe the observation characteristics. + +## Install the tool locally +To use the tool to inspect a Dynspec dataset locally you can install it +by executing the following command + +```bash +python setup.py install +``` + +It is suggested to run it in a virtualenv + +## How to run the command +Once installed you can find the help of the command by typing: +```bash +$ scintillation_utils.py --help +usage: scintillation_utils.py [-h] [--samples_size SAMPLES_SIZE] [--averaging_window AVERAGING_WINDOW] [--export_only_station EXPORT_ONLY_STATION] scintillation_dataset output_directory + +Scintillation averaging script + +positional arguments: + scintillation_dataset + Scintillation dataset [e.g. Dynspec_rebinned_L271905_SAP000.h5] + output_directory Output directory + +optional arguments: + -h, --help show this help message and exit + --samples_size SAMPLES_SIZE + Samples size in seconds + --averaging_window AVERAGING_WINDOW + Averaging window in seconds + --export_only_station EXPORT_ONLY_STATION +``` + +For example if you want to process the dataset **dynspec.h5** and save the result in a directory named +**out_dynspect** you can just run the command +```bash +$ scintillation_utils.py dynspec.h5 out_dynspect +``` + +## How to run the pipeline + +If you want to run the CWL pipeline to dowload and process the dataset this is the command to execute + +```bash +cwltool cwl/scintillation_preview_generation.cwl --surls srm://lta_site_url/path/filename.tar +``` +Other optional parameters can be specified a description is printed by executing the command + +```bash +cwltool cwl/scintillation_preview_generation.cwl --help +``` +_Note that to download the data from srm url you use a GRID proxy. +Check this [link](https://drupal.star.bnl.gov/STAR/book/export/html/3182) for reference._ \ No newline at end of file diff --git a/setup.py b/setup.py index 32c1890..917e157 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,11 @@ import setuptools from setuptools import setup +import os + +requirements_file_path = os.path.join(os.path.dirname(__file__), 'requirements.txt') +install_requires = [] +with open(requirements_file_path, 'r') as f_in: + install_requires = f_in.read().split('\n') setup( name='scintillation_tools', @@ -11,5 +17,6 @@ setup( author_email='mancini@astron.nl', description='Utils to process scintillation h5 files', test_suite='tests', - scripts=['bin/scintillation_utils.py'] + scripts=['bin/scintillation_utils.py'], + install_requires=install_requires ) diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 77c0064..9a61b5c 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -20,6 +20,10 @@ class TestMetadata(unittest.TestCase): metadata_per_dynspec = extract_metadata(dataset) metadata, *_ = metadata_per_dynspec.values() compute_start_end_azimuth_elevation(metadata) + self.assertIn('point_start_azimuth', metadata) + self.assertIn('point_start_elevation', metadata) + self.assertIn('point_end_azimuth', metadata) + self.assertIn('point_end_elevation', metadata) @unittest.skipUnless(is_test_data_present(), 'test data is missing') def test_fields_name(self): -- GitLab