Skip to content
Snippets Groups Projects
Commit 0c066c92 authored by alex's avatar alex
Browse files

bugfix missing frequencies

Former-commit-id: 72bb624b
Former-commit-id: b1c39dd0
parent b12ea510
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ class: CommandLineTool
cwlVersion: v1.0
$namespaces:
sbg: 'https://www.sevenbridges.com/'
id: applycal
id: applybeam
baseCommand:
- DPPP
inputs:
......
class: CommandLineTool
cwlVersion: v1.0
id: check_ateam_separation
baseCommand:
- python3
- /usr/local/bin/check_Ateam_separation.py
inputs:
- id: ms
type:
- Directory
- type: array
items: Directory
inputBinding:
position: 0
doc: Input measurement set
- default: Ateam_separation.png
id: output_image_name
type: string?
inputBinding:
position: 2
prefix: '--outputimage'
- id: min_separation
type: int
inputBinding:
position: 1
prefix: '--min_separation'
outputs:
- id: output_imag
doc: Output image
type: File?
outputBinding:
glob: $(inputs.output_image_name)
- id: logfile
type: File?
outputBinding:
glob: Ateam_separation.log
label: check_Ateam_separation
hints:
- class: DockerRequirement
dockerPull: lofareosc/prefactor:HBAcalibrator
- class: InlineJavascriptRequirement
stdout: Ateam_separation.log
......@@ -8,13 +8,16 @@ baseCommand:
inputs:
- id: msin
type: 'Directory[]'
doc: Input Measurement Set
- id: msin_fname
doc: Input Measurement Set string (including dummy.ms)
type: 'string[]'
inputBinding:
position: 0
prefix: msin=
separate: false
itemSeparator: ','
valueFrom: $(concatenate_path(self))
doc: Input Measurement Set
valueFrom: "[$(self.join(','))]"
- id: msout_name
type: string
inputBinding:
......@@ -87,7 +90,7 @@ inputs:
- id: missingdata
type: boolean
inputBinding:
prefix: msout.missingdata=True
prefix: msin.missingdata=True
separate: false
shellQuote: false
position: 0
......@@ -127,7 +130,7 @@ outputs:
glob: concat*.log
arguments:
- 'steps=[filter,avg,count]'
- msout.orderms=False
- msin.orderms=False
- avg.type=average
requirements:
- class: ShellCommandRequirement
......@@ -137,5 +140,9 @@ requirements:
hints:
- class: DockerRequirement
dockerPull: 'lofareosc/prefactor:HBAcalibrator'
- class: InitialWorkDirRequirement
listing:
- entry: $(inputs.msin)
writable: false
stdout: concat.log
stderr: concat_err.log
class: CommandLineTool
cwlVersion: v1.0
$namespaces:
sbg: 'https://www.sevenbridges.com/'
id: check_ateam_separation
baseCommand:
- python3
- /usr/local/bin/check_Ateam_separation.py
- -m
- check_Ateam_separation
inputs:
- id: ms
type:
......
......@@ -22,8 +22,14 @@ outputs:
type: Directory[]
outputBinding:
loadContents: true
glob: selected_ms.json
glob: 'selected_ms.json'
outputEval: '$(JSON.parse(self[0].contents))'
- id: selected_ms
type: string[]
outputBinding:
loadContents: true
glob: 'out.json'
outputEval: $(JSON.parse(self[0].contents).selected_ms)
label: filter_ms_group
requirements:
......@@ -39,20 +45,34 @@ requirements:
group_id = "$(inputs.group_id)"
json_file = sys.argv[1]
ms_list = sys.argv[2:]
ms_by_name = { ms.split(os.path.sep)[-1]:
{'class':'Directory', 'path': ms} for ms in ms_list}
output_file = 'selected_ms.json'
with open(json_file, 'r') as f_stream:
selected_ms = json.load(f_stream)[group_id]
print(selected_ms, ms_by_name)
selected_ms = [ms_by_name[os.path.basename(ms_name)] for ms_name in selected_ms]
selected_ms = [os.path.basename(ms_name) for ms_name in selected_ms]
cwl_output = {'selected_ms': selected_ms}
with open('./out.json', 'w') as fp:
json.dump(cwl_output, fp)
selected_ms = [ms_by_name[ms_name] for ms_name in selected_ms if ms_name != 'dummy.ms']
with open(output_file, 'w') as f_stream:
json.dump(selected_ms, f_stream)
hints:
- class: InitialWorkDirRequirement
listing:
- entry: $(inputs.measurement_sets)
writable: true
stdout: filter_ms_by_group.log
stderr: filter_ms_by_group_err.log
\ No newline at end of file
......@@ -58,6 +58,7 @@ steps:
- msin
out:
- id: output
- id: selected_ms
run: ../steps/filter_ms_group.cwl
label: filter_ms_group
'sbg:x': -500
......@@ -66,7 +67,9 @@ steps:
in:
- id: msin
source:
- filter_ms_group/output
- msin
- id: msin_fname
source: filter_ms_group/selected_ms
- id: msout_name
source: group_id
- id: msin_datacolumn
......
......@@ -311,7 +311,7 @@ steps:
out:
- id: output_imag
- id: logfile
run: ../../lofar-cwl/steps/check_ateam_separation.cwl
run: ../../steps/check_ateam_separation.cwl
label: check_Ateam_separation
'sbg:x': 254.234375
'sbg:y': 1440
......
......@@ -225,7 +225,7 @@ steps:
out:
- id: output_imag
- id: logfile
run: ../../lofar-cwl/steps/check_ateam_separation.cwl
run: ../../steps/check_ateam_separation.cwl
label: check_Ateam_separation
'sbg:x': -500
'sbg:y': -300
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment