From c32b81d1a99572f7e489b207cc634d35ecb72a6c Mon Sep 17 00:00:00 2001 From: Alexander Drabent <alex@tls-tautenburg.de> Date: Tue, 24 Mar 2020 18:08:05 +0100 Subject: [PATCH] update, small fixes Former-commit-id: 648aff693fcd8267a3f707ad8fc9609715cddaa2 --- lofar-cwl/steps/check_ateam_separation.cwl | 2 +- lofar-cwl/steps/makesourcedb.cwl | 2 +- steps/blsmooth.cwl | 2 +- steps/check_ateam_separation.cwl | 2 +- steps/find_skymodel_cal.cwl | 59 ++++++++++++++-------- workflows/prefactor_calibrator/prep.cwl | 6 +-- 6 files changed, 45 insertions(+), 28 deletions(-) diff --git a/lofar-cwl/steps/check_ateam_separation.cwl b/lofar-cwl/steps/check_ateam_separation.cwl index 977d9f86..516beb61 100755 --- a/lofar-cwl/steps/check_ateam_separation.cwl +++ b/lofar-cwl/steps/check_ateam_separation.cwl @@ -39,6 +39,6 @@ outputs: label: check_Ateam_separation hints: - class: DockerRequirement - dockerPull: lofareosc/prefactor + dockerPull: lofareosc/prefactor:HBAcalibrator - class: InlineJavascriptRequirement stdout: Ateam_separation.log diff --git a/lofar-cwl/steps/makesourcedb.cwl b/lofar-cwl/steps/makesourcedb.cwl index 30c09253..8a22c3ca 100755 --- a/lofar-cwl/steps/makesourcedb.cwl +++ b/lofar-cwl/steps/makesourcedb.cwl @@ -51,7 +51,7 @@ outputs: label: make_sourcedb_ateam hints: - class: DockerRequirement - dockerPull: 'lofareosc/prefactor:latest' + dockerPull: 'lofareosc/prefactor:HBAcalibrator' stdout: make_sourcedb_ateam.log requirements: - class: InlineJavascriptRequirement diff --git a/steps/blsmooth.cwl b/steps/blsmooth.cwl index d139c594..835664af 100644 --- a/steps/blsmooth.cwl +++ b/steps/blsmooth.cwl @@ -82,7 +82,7 @@ outputs: glob: $(inputs.msin.basename) hints: - class: DockerRequirement - dockerPull: lofareosc/prefactor-ci:master + dockerPull: lofareosc/prefactor:HBAcalibrator-ci:master requirements: - class: InitialWorkDirRequirement listing: diff --git a/steps/check_ateam_separation.cwl b/steps/check_ateam_separation.cwl index 977d9f86..516beb61 100755 --- a/steps/check_ateam_separation.cwl +++ b/steps/check_ateam_separation.cwl @@ -39,6 +39,6 @@ outputs: label: check_Ateam_separation hints: - class: DockerRequirement - dockerPull: lofareosc/prefactor + dockerPull: lofareosc/prefactor:HBAcalibrator - class: InlineJavascriptRequirement stdout: Ateam_separation.log diff --git a/steps/find_skymodel_cal.cwl b/steps/find_skymodel_cal.cwl index 6bfc52d0..49ef0066 100644 --- a/steps/find_skymodel_cal.cwl +++ b/steps/find_skymodel_cal.cwl @@ -5,25 +5,44 @@ $namespaces: id: find_skymodel_cal_py baseCommand: - python3 - - /usr/local/bin/find_skymodel_cal.py inputs: - - id: ms - type: - - Directory - - type: array - items: Directory - inputBinding: - position: 0 - doc: Input measurement set - - id: DirSkymodelCal - type: - - Directory - - string - default: '/data/skymodels' - doc: Directory containing the sky models - inputBinding: - position: 1 - prefix: '--DirSky' + - id: msin + type: Directory[] + doc: MS containing the calibrator + inputBinding: + position: 0 + - id: skymodels + type: Directory? + doc: Directory containing the sky models + - id: skymodels_extension + type: string? + doc: path extension of the sky models + +label: find_skymodel_cal.py +arguments: + - '-c' + - | + import sys + + from unittest.mock import MagicMock + sys.modules['lofarpipe.support.data_map'] = MagicMock() + + + from find_skymodel_cal import main as find_skymodel + import json + mss = sys.argv[1:] + skymodels = "$(inputs.skymodels.path)" + + extension = "$(inputs.skymodels_extension)" + output = {} + if extension != 'null': + output = find_skymodel(mss, skymodels, extension) + else: + output = find_skymodel(mss, skymodels) + + cwl_output = {'class': 'File', 'path': output['SkymodelCal']} + with open('./out.json', 'w') as fp: + json.dump(cwl_output, fp) outputs: - id: output_models type: File @@ -31,10 +50,10 @@ outputs: loadContents: true glob: 'out.json' outputEval: $(JSON.parse(self[0].contents)) -label: find_skymodel_cal.py + requirements: - class: InlineJavascriptRequirement hints: DockerRequirement: - dockerPull: lofareosc/prefactor + dockerPull: lofareosc/prefactor-ci:master \ No newline at end of file diff --git a/workflows/prefactor_calibrator/prep.cwl b/workflows/prefactor_calibrator/prep.cwl index ebe7e9ca..6bdaed1d 100644 --- a/workflows/prefactor_calibrator/prep.cwl +++ b/workflows/prefactor_calibrator/prep.cwl @@ -218,11 +218,9 @@ steps: 'sbg:y': 300 - id: find_skymodel_cal in: - - id: ms + - id: msin source: msin - - id: max_seperation_arcmin - source: max_separation_arcmin - - id: DirSkymodelCal + - id: skymodels source: calibrator_path_skymodel out: - id: output_models -- GitLab