diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78e53fe0cdc7e750f1ab805cd599bd21aa91643a..e82264fd2be577525197db9bb31c7b4a715d350c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,7 +86,11 @@ losoto_plot: allow_failure: true script: - cwl-runner --no-container steps/LoSoTo.Plot.cwl test_jobs/losoto_plot.json - +losoto_flag: + stage: test_steps + allow_failure: true + script: + - cwl-runner --no-container steps/LoSoTo.Flag.cwl test_jobs/losoto_flag.json losoto_norm: stage: test_steps allow_failure: true diff --git a/steps/LoSoTo.Flag.cwl b/steps/LoSoTo.Flag.cwl new file mode 100644 index 0000000000000000000000000000000000000000..30dbd1645e993d8cfebc2566629f68c2bc2910ed --- /dev/null +++ b/steps/LoSoTo.Flag.cwl @@ -0,0 +1,105 @@ +#!/usr/bin/env cwl-runner + +class: CommandLineTool +cwlVersion: v1.0 +id: losoto_flag + +$namespaces: + lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl +doc: | + This operation for LoSoTo implement a flagging procedure + WEIGHT: compliant + + +requirements: + InlineJavascriptRequirement: + expressionLib: + - { $include: utils.js} + InitialWorkDirRequirement: + listing: + - entryname: 'parset.config' + entry: $(get_losoto_config('FLAG').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: axesToFlag + type: string[] + doc: Axes along which to smooth+find outlier (e.g. ['time', 'freq']), max 2 values. + - id: order + type: int[] + doc: | + Order of the function fitted during detrending. + Array must have same size of axesToFlag. + If mode=smooth these are the window of the running median (0=all axis). + - id: maxCycles + type: int? + doc: Max number of independent flagging cycles, by default 5. + - id: maxRms + type: float? + doc: Rms to clip outliers, by default 5. + - id: maxRmsNoise + type: float? + doc: | + Do a running rms and then flag those regions that have a rms higher + than MaxRmsNoise*rms_of_rmses, by default 0 (ignored). + - id: fixRms + type: float? + doc: Instead of calculating rms use this value, by default 0 (ignored). + - id: fixRmsNoise + type: float? + doc: | + Instead of calculating rms of the rmses use this value + (it will not be multiplied by the MaxRmsNoise), by default 0 (ignored). + - id: windowNoise + type: int? + doc: Window size for the running rms, by default 11. + + - id: replace + type: boolean? + doc: | + Replace bad values with the interpolated ones, + instead of flagging them. By default False. + - id: preflagzeros + type: boolean? + doc: + Flag zeros/ones (bad solutions in BBS/DPPP). + They should be flagged at import time. By default False. + - id: mode + type: string? + doc: | + Detrending/fitting algorithm: smooth / poly / spline. + By default smooth. + - id: refAnt + type: string? + doc: Reference antenna, by default None. + - id: ncpu + type: int? + doc: Number of cpu to use, by default all available. + +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 diff --git a/test_jobs/losoto_flag.json b/test_jobs/losoto_flag.json new file mode 100644 index 0000000000000000000000000000000000000000..f1ce6b2ff3d83e424444f2c65cb731b3360b4703 --- /dev/null +++ b/test_jobs/losoto_flag.json @@ -0,0 +1,6 @@ +{ + "input_h5parm": {"class": "File", "path": "/data/example.h5", "format": "lofar:#H5Parm"}, + "soltab": "sol000/phase000", + "axesToFlag": ["time"], + "order": [0] +}