From 976f1160e3bfc336af0c9aa610a78a26ad9b0a7f Mon Sep 17 00:00:00 2001 From: Klaas Kliffen <kliffen@astron.nl> Date: Fri, 8 Oct 2021 09:53:17 +0200 Subject: [PATCH] Remove old files --- README.md | 3 -- build_images.sh | 2 -- conditonal_fix.cwl | 41 ------------------------ scripts/fix_common_ms_issues.py | 55 --------------------------------- scripts/requirements.txt | 2 -- steps/dummy_fix_a.cwl | 9 ------ steps/dummy_fix_b.cwl | 9 ------ steps/noop.cwl | 11 ------- 8 files changed, 132 deletions(-) delete mode 100755 build_images.sh delete mode 100644 conditonal_fix.cwl delete mode 100644 scripts/fix_common_ms_issues.py delete mode 100644 scripts/requirements.txt delete mode 100644 steps/dummy_fix_a.cwl delete mode 100644 steps/dummy_fix_b.cwl delete mode 100644 steps/noop.cwl diff --git a/README.md b/README.md index 76a8eb7..ed89219 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 2fb91c0..0000000 --- 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 8e59079..0000000 --- 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 8108ea4..0000000 --- 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 6ac4892..0000000 --- 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 178d083..0000000 --- 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 56ea3bc..0000000 --- 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 0ecca93..0000000 --- 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 -- GitLab