diff --git a/README.md b/README.md index 76a8eb75efaea76c1d17d9f1c6d375d1aa67be70..ed892192eb8f46cd945567f6192f7f5f2dccf1d6 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,10 @@ This is a CWL workflow used to compress Lofar imaging data. ## Docker images - astronsdc/lofar-legacy -- imaging-compress-pipeline-identify-issues `# build by this repo` ## Running the workflow ```bash -# Build the docker images -./build_images.sh # Run the workflow cwltool compress_pipeline.cwl [--flag_autocorrelation] --msin MEASUREMENT_SET ``` diff --git a/build_images.sh b/build_images.sh deleted file mode 100755 index 2fb91c0c252a7e2ceeef8bba5af1624188b913ee..0000000000000000000000000000000000000000 --- a/build_images.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -docker build -t imaging-compress-pipeline-identify-issues -f docker/Dockerfile.identify_issues scripts/ \ No newline at end of file diff --git a/conditonal_fix.cwl b/conditonal_fix.cwl deleted file mode 100644 index 8e59079a2d3246bab2526d2bad64d873b073bb0a..0000000000000000000000000000000000000000 --- a/conditonal_fix.cwl +++ /dev/null @@ -1,41 +0,0 @@ -class: Workflow -cwlVersion: v1.2 - -inputs: - msin: Directory -outputs: [] - -steps: - identify_issues: - run: steps/identify_issues.cwl - in: - msin: msin - out: - - issue_list - fix_a: - run: steps/dummy_fix_a.cwl - when: $( inputs.list.includes("FIX_ANTENNA_TABLE") ) - in: - list: identify_issues/issue_list - out: [] - fix_b: - run: steps/dummy_fix_b.cwl - when: $( inputs.list.includes("FIX_WEIGHT_SPECTRUM") ) - in: - list: identify_issues/issue_list - out: [] - fix_c: - run: steps/dummy_fix_a.cwl - when: $( inputs.list.includes("FIX_BROKEN_TILES") ) - in: - list: identify_issues/issue_list - out: [] - fix_d: - run: steps/dummy_fix_b.cwl - when: $( inputs.list.includes("FIX_STATION_ADDER") ) - in: - list: identify_issues/issue_list - out: [] - -requirements: - InlineJavascriptRequirement: {} diff --git a/scripts/fix_common_ms_issues.py b/scripts/fix_common_ms_issues.py deleted file mode 100644 index 8108ea46604967d2f84be5636c632dd1494ba22e..0000000000000000000000000000000000000000 --- a/scripts/fix_common_ms_issues.py +++ /dev/null @@ -1,55 +0,0 @@ -import json -from argparse import ArgumentParser -from datetime import datetime -from datetime import timezone as tz - -from astropy.time import Time -from casacore.tables import table as MSTable - -_DAY_IN_SECONDS = 24 * 60 * 60 - -_TIME_RANGES= { - 'FIX_ANTENNA_TABLE': ( - datetime(year=2013, month=2, day=13), - datetime(year=2014, month=2, day=10)), - 'FIX_WEIGHT_SPECTRUM': ( - datetime(year=2014, month=3, day=19), - datetime(year=2014, month=10, day=31)), - 'FIX_BROKEN_TILES': ( - datetime(year=2015, month=1, day=26), - datetime(year=2015, month=2, day=25)), - 'FIX_STATION_ADDER': ( - datetime(year=1999, month=1, day=26), - datetime(year=2015, month=7, day=28)), -} - -def parse_args(): - parser = ArgumentParser(description='Fix common LOFAR observing issues') - parser.add_argument('msin', help='Measurement Set input') - return parser.parse_args() - -def date_to_fix_string(obs_date): - fixes = [] - for fix_string, (start_date, end_date) in _TIME_RANGES.items(): - if obs_date > start_date and obs_date < end_date: - fixes.append(fix_string) - return json.dumps(fixes) # dump proper json for CWL - -def check_observing_date(msin): - observation_table = MSTable(f'{msin}/OBSERVATION', ack=False) - start_mjd, end_mjd = observation_table.getcell('TIME_RANGE', 0) - start_datetime, end_datetime = map(mjd_to_local, (start_mjd, end_mjd)) - return start_datetime, end_datetime - -def mjd_to_local(mjd): - return Time(mjd / _DAY_IN_SECONDS, format='mjd').to_datetime() - - -def main(): - args = parse_args() - start_datetime_obs, _ = check_observing_date(args.msin) - print(date_to_fix_string(start_datetime_obs)) - - -if __name__ == '__main__': - main() diff --git a/scripts/requirements.txt b/scripts/requirements.txt deleted file mode 100644 index 6ac4892e0e4ca0f7cfd2b0711aeeeff8f906d2e0..0000000000000000000000000000000000000000 --- a/scripts/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -astropy -python-casacore \ No newline at end of file diff --git a/steps/dummy_fix_a.cwl b/steps/dummy_fix_a.cwl deleted file mode 100644 index 178d083cb32e5b1eeecbbdf2b8d6cef11a38937b..0000000000000000000000000000000000000000 --- a/steps/dummy_fix_a.cwl +++ /dev/null @@ -1,9 +0,0 @@ -id: dummy_fix_a -label: Dummy Fix A -cwlVersion: v1.0 -class: CommandLineTool -baseCommand: echo -arguments: - - "A" -inputs: [] -outputs: [] diff --git a/steps/dummy_fix_b.cwl b/steps/dummy_fix_b.cwl deleted file mode 100644 index 56ea3bcf283d7ca6d82e0291f1d1615ec85a5b9b..0000000000000000000000000000000000000000 --- a/steps/dummy_fix_b.cwl +++ /dev/null @@ -1,9 +0,0 @@ -id: dummy_fix_b -label: Dummy Fix B -cwlVersion: v1.0 -class: CommandLineTool -baseCommand: echo -arguments: - - "B" -inputs: [] -outputs: [] diff --git a/steps/noop.cwl b/steps/noop.cwl deleted file mode 100644 index 0ecca9372676230b941a342da02d20a93721484d..0000000000000000000000000000000000000000 --- a/steps/noop.cwl +++ /dev/null @@ -1,11 +0,0 @@ -class: ExpressionTool -id: noop -cwlVersion: v1.2 -inputs: - - id: msin - type: Directory -outputs: - - id: msout - type: Directory -expression: | - $({msout: inputs.msin}) \ No newline at end of file