Skip to content
Snippets Groups Projects
Commit 51977e92 authored by Mattia Mancini's avatar Mattia Mancini
Browse files

Address referee comments

parent 2466f4b1
No related branches found
No related tags found
No related merge requests found
Pipeline #33356 failed
...@@ -4,3 +4,56 @@ ...@@ -4,3 +4,56 @@
The Scintillation Pipeline produces from LOFAR scintillation dataproducts a set of previews and metadata The Scintillation Pipeline produces from LOFAR scintillation dataproducts a set of previews and metadata
able to describe the observation characteristics. 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
import setuptools import setuptools
from setuptools import setup 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( setup(
name='scintillation_tools', name='scintillation_tools',
...@@ -11,5 +17,6 @@ setup( ...@@ -11,5 +17,6 @@ setup(
author_email='mancini@astron.nl', author_email='mancini@astron.nl',
description='Utils to process scintillation h5 files', description='Utils to process scintillation h5 files',
test_suite='tests', test_suite='tests',
scripts=['bin/scintillation_utils.py'] scripts=['bin/scintillation_utils.py'],
install_requires=install_requires
) )
...@@ -20,6 +20,10 @@ class TestMetadata(unittest.TestCase): ...@@ -20,6 +20,10 @@ class TestMetadata(unittest.TestCase):
metadata_per_dynspec = extract_metadata(dataset) metadata_per_dynspec = extract_metadata(dataset)
metadata, *_ = metadata_per_dynspec.values() metadata, *_ = metadata_per_dynspec.values()
compute_start_end_azimuth_elevation(metadata) 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') @unittest.skipUnless(is_test_data_present(), 'test data is missing')
def test_fields_name(self): def test_fields_name(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment