From feb1acea7bdf6ac7e313cf14c8b4a9bb8449b690 Mon Sep 17 00:00:00 2001
From: mancini <mancini@astron.nl>
Date: Mon, 2 Mar 2020 17:11:22 +0100
Subject: [PATCH] Add parameters to workflow

Former-commit-id: 34d0b86f2f0c2c621d43f0636633a56f9b13800a [formerly ee4db0087ffc7254e79849029a9eff8ad0518a63]
Former-commit-id: 13321eced645503ab79afa6c428a2d1dfa9ee2ae
Former-commit-id: ae28496ecf2d9f5f73f4475af3fbf76924888a2a
---
 subworkflow/losoto_ion.cwl       | 102 ++++++++++++++++++++++++++-----
 subworkflow/smooth_calibrate.cwl |   3 +-
 2 files changed, 89 insertions(+), 16 deletions(-)

diff --git a/subworkflow/losoto_ion.cwl b/subworkflow/losoto_ion.cwl
index 898c6963..cdccd1fb 100644
--- a/subworkflow/losoto_ion.cwl
+++ b/subworkflow/losoto_ion.cwl
@@ -9,51 +9,123 @@ inputs:
     type: File
     'sbg:x': -588.3988647460938
     'sbg:y': -147.5
-outputs: []
+  - id: fit3rdorder
+    type: boolean?
+    'sbg:x': 83.60113525390625
+    'sbg:y': 53.5
+outputs:
+  - id: output_h5parm
+    outputSource:
+      - losoto_flagstation/output_h5parm
+    type: File
+    'sbg:x': 775
+    'sbg:y': -169
 steps:
-  - id: losoto_flag
+  - id: flag
     in:
       - id: input_h5parm
         source: input_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToFlag
+        default:
+          - time
+          - freq
+      - id: order
+        default:
+          - 100
+          - 40
+      - id: maxCycles
+        default: 1
+      - id: maxRms
+        default: 5
+      - id: mode
+        default: smooth
     out:
       - id: output_h5parm
     run: ../lofar-cwl/steps/LoSoTo.Flag.cwl
     'sbg:x': -442.3984375
     'sbg:y': -138.5
-  - id: losoto_flagextend
+  - id: flagextend
     in:
       - id: input_h5parm
-        source: losoto_flag/output_h5parm
+        source: flag/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToExt
+        default:
+          - time
+          - freq
+      - id: size
+        default:
+          - 200
+          - 80
+      - id: percent
+        default: 50
+      - id: maxCycles
+        default: 2
     out:
       - id: output_h5parm
     run: ../lofar-cwl/steps/LoSoTo.Flagextend.cwl
     'sbg:x': -255
     'sbg:y': -160
-  - id: losoto_reweight
+  - id: merge
     in:
       - id: input_h5parm
-        source: losoto_flagextend/output_h5parm
+        source: flagextend/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: mode
+        default: copy
+      - id: soltabImport
+        default: amplitude000
     out:
       - id: output_h5parm
     run: ../lofar-cwl/steps/LoSoTo.Reweight.cwl
-    'sbg:x': 19
-    'sbg:y': -93
-  - id: losoto_duplicate
+    'sbg:x': -94
+    'sbg:y': -162
+  - id: duplicatePbkp
     in:
       - id: input_h5parm
-        source: losoto_reweight/output_h5parm
+        source: merge/output_h5parm
     out:
       - id: output_h5parm
     run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
-    'sbg:x': 241
-    'sbg:y': -96
+    'sbg:x': 69
+    'sbg:y': -162
   - id: losoto_flagstation
     in:
       - id: input_h5parm
-        source: losoto_duplicate/output_h5parm
+        source: losoto_residual/output_h5parm
     out:
       - id: output_h5parm
     run: ../lofar-cwl/steps/LoSoTo.FlagStation.cwl
-    'sbg:x': 579.6011352539062
-    'sbg:y': -62.5
+    'sbg:x': 587
+    'sbg:y': -172
+  - id: losoto_clocktec
+    in:
+      - id: input_h5parm
+        source: duplicatePbkp/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: fit3rdorder
+        source: fit3rdorder
+    out:
+      - id: output_h5parm
+    run: ../lofar-cwl/steps/LoSoTo.ClockTec.cwl
+    'sbg:x': 217.72296142578125
+    'sbg:y': -230.69259643554688
+  - id: losoto_residual
+    in:
+      - id: input_h5parm
+        source: losoto_clocktec/output_h5parm
+      - id: soltabsToSub
+        source:
+          - fit3rdorder
+        valueFrom: '$(self ? ["tec", "clock", "tec3rd"] : ["tec", "clock"])'
+    out:
+      - id: output_h5parm
+    run: ../lofar-cwl/steps/LoSoTo.Residual.cwl
+    'sbg:x': 411.0426330566406
+    'sbg:y': -168.98934936523438
 requirements: []
diff --git a/subworkflow/smooth_calibrate.cwl b/subworkflow/smooth_calibrate.cwl
index 17ded277..29fb52a9 100644
--- a/subworkflow/smooth_calibrate.cwl
+++ b/subworkflow/smooth_calibrate.cwl
@@ -43,7 +43,7 @@ outputs:
   - id: h5parm
     outputSource:
       - calib_cal/h5parm
-    type: File
+    type: File[]
     'sbg:x': 104.91718292236328
     'sbg:y': -19.33123779296875
 steps:
@@ -65,6 +65,7 @@ steps:
     label: smooth_corrected
     scatter:
       - msin
+    scatterMethod: flat_crossproduct
     'sbg:x': -394
     'sbg:y': -29
   - id: calib_cal
-- 
GitLab