Skip to content
Snippets Groups Projects
Commit 5eda83fc authored by alex's avatar alex
Browse files

Bugfix ddecal + minor updates

parent 2a695f2d
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,9 @@ RUN \ ...@@ -10,6 +10,9 @@ RUN \
apt-get update && \ apt-get update && \
apt-get install -y vim wget casacore-tools && \ apt-get install -y vim wget casacore-tools && \
rm -rf /var/cache/apt rm -rf /var/cache/apt
RUN \
pip3 install --upgrade pip && \
pip3 install h5py
RUN \ RUN \
pip3 install --upgrade pip && \ pip3 install --upgrade pip && \
git clone https://github.com/lofar-astron/prefactor.git ${PREFACTOR_NAME} && \ git clone https://github.com/lofar-astron/prefactor.git ${PREFACTOR_NAME} && \
......
...@@ -41,9 +41,10 @@ Pipeline options for ``cwltool`` ...@@ -41,9 +41,10 @@ Pipeline options for ``cwltool``
The following ``<cwl_options>`` are recommended to use for running **prefactor** with ``cwltool``: The following ``<cwl_options>`` are recommended to use for running **prefactor** with ``cwltool``:
* **---outdir**: specifies the location of the pipeline outputs * **---outdir**: specifies the location of the final pipeline output directory (results)
* **---tmpdir-prefix**: specifies the location of the intermediate data products * **---tmpdir-prefix**: specifies the location of the intermediate data products
* **---parallel**: jobs will run in parallel * **---parallel**: jobs will run in parallel
* **---singularity**: use Singularity instead of Docker
* **---no-container**: don't use Docker container (only for manual installation) * **---no-container**: don't use Docker container (only for manual installation)
* **---preserve-entire-environment**: use system environment variables (only for manual installation) * **---preserve-entire-environment**: use system environment variables (only for manual installation)
* **---debug**: more verbose output (use only for debugging the pipeline) * **---debug**: more verbose output (use only for debugging the pipeline)
...@@ -74,6 +75,7 @@ The following ``<cwl_options>`` are recommended to use for running **prefactor** ...@@ -74,6 +75,7 @@ The following ``<cwl_options>`` are recommended to use for running **prefactor**
* **---stats**: creates runtime statistics * **---stats**: creates runtime statistics
* **---maxLocalJobs**: amount of local jobs to be run at the same time ("max_per_node") * **---maxLocalJobs**: amount of local jobs to be run at the same time ("max_per_node")
* **---retryCount**: amount of retries for each failed pipeline job * **---retryCount**: amount of retries for each failed pipeline job
* **---singularity**: use Singularity instead of Docker
* **---preserve-entire-environment**: use system environment variables (only for manual installation) * **---preserve-entire-environment**: use system environment variables (only for manual installation)
* **---no-container**: don't use Docker container (only for manual installation) * **---no-container**: don't use Docker container (only for manual installation)
......
...@@ -18,14 +18,6 @@ hints: ...@@ -18,14 +18,6 @@ hints:
arguments: arguments:
- steps=[ddecal,count] - steps=[ddecal,count]
- ddecal.uvlambdamin=300
- ddecal.maxiter=50
- ddecal.nchan=1
- ddecal.solint=1
- ddecal.tolerance=1.e-3
- ddecal.usemodelcolumn=True
- ddecal.flagdivergedonly=True
- ddecal.propagateconvergedonly=True
inputs: inputs:
- id: msin - id: msin
...@@ -71,6 +63,16 @@ inputs: ...@@ -71,6 +63,16 @@ inputs:
default: true default: true
inputBinding: inputBinding:
prefix: ddecal.propagatesolutions=True prefix: ddecal.propagatesolutions=True
- id: propagate_converged_only
type: boolean?
default: true
inputBinding:
prefix: ddecal.propagateconvergedonly=True
- id: usemodelcolumn
type: boolean?
default: true
inputBinding:
prefix: ddecal.usemodelcolumn=True
- id: flagunconverged - id: flagunconverged
type: boolean? type: boolean?
default: false default: false
...@@ -78,9 +80,9 @@ inputs: ...@@ -78,9 +80,9 @@ inputs:
Flag unconverged solutions (i.e., those from solves that did not converge Flag unconverged solutions (i.e., those from solves that did not converge
within maxiter iterations). within maxiter iterations).
inputBinding: inputBinding:
prefix: ddecal.flagdivergedonly=True prefix: ddecal.flagunconverged=True
- id: flagdivergedonly - id: flagdivergedonly
default: false default: true
type: boolean? type: boolean?
doc: | doc: |
Flag only the unconverged solutions for which divergence was detected. Flag only the unconverged solutions for which divergence was detected.
...@@ -119,14 +121,49 @@ inputs: ...@@ -119,14 +121,49 @@ inputs:
inputBinding: inputBinding:
prefix: ddecal.mode= prefix: ddecal.mode=
separate: false separate: false
- id: nchan
type: int?
default: 1
inputBinding:
position: 0
prefix: ddecal.nchan=
separate: false
- id: maxiter
type: int?
default: 50
inputBinding:
position: 0
prefix: ddecal.maxiter=
separate: false
- id: tolerance
type: float?
default: 1e-3
inputBinding:
position: 0
prefix: ddecal.tolerance=
separate: false
- id: uvlambdamin
type: int?
default: 300
inputBinding:
position: 0
prefix: ddecal.uvlambdamin=
separate: false
- id: solint
type: int?
default: 1
inputBinding:
position: 0
prefix: ddecal.solint=
separate: false
#--------------------
- id: save2json - id: save2json
default: true default: true
type: boolean? type: boolean?
inputBinding: inputBinding:
position: 0 position: 0
prefix: count.savetojson=True prefix: count.savetojson=True
- id: jsonfilename - id: jsonfilename
type: string? type: string?
default: 'out.json' default: 'out.json'
......
...@@ -71,3 +71,4 @@ requirements: ...@@ -71,3 +71,4 @@ requirements:
inplaceUpdate: true inplaceUpdate: true
- class: InlineJavascriptRequirement - class: InlineJavascriptRequirement
stdout: ms_concat.log stdout: ms_concat.log
stderr: ms_concat_err.log
\ No newline at end of file
...@@ -37,15 +37,19 @@ requirements: ...@@ -37,15 +37,19 @@ requirements:
output = check_unflagged_fraction(ms, min_fraction=min_fraction, print_fraction=True) output = check_unflagged_fraction(ms, min_fraction=min_fraction, print_fraction=True)
filename = os.path.basename(output['flagged']) filename = os.path.basename(output['filename'].rstrip('/'))
unflagged_fraction = output['unflagged_fraction'] unflagged_fraction = output['unflagged_fraction']
flagged = output['flagged']
if filename != 'None':
shutil.move(filename, filename.lstrip('out_'))
cwl_output = {} cwl_output = {}
cwl_output['unflagged_fraction'] = unflagged_fraction cwl_output['unflagged_fraction'] = unflagged_fraction
if flagged != 'None':
shutil.move(filename, filename.lstrip('out_'))
cwl_output['filename'] = 'None'
else:
cwl_output['filename'] = filename
with open('./out.json', 'w') as fp: with open('./out.json', 'w') as fp:
json.dump(cwl_output, fp) json.dump(cwl_output, fp)
...@@ -60,6 +64,12 @@ outputs: ...@@ -60,6 +64,12 @@ outputs:
loadContents: true loadContents: true
glob: 'out.json' glob: 'out.json'
outputEval: $(JSON.parse(self[0].contents).unflagged_fraction) outputEval: $(JSON.parse(self[0].contents).unflagged_fraction)
- id: filenames
type: string
outputBinding:
loadContents: true
glob: 'out.json'
outputEval: $(JSON.parse(self[0].contents).filename)
- id: logfile - id: logfile
type: File[] type: File[]
outputBinding: outputBinding:
......
...@@ -92,7 +92,7 @@ requirements: ...@@ -92,7 +92,7 @@ requirements:
min_flagged_fraction = min(flagged_fraction_list) min_flagged_fraction = min(flagged_fraction_list)
refant = flagged_fraction_data[min_flagged_fraction][0] refant = flagged_fraction_data[min_flagged_fraction][0]
print('Selected station ' + str(refant) + ' as reference antenna. Fraction of flagged data is ' + '{:>3}'.format('{:.1f}'.format(min_flagged_fraction) + '%')) print('Selected station ' + str(refant) + ' as reference antenna. Fraction of flagged data is ' + '{:>3}'.format('{:.1f}'.format(100 * min_flagged_fraction) + '%'))
flagged_fraction_antenna['state'] = inputs['state'] flagged_fraction_antenna['state'] = inputs['state']
......
...@@ -88,12 +88,37 @@ inputs: ...@@ -88,12 +88,37 @@ inputs:
separate: true separate: true
itemSeparator: ',' itemSeparator: ','
valueFrom: '$(self)' valueFrom: '$(self)'
- id: removed_bands
default: false
type:
- string?
- boolean?
inputBinding:
position: 0
prefix: '--removed_bands'
separate: true
itemSeparator: ','
valueFrom: '$(self)'
- id: min_unflagged_fraction
default: 0.5
type: float?
inputBinding:
position: 0
prefix: '--min_unflagged'
doc: minimum fraction of unflagged data per band to continue
- id: demix - id: demix
default: false default: false
type: boolean? type: boolean?
inputBinding: inputBinding:
position: 0 position: 0
prefix: '--demix True' prefix: '--demix True'
- id: refant
default: ''
type: string?
inputBinding:
position: 0
prefix: '--refant'
doc: Reference antenna used
- id: output_fname - id: output_fname
type: type:
- boolean? - boolean?
......
...@@ -413,7 +413,9 @@ steps: ...@@ -413,7 +413,9 @@ steps:
- id: Ateam_flags_join_out - id: Ateam_flags_join_out
- id: inspection - id: inspection
- id: logfiles - id: logfiles
- id: removed_bands
- id: total_bandwidth - id: total_bandwidth
- id: out_refant
run: ./prefactor_target/gsmcal.cwl run: ./prefactor_target/gsmcal.cwl
label: gsmcal label: gsmcal
'sbg:x': 900 'sbg:x': 900
...@@ -461,6 +463,12 @@ steps: ...@@ -461,6 +463,12 @@ steps:
source: demix_sources source: demix_sources
- id: ncores - id: ncores
source: ncores source: ncores
- id: removed_bands
source: gsmcal/removed_bands
- id: min_unflagged_fraction
source: min_unflagged_fraction
- id: refant
source: gsmcal/out_refant
out: out:
- id: msout - id: msout
- id: solutions - id: solutions
......
...@@ -5,6 +5,21 @@ label: finalize ...@@ -5,6 +5,21 @@ label: finalize
$namespaces: $namespaces:
sbg: 'https://www.sevenbridges.com/' sbg: 'https://www.sevenbridges.com/'
inputs: inputs:
- id: refant
type: string?
default: 'CS001HBA0'
'sbg:x': -1000
'sbg:y': -1000
- id: min_unflagged_fraction
type: float?
default: 0.5
'sbg:x': -1000
'sbg:y': -900
- id: removed_bands
type: 'string[]?'
default: []
'sbg:x': -1000
'sbg:y': -800
- id: demix_sources - id: demix_sources
type: 'string[]?' type: 'string[]?'
default: [] default: []
...@@ -276,6 +291,13 @@ steps: ...@@ -276,6 +291,13 @@ steps:
- id: demix_sources - id: demix_sources
source: demix_sources source: demix_sources
valueFrom: "$(self.join(','))" valueFrom: "$(self.join(','))"
- id: removed_bands
source: removed_bands
valueFrom: "$(self.join(','))"
- id: min_unflagged_fraction
source: min_unflagged_fraction
- id: refant
source: refant
out: out:
- id: summary_file - id: summary_file
- id: logfile - id: logfile
......
...@@ -120,6 +120,12 @@ outputs: ...@@ -120,6 +120,12 @@ outputs:
linkMerge: merge_flattened linkMerge: merge_flattened
'sbg:x': 1900 'sbg:x': 1900
'sbg:y': 800 'sbg:y': 800
- id: out_refant
outputSource:
- findRefAnt_join/refant
type: string
'sbg:x': 1900
'sbg:y': 900
- id: logfiles - id: logfiles
outputSource: outputSource:
- concat_logfiles_identify/output - concat_logfiles_identify/output
...@@ -137,6 +143,12 @@ outputs: ...@@ -137,6 +143,12 @@ outputs:
linkMerge: merge_flattened linkMerge: merge_flattened
'sbg:x': 1900 'sbg:x': 1900
'sbg:y': 1000 'sbg:y': 1000
- id: removed_bands
outputSource:
- check_unflagged_fraction/filenames
type: 'string[]'
'sbg:x': 1900
'sbg:y': 1100
- id: total_bandwidth - id: total_bandwidth
outputSource: outputSource:
- sort_times_into_freqGroups/total_bandwidth - sort_times_into_freqGroups/total_bandwidth
...@@ -434,6 +446,7 @@ steps: ...@@ -434,6 +446,7 @@ steps:
out: out:
- id: msout - id: msout
- id: unflagged_fraction - id: unflagged_fraction
- id: filenames
- id: logfile - id: logfile
run: ../../steps/check_unflagged_fraction.cwl run: ../../steps/check_unflagged_fraction.cwl
label: check_unflagged_fraction label: check_unflagged_fraction
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment