Commit b70fd69f authored by mancini's avatar mancini

Merge branch 'LoSoTo-Reweight' into 'master'

Add LoSoTo reweight

See merge request !10
parents 4661a409 47d2992e
Pipeline #500 passed with stages
in 3 minutes and 34 seconds
......@@ -135,6 +135,14 @@ losoto_interpolate:
allow_failure: true
script:
- cwl-runner --no-container steps/LoSoTo.Interpolate.cwl test_jobs/losoto_interpolate.json
losoto_reweight:
stage: test_steps
allow_failure: true
script:
- cwl-runner --no-container steps/LoSoTo.Reweight.cwl test_jobs/losoto_reweight.json
losoto_residual:
stage: test_steps
allow_failure: true
......
#!/usr/bin/env cwl-runner
class: CommandLineTool
cwlVersion: v1.0
id: losoto_reweight
$namespaces:
lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
doc: |
Change the the weight values.
Parameters
requirements:
InlineJavascriptRequirement:
expressionLib:
- { $include: utils.js}
InitialWorkDirRequirement:
listing:
- entryname: 'parset.config'
entry: $(get_losoto_config('REWEIGHT').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: mode
default: 'uniform'
type:
- type: enum
symbols:
- uniform
- window
- copy
doc: One of 'uniform' (single value), 'window' (sliding window in time), or 'copy' (copy from another table), by default 'uniform'.
- id: weightVal
type: float?
doc: Set weights to this values (0=flagged), by default 1.
- id: nmedian
type: int?
doc: |
Median window size in number of timeslots for 'window' mode.
If nonzero, a median-smoothed version of the input values is
subtracted to detrend them. If 0, no smoothing or subtraction is
done, by default 3.
- id: nstddev
type: int?
doc: Standard deviation window size in number of timeslots for 'window' mode, by default 251.
- id: soltabImport
type: string?
doc: Name of a soltab. Copy weights from this soltab (must have same axes shape), by default none.
- id: flagBad
type: boolean?
doc: Re-apply flags to bad values (1 for amp, 0 for other tables), by default False.
outputs:
- id: output_h5parm
type: File
format: lofar:#H5Parm
outputBinding:
glob: $(inputs.input_h5parm.basename)
$schema:
- https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
function get_losoto_config(step_name) {
var par = ['soltab = ' + inputs.soltab]
if (inputs.ncpu !== null) par.push('ncpu='+inputs.ncpu);
if (inputs.ncpu !== null && inputs.ncpu !== undefined) par.push('ncpu='+inputs.ncpu);
console.log(inputs, par)
par.push("[" + step_name + "]")
par.push('operation=' + step_name)
for(var field_name in inputs){
......
{
"input_h5parm": {"class": "File", "path": "/data/example.h5", "format": "lofar:#H5Parm"},
"soltab": "sol000/phase000"
}
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