Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LINC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ResearchAndDevelopment
LINC
Commits
9080c3fd
Commit
9080c3fd
authored
5 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Refactor find skymodel cal
Former-commit-id:
33381e1d
Former-commit-id:
26f182cb
parent
337f613d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
steps/find_skymodel_cal.cwl
+27
-6
27 additions, 6 deletions
steps/find_skymodel_cal.cwl
with
27 additions
and
6 deletions
steps/find_skymodel_cal.cwl
+
27
−
6
View file @
9080c3fd
...
...
@@ -7,12 +7,14 @@ baseCommand:
- python3
inputs:
- id: msin
type: Directory
type: Directory
[]
doc: MS containing the calibrator
inputBinding:
position: 0
- id: skymodels
type: Directory
type:
- Directory?
- File?
doc: Directory containing the sky models
- id: skymodels_extension
type: string?
...
...
@@ -23,6 +25,9 @@ arguments:
- '-c'
- |
import sys
import os
import shutil
null = None
from unittest.mock import MagicMock
sys.modules['lofarpipe.support.data_map'] = MagicMock()
...
...
@@ -31,16 +36,26 @@ arguments:
from find_skymodel_cal import main as find_skymodel
import json
mss = sys.argv[1:]
skymodels = "$(inputs.skymodels.path)"
print(mss)
skymodels = $(inputs.skymodels)
extension = "$(inputs.skymodels_extension)"
if skymodels is None:
skymodels = "/data/skymodels"
else:
skymodels = skymodels["path"]
output = {}
if extension != 'null':
output = find_skymodel(mss, skymodels, './', extension)
else:
output = find_skymodel(mss, skymodels, './')
cwl_output = {'class': 'File', 'path': output['SkymodelCal']}
skymodel_path = output['SkymodelCal']
skymodel_name = output['SkymodelName']
skymodel_path = shutil.copy(skymodel_path, os.getcwd())
cwl_output = {"file":{'class': 'File', 'path': skymodel_path},
"skymodel_name": skymodel_name}
with open('./out.json', 'w') as fp:
json.dump(cwl_output, fp)
outputs:
...
...
@@ -49,11 +64,17 @@ outputs:
outputBinding:
loadContents: true
glob: 'out.json'
outputEval: $(JSON.parse(self[0].contents))
outputEval: $(JSON.parse(self[0].contents)
.file
)
- id: model_name
type: string
outputBinding:
loadContents: true
glob: 'out.json'
outputEval: $(JSON.parse(self[0].contents).skymodel_name)
requirements:
- class: InlineJavascriptRequirement
hints:
DockerRequirement:
dockerPull: lofareosc/prefactor
-ci:master
dockerPull: lofareosc/prefactor
:latest
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment