From c7ee4eb75d7d263215d8ad0c96ac2290cb7385d7 Mon Sep 17 00:00:00 2001
From: mancini <mancini@astron.nl>
Date: Fri, 4 Dec 2020 17:01:33 +0100
Subject: [PATCH] Change workflow to select only the first directory

Former-commit-id: 948be8b10b1f176078796b899e23a3b508160f65
---
 ..._one_directory.cwl => selectfirstdirectory.cwl} |  7 +++----
 workflows/prefactor_calibrator/prep.cwl            | 14 +++++++-------
 2 files changed, 10 insertions(+), 11 deletions(-)
 rename steps/{copy_in_one_directory.cwl => selectfirstdirectory.cwl} (77%)

diff --git a/steps/copy_in_one_directory.cwl b/steps/selectfirstdirectory.cwl
similarity index 77%
rename from steps/copy_in_one_directory.cwl
rename to steps/selectfirstdirectory.cwl
index 16a2be68..d214353f 100644
--- a/steps/copy_in_one_directory.cwl
+++ b/steps/selectfirstdirectory.cwl
@@ -1,5 +1,5 @@
-id: copy_in_one_directory
-label: copy_in_one_directory
+id: selectfirstdirectory
+label: selectfirstdirectory
 class: ExpressionTool
 
 cwlVersion: v1.0
@@ -9,7 +9,6 @@ inputs:
 outputs: 
     - id: output
       type: Directory
-      glob: .
 
 requirements:
     - class: InitialWorkDirRequirement
@@ -19,7 +18,7 @@ requirements:
 
 expression: |
   ${
-    
+    return {'output': inputs.input[0]}
   }
 
 
diff --git a/workflows/prefactor_calibrator/prep.cwl b/workflows/prefactor_calibrator/prep.cwl
index c87e9fbb..dba3a8e3 100644
--- a/workflows/prefactor_calibrator/prep.cwl
+++ b/workflows/prefactor_calibrator/prep.cwl
@@ -161,17 +161,17 @@ outputs:
     'sbg:x': 1554.5106201171875
     'sbg:y': 991
 steps:
-  - id: copy
+  - id: select
     in:
       - id: input
         source:
           - msin
     out:
       - id: output
-    run: ../../steps/copy_in_one_directory.cwl
-    label: copy_in_one_directory
-    'sbg:x': -267.1643981933594
-    'sbg:y': 480.32098388671875
+    run: ../../steps/selectfirstdirectory.cwl
+    label: select_ony_first
+    'sbg:x': -303.7861022949219
+    'sbg:y': 542.37646484375
   - id: ndppp_prep_cal
     in:
       - id: baselines_to_flag
@@ -263,7 +263,7 @@ steps:
     in:
       - id: ms
         source:
-          - copy/output
+          - select/output
       - id: min_separation
         source: min_separation
     out:
@@ -290,7 +290,7 @@ steps:
     in:
       - id: msin
         source:
-          - copy/output
+          - select/output
       - id: skymodels
         source: calibrator_path_skymodel
       - id: max_separation_arcmin
-- 
GitLab