From 8ba588ff038aa0b1cb991174ee051453382aa1f0 Mon Sep 17 00:00:00 2001 From: mancini <mancini@astron.nl> Date: Fri, 8 Nov 2019 17:48:10 +0100 Subject: [PATCH] Add LoSoTo.Plotscreen --- .gitlab-ci.yml | 8 +++- steps/LoSoTo.Plotscreen.cwl | 81 ++++++++++++++++++++++++++++++++ test_jobs/losoto_plotscreen.json | 5 ++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 steps/LoSoTo.Plotscreen.cwl create mode 100644 test_jobs/losoto_plotscreen.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0731b1d..1c2ab1c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,12 @@ losoto_plot: script: - cwl-runner --no-container steps/LoSoTo.Plot.cwl test_jobs/losoto_plot.json +losoto_plotscreen: + stage: test_steps + allow_failure: true + script: + - cwl-runner --no-container steps/LoSoTo.Plotscreen.cwl test_jobs/losoto_plotscreen.json + parset_selector: stage: test_steps allow_failure: true @@ -99,7 +105,7 @@ h5parm_collector: allow_failure: true script: - cwltool --no-container --preserve-environment LD_LIBRARY_PATH --preserve-environment PATH --preserve-environment PYTHONPATH steps/H5ParmCollector.cwl test_jobs/h5parm_collector.json - + blsmooth: stage: test_steps allow_failure: true diff --git a/steps/LoSoTo.Plotscreen.cwl b/steps/LoSoTo.Plotscreen.cwl new file mode 100644 index 00000000..8e9df76d --- /dev/null +++ b/steps/LoSoTo.Plotscreen.cwl @@ -0,0 +1,81 @@ +#!/usr/bin/env cwl-runner + +class: CommandLineTool +cwlVersion: v1.0 +id: losoto_plotscreen + +doc: | + Plot screens (one plot is made per time and per station) + +requirements: + InlineJavascriptRequirement: + expressionLib: + - | + function get_config() { + var par = ['soltab = ' + inputs.soltab] + if (inputs.ncpu !== null) par.push('ncpu='+inputs.ncpu); + par.push('[plot]') + par.push('operation = PLOTSCREEN') + for(var field_name in inputs){ + if(field_name === 'input_h5parm' || + field_name === 'soltab' || + field_name === 'ncpu') continue; + if(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/prefactor-ci:master + +inputs: + - id: input_h5parm + type: File + - id: soltab + type: string[] + doc: "Tabs to plot" + - id: resSoltab + type: string? + doc: Soltab containing the screen residuals. + - id: minZ + type: float? + doc: Minimum value of colorbar scale. + - id: maxZ + type: float? + doc: Max value of colorbar scale. + - id: prefix + default: 'losoto.plotscreen.' + type: string? + doc: String to prepend to output plots. + - id: remove_gradient + type: boolean? + doc: If True, remove gradient before plotting. + - id: show_source_names + type: boolean? + doc: If True, source names are overplotted. + - id: ncpu + type: int? + doc: Number of CPUs to use. If 0, all are used. + + +outputs: + - id: output_plots + type: File[] + outputBinding: + glob: "$(inputs.prefix)*.png" diff --git a/test_jobs/losoto_plotscreen.json b/test_jobs/losoto_plotscreen.json new file mode 100644 index 00000000..12a99054 --- /dev/null +++ b/test_jobs/losoto_plotscreen.json @@ -0,0 +1,5 @@ +{ + "input_h5parm": {"class": "File", "path": "/data/example.h5"}, + "soltab": ["sol000/amplitude000"], + "resSoltab": "amplitude000" +} -- GitLab