From 2a23c0e183db67d3e4157658e89b139a46defb70 Mon Sep 17 00:00:00 2001 From: mancini <mancini@astron.nl> Date: Tue, 28 Apr 2020 11:29:29 +0200 Subject: [PATCH] Adds if execute plot generation --- lofar-cwl/steps/LoSoTo.Plot.cwl | 20 ++++++++++++++++++-- lofar-cwl/steps/utils.js | 3 ++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lofar-cwl/steps/LoSoTo.Plot.cwl b/lofar-cwl/steps/LoSoTo.Plot.cwl index c8533dbe..b5496487 100644 --- a/lofar-cwl/steps/LoSoTo.Plot.cwl +++ b/lofar-cwl/steps/LoSoTo.Plot.cwl @@ -19,13 +19,25 @@ requirements: - entryname: $(inputs.input_h5parm.basename) entry: $(inputs.input_h5parm) writable: true + - entryname: run_losoto_plot.sh + entry: | + #!/bin/bash + set -e + + INPUT_H5PARM=$(inputs.input_h5parm.basename) + DO_PLOTS=$(inputs.execute) + if [ DO_PLOT ] do + losoto --verbose $INPUT_H5PARM parset.config + else + echo Skipped plotting + fi baseCommand: "losoto" arguments: - '--verbose' - - $(inputs.input_h5parm.basename) + - - parset.config hints: @@ -36,9 +48,13 @@ inputs: - id: input_h5parm type: File format: lofar:#H5Parm + - id: execute + type: boolean? + default: true - id: soltab type: string doc: "Tabs to plot" + - id: axesInPlot type: string[]? @@ -127,7 +143,7 @@ inputs: outputs: - id: output_plots - type: File[] + type: File[]? outputBinding: glob: "$(inputs.prefix)*.png" - id: logfile diff --git a/lofar-cwl/steps/utils.js b/lofar-cwl/steps/utils.js index 2077e7ba..1df489a0 100644 --- a/lofar-cwl/steps/utils.js +++ b/lofar-cwl/steps/utils.js @@ -7,7 +7,8 @@ function get_losoto_config(step_name) { for(var field_name in inputs){ if(field_name === 'input_h5parm' || field_name === 'soltab' || - field_name === 'ncpu') continue; + field_name === 'ncpu' || + field_name === 'execute') continue; if(inputs[field_name] === null || inputs[field_name] === 'null') continue; -- GitLab