Commit 1d4d47fa authored by mancini's avatar mancini

Squashed 'lofar-cwl/' changes from 968a5cc..1838edc

1838edc Merge branch 'applycal_step_generator' into 'master'
cc95193 Add applycal step
cfecd9f Merge branch 'add_losoto_polalign' into 'master'
46e4fc9 Add losoto polalign

git-subtree-dir: lofar-cwl
git-subtree-split: 1838edc51ca17c6fe26f628533dd8f8223305e4d
parent c116d304
......@@ -51,6 +51,12 @@ average_step_generator:
- cwl-runner steps/DP3.AveragerStepGenerator.cwl test_jobs/averager_step_generator.json
- ! cwl-runner steps/DP3.AveragerStepGenerator.cwl test_jobs/averager_step_generator_error.json
applycal_step_generator:
stage: test_steps
allow_failure: true
script:
- cwl-runner steps/DP3.ApplyCalStepGenerator.cwl test_jobs/applycal_step_generator.json
aoflagger_step_generator:
stage: test_steps
allow_failure: true
......@@ -105,6 +111,13 @@ losoto_residual:
script:
- cwl-runner --no-container steps/LoSoTo.Residual.cwl test_jobs/losoto_residual.json
losoto_polalign:
stage: test_steps
allow_failure: true
script:
- cwl-runner --no-container steps/LoSoTo.Polalign.cwl test_jobs/losoto_polalign.json
parset_selector:
stage: test_steps
allow_failure: true
......@@ -116,6 +129,7 @@ file_selector:
allow_failure: true
script:
- cwl-runner steps/FileSelector.cwl test_jobs/file_selector.json
NDPPP:
stage: test_steps
......
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.0
id: applycal_step_generator
inputs:
- id: steps
type: Any[]?
default: []
- id: step_name
type: string
doc: unique name for the step
default: applycal
- id: parmdb
type: string
doc: Path of parmdb in which the parameters are stored. This can also be an H5Parm file, in that case the filename has to end in '.h5'
- id: solset
type: string?
doc: |
In case of applying an H5Parm file: the name of the solset to be used.
If empty, defaults to the name of one solset present in the H5Parm
(if more solsets are present in an H5Parm and solset is left empty,
an error will be thrown)
- id: correction
type:
type: enum
symbols:
- gain
- tec
- clock
- rotationangle
- rotation
- scalarphase
- scalaramplitude
- rotationmeasure
- fulljones
doc: |
Type of correction to perform, can be one of 'gain', 'tec', 'clock',
'(common)rotationangle' / 'rotation', '(common)scalarphase',
'(common)scalaramplitude' or 'rotationmeasure'
(create multiple ApplyCal steps for multiple corrections).
When using H5Parm,
this is for now the name of the soltab;
the type will be deduced from the metadata in that soltab,
except for full Jones, in which case correction should be 'fulljones'.
- id: soltab
type: string[]?
doc: |
The name or names of the H5 soltab.
Currently only used when correction=fulljones,
in which case soltab should list two names (amplitude and phase soltab).
- id: direction
type: string?
doc: If using H5Parm, the direction of the solution to use
- id: updateweights
type: boolean?
doc: |
Update the weights column, in a way consistent with
the weights being inverse proportional to the autocorrelations
(e.g. if 'autoweights' was used before).
- id: interpolation
default: nearest
type:
type: enum
symbols:
- nearest
- linear
doc: If using H5Parm, the type of interpolation (in time and frequency) to use, can be one of 'nearest' or 'linear'.
- id: invert
type: boolean?
doc: |
Invert the corrections, to correct the data. Default is true.
If you want to corrupt the data, set it to 'false'
- id: timeslotsperparmupdate
type: int?
doc: |
Number of time slots to handle after one read of the parameter file.
Optimization to prevent spurious reading from the parmdb.
outputs:
- id: augmented_steps
outputSource:
- DP3_GenericStep/augmented_steps
type: Any[]
steps:
- id: DP3_GenericStep
in:
- id: step_type
default: 'applycal'
- id: output_files
default: ["parmdb"]
- id: step_id
source: step_name
- id: steps
source: steps
- id: parameters
valueFrom: $(inputs)
- id: parmdb
source: parmdb
- id: solset
source: solset
- id: correction
source: correction
- id: soltab
source: soltab
- id: direction
source: direction
- id: updateweights
source: updateweights
- id: interpolation
source: interpolation
- id: invert
source: invert
- id: timeslotsperparmupdate
source: timeslotsperparmupdate
#-------------------------------
out:
- augmented_steps
run: ../steps/DP3.GenericStep.cwl
requirements:
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
- class: MultipleInputFeatureRequirement
class: CommandLineTool
cwlVersion: v1.0
id: losoto_polalign
$namespaces:
lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
$schema:
- https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
doc: |
Estimate polarization misalignment as delay
requirements:
InlineJavascriptRequirement:
expressionLib:
- |
function get_config() {
var par = ['soltab = ' + inputs.soltab]
if (inputs.ncpu !== null) par.push('ncpu='+inputs.ncpu);
par.push('[polalign]')
par.push('operation = POLALIGN')
for(var field_name in inputs){
if(field_name === 'input_h5parm' ||
field_name === 'soltab' ||
field_name === 'ncpu') continue;
if(inputs[field_name] === null ||
inputs[field_name] === 'null') continue;
par.push(field_name+'='+inputs[field_name])
}
return par
}
InitialWorkDirRequirement:
listing:
- entryname: 'parset.config'
entry: $(get_config().join('\n'))
- entryname: $(inputs.input_h5parm.basename)
entry: $(inputs.input_h5parm)
writable: true
baseCommand: "losoto"
arguments:
- $(inputs.input_h5parm.basename)
- parset.config
hints:
DockerRequirement:
dockerPull: lofareosc/lofar-pipeline-ci:latest
inputs:
- id: input_h5parm
type: File
format: lofar:#H5Parm
- id: soltab
type: string
doc: "Solution table"
- id: soltabout
default: phasediff
type: string?
doc: output table name (same solset)
- id: maxResidual
type: float?
default: 1
doc: Maximum acceptable rms of the residuals in radians before flagging. Set to zero to avoid the check.
- id: fitOffset
type: boolean?
default: false
doc: Assume that together with a delay each station has also a differential phase offset (important for old LBA observations).
- id: average
type: boolean?
default: false
doc: Mean-average in time the resulting delays/offset.
- id: replace
type: boolean?
default: false
doc: replace using smoothed value instead of flag bad data? Smooth must be active.
- id: refAnt
type: string?
doc: Reference antenna, if not set use the first one.
outputs:
- id: output_h5parm
type: File
format: lofar:#H5Parm
outputBinding:
glob: $(inputs.input_h5parm.basename)
{
"input_parset": [{
"step_type": "name",
"step_id": "id",
"parameters": []
}],
"parmdb": "out.h5",
"correction": "gain"
}
{
"input_h5parm": {
"class": "File",
"path": "/data/example.h5",
"format": "lofar:#H5Parm"
},
"soltab": "sol000/amplitude000",
"average": true
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment