Skip to content
Snippets Groups Projects
gsmcal.cwl 13.2 KiB
Newer Older
alex's avatar
alex committed
class: Workflow
cwlVersion: v1.0
id: gsmcal
label: gsmcal
alex's avatar
alex committed
$namespaces:
  sbg: 'https://www.sevenbridges.com/'
inputs:
  - id: msin
    type: 'Directory[]'
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': -400
alex's avatar
alex committed
  - id: filter_baselines
    type: string
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': -300
  - id: num_SBs_per_group
alex's avatar
alex committed
    type: int
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': -200
  - id: reference_stationSB
    type: int
    default: null
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': -100
  - id: use_target
    type: boolean
alex's avatar
alex committed
    'sbg:x': -1000
alex's avatar
alex committed
    'sbg:y': 0
  - id: target_skymodel
    type: File?
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 100
  - id: skymodel_source
alex's avatar
alex committed
    type: string
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 200
  - id: do_smooth
    type: boolean
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 300
  - id: propagatesolutions
    type: boolean
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 400
  - id: avg_timeresolution_concat
    type: int
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 500
  - id: avg_freqresolution_concat
alex's avatar
alex committed
    type: string
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 600
alex's avatar
alex committed
  - id: min_unflagged_fraction
    type: float
alex's avatar
alex committed
    'sbg:x': -1000
    'sbg:y': 700
alex's avatar
alex committed
  - id: refant
    type: string
    'sbg:x': -1000
    'sbg:y': 800
  - id: min_length
    type: int?
    default: 5
    'sbg:x': -1000
    'sbg:y': 900
  - id: overhead
    type: float?
    default: 0.7
    'sbg:x': -1000
    'sbg:y': 1000
alex's avatar
alex committed
outputs:
  - id: msout
    outputSource:
alex's avatar
alex committed
      - calibrate_target/msout
alex's avatar
alex committed
    type: 'Directory[]'
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 0
  - id: outh5parm
alex's avatar
alex committed
    outputSource:
      - h5parm_collector/outh5parm
    type: File
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 200
  - id: bad_antennas
alex's avatar
alex committed
    outputSource:
alex's avatar
alex committed
      - identifybadantennas_join/filter_out
alex's avatar
alex committed
    type: string
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 400
alex's avatar
alex committed
  - id: outh5parm_logfile
    outputSource:
alex's avatar
alex committed
      - concat_logfiles_losoto/output
    type: File
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 600
alex's avatar
alex committed
  - id: inspection
    outputSource:
      - losoto_plot_P/output_plots
      - losoto_plot_P2/output_plots
      - losoto_plot_Pd/output_plots
      - losoto_plot_Pd2/output_plots
alex's avatar
alex committed
      - plot_unflagged/output_imag
alex's avatar
alex committed
    type: 'File[]'
    linkMerge: merge_flattened
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 800
alex's avatar
alex committed
  - id: logfiles
    outputSource:
alex's avatar
alex committed
      - concat_logfiles_identify/output
      - sort_times_into_freqGroups/logfile
      - find_skymodel_target/logfile
      - make_sourcedb_target/log
alex's avatar
alex committed
      - concat_logfiles_calib/output
      - concat_logfiles_dpppconcat/output
alex's avatar
alex committed
      - concat_logfiles_blsmooth/output
alex's avatar
alex committed
      - concat_logfiles_unflagged/output
      - ms_concat/logfile
      - aoflag/logfile
alex's avatar
alex committed
    type: 'File[]'
    linkMerge: merge_flattened
    'sbg:x': 1900
alex's avatar
alex committed
    'sbg:y': 1000
alex's avatar
alex committed
  - id: total_bandwidth
    outputSource:
      - sort_times_into_freqGroups/total_bandwidth
    type: int
    'sbg:x': 1900
    'sbg:y': 1200
alex's avatar
alex committed
steps:
  - id: identifybadantennas
alex's avatar
alex committed
    in:
      - id: msin
alex's avatar
alex committed
        source: msin
alex's avatar
alex committed
    out:
alex's avatar
alex committed
      - id: flaggedants
alex's avatar
alex committed
      - id: logfile
    run: ../../steps/identify_bad_antennas.cwl
    label: identifybadantennas
alex's avatar
alex committed
    scatter:
      - msin
alex's avatar
alex committed
    'sbg:x': -200
    'sbg:y': -300
alex's avatar
alex committed
  - id: identifybadantennas_join
    in:
      - id: flaggedants
        source:
          - identifybadantennas/flaggedants
alex's avatar
alex committed
      - id: filter
        source: filter_baselines
    out:
      - id: filter_out
      - id: logfile
    run: ../../steps/identify_bad_antennas_join.cwl
    label: identifybadantennas_join
    'sbg:x': 0
    'sbg:y': -300
  - id: sort_times_into_freqGroups
alex's avatar
alex committed
    in:
      - id: msin
        source:
          - msin
      - id: numbands
        source: num_SBs_per_group
alex's avatar
alex committed
      - id: NDPPPfill
        default: true
      - id: stepname
        default: .dpppconcat
      - id: firstSB
        source: reference_stationSB
      - id: truncateLastSBs
        default: false
alex's avatar
alex committed
    out:
      - id: filenames
      - id: groupnames
alex's avatar
alex committed
      - id: total_bandwidth
alex's avatar
alex committed
      - id: logfile
    run: ../../steps/sort_times_into_freqGroups.cwl
    label: sorttimesintofreqGroups
alex's avatar
alex committed
    'sbg:x': -200
    'sbg:y': 0
  - id: find_skymodel_target
alex's avatar
alex committed
    in:
      - id: msin
        source:
          - msin
      - id: SkymodelPath
        source: target_skymodel
      - id: Radius
        default: 5
      - id: Source
        source: skymodel_source
      - id: DoDownload
        source: use_target
alex's avatar
alex committed
    out:
      - id: skymodel
alex's avatar
alex committed
      - id: logfile
    run: ../../steps/find_skymodel_target.cwl
    label: find_skymodel_target
alex's avatar
alex committed
    'sbg:x': -200
    'sbg:y': -500
  - id: make_sourcedb_target
alex's avatar
alex committed
    in:
      - id: sky_model
        source: find_skymodel_target/skymodel
alex's avatar
alex committed
      - id: output_file_name
        default: target.sourcedb
alex's avatar
alex committed
      - id: logname
        default: make_sourcedb_target.log
alex's avatar
alex committed
    out:
      - id: sourcedb
      - id: log
    run: ../../lofar-cwl/steps/makesourcedb.cwl
    label: make_sourcedb_target
alex's avatar
alex committed
    'sbg:x': 0
    'sbg:y': -500
  - id: concat_logfiles_dpppconcat
alex's avatar
alex committed
    in:
      - id: file_list
        source:
alex's avatar
alex committed
          - concat/dpppconcat.log
alex's avatar
alex committed
      - id: file_prefix
        default: dpppconcat
alex's avatar
alex committed
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_dpppconcat
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': 100
alex's avatar
alex committed
  - id: concat_logfiles_blsmooth
    in:
      - id: file_list
        source:
alex's avatar
alex committed
          - calibrate_target/BLsmooth.log
alex's avatar
alex committed
      - id: file_prefix
        default: blsmooth_target
alex's avatar
alex committed
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_blsmooth
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': 300
  - id: concat_logfiles_calib
alex's avatar
alex committed
    in:
      - id: file_list
        source:
alex's avatar
alex committed
          - calibrate_target/gaincal.log
alex's avatar
alex committed
      - id: file_prefix
        default: gaincal
alex's avatar
alex committed
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_calib
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': 500
alex's avatar
alex committed
  - id: concat_logfiles_losoto
    in:
      - id: file_list
        linkMerge: merge_flattened
        source:
          - h5parm_collector/log
          - losoto_plot_P/logfile
          - losoto_plot_P2/logfile
          - losoto_plot_Pd/logfile
          - losoto_plot_Pd2/logfile
      - id: file_prefix
        default: losoto_gsmcal
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_losoto
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': 700
alex's avatar
alex committed
  - id: concat_logfiles_unflagged
    in:
      - id: file_list
        linkMerge: merge_flattened
        source:
          - merge_array_files/output
alex's avatar
alex committed
          - plot_unflagged/logfile
      - id: file_prefix
        default: check_unflagged_fraction
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_unflagged
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': 900
alex's avatar
alex committed
  - id: concat_logfiles_identify
    in:
      - id: file_list
        linkMerge: merge_flattened
        source:
          - identifybadantennas/logfile
          - identifybadantennas_join/logfile
      - id: file_prefix
        default: identifyBadAntennas
    out:
      - id: output
    run: ../../steps/concatenate_files.cwl
    label: concat_logfiles_identify
    'sbg:x': 1600
alex's avatar
alex committed
    'sbg:y': -100
alex's avatar
alex committed
  - id: concat
alex's avatar
alex committed
    in:
      - id: msin
alex's avatar
alex committed
        source:
          - msin
      - id: group_id
        source: sort_times_into_freqGroups/groupnames
      - id: groups_specification
        source: sort_times_into_freqGroups/filenames
      - id: filter_baselines
alex's avatar
alex committed
        source: identifybadantennas_join/filter_out
alex's avatar
alex committed
      - id: avg_timeresolution_concat
        source: avg_timeresolution_concat
      - id: avg_freqresolution_concat
        source: avg_freqresolution_concat
      - id: min_unflagged_fraction
        source: min_unflagged_fraction
    out:
alex's avatar
alex committed
      - id: dpppconcat.log
    run: ../../subworkflow/concat.cwl
    label: concat
    scatter:
      - group_id
alex's avatar
alex committed
    'sbg:x': 200
    'sbg:y': 0
  - id: ms_concat
    in:
      - id: min_length
        source: min_length
      - id: overhead
        source: overhead
      - id: msin
        source:
          - concat/msout
    out:
      - id: concat_meta_ms
      - id: concat_additional_ms
      - id: ms_outs
      - id: logfile
    run: ../../lofar-cwl/steps/ms_concat.cwl
    label: ms_concat
    'sbg:x': 400
    'sbg:y': 0
  - id: aoflag
    in:
      - id: msin
        source:
          - ms_concat/ms_outs
      - id: concat_meta_ms
        source: ms_concat/concat_meta_ms
      - id: concat_additional_ms
        source: ms_concat/concat_additional_ms
      - id: verbose
        default: true
      - id: combine-spws
        default: true
    out:
      - id: output_ms
      - id: logfile
    run: ../../steps/aoflag.cwl
    label: aoflag
    'sbg:x': 600
    'sbg:y': 0
  - id: check_unflagged_fraction
    in:
      - id: msin
        source: aoflag/output_ms
      - id: min_fraction
        source: min_unflagged_fraction
    out:
      - id: msout
      - id: unflagged_fraction
      - id: logfile
    run: ../../steps/check_unflagged_fraction.cwl
    label: check_unflagged_fraction
    scatter:
      - msin
    'sbg:x': 800
    'sbg:y': 0
alex's avatar
alex committed
  - id: merge_array
    in:
      - id: input
        source:
          - check_unflagged_fraction/msout
alex's avatar
alex committed
    out:
      - id: output
    run: ../../steps/merge_array.cwl
    label: merge_array
    'sbg:x': 1000
    'sbg:y': -100
  - id: merge_array_files
    in:
      - id: input
        source:
          - check_unflagged_fraction/logfile
    out:
      - id: output
    run: ../../steps/merge_array_files.cwl
    label: merge_array_files
    'sbg:x': 1000
    'sbg:y': 100
alex's avatar
alex committed
  - id: calibrate_target
    in:
      - id: msin
        source: merge_array/output
      - id: skymodel
        source: make_sourcedb_target/sourcedb
      - id: do_smooth
        source: do_smooth
      - id: propagatesolutions
        source: propagatesolutions
alex's avatar
alex committed
    out:
      - id: msout
      - id: BLsmooth.log
      - id: gaincal.log
      - id: outh5parm
alex's avatar
alex committed
    run: ../../subworkflow/calib_targ.cwl
    label: calibrate_target
    scatter:
alex's avatar
alex committed
      - msin
    'sbg:x': 1200
alex's avatar
alex committed
    'sbg:y': 0
alex's avatar
alex committed
  - id: h5parm_collector
    in:
      - id: h5parmFiles
        source:
alex's avatar
alex committed
          - calibrate_target/outh5parm
alex's avatar
alex committed
      - id: squeeze
        default: true
      - id: verbose
        default: true
      - id: clobber
        default: true
    out:
      - id: outh5parm
      - id: log
    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
    label: H5parm_collector
    'sbg:x': 1200
alex's avatar
alex committed
    'sbg:y': -300
alex's avatar
alex committed
  - id: plot_unflagged
    in:
      - id: msin
alex's avatar
alex committed
        source:
          - concat/msout
alex's avatar
alex committed
      - id: unflagged_fraction
alex's avatar
alex committed
        source:
          - check_unflagged_fraction/unflagged_fraction
alex's avatar
alex committed
    out:
      - id: output_imag
alex's avatar
alex committed
      - id: logfile
alex's avatar
alex committed
    run: ../../steps/plot_unflagged.cwl
    label: plot_unflagged
    'sbg:x': 1400
    'sbg:y': -400
alex's avatar
alex committed
  - id: losoto_plot_P
    in:
      - id: input_h5parm
        source: h5parm_collector/outh5parm
      - id: soltab
        default: sol000/phase000
      - id: axesInPlot
        default:
          - time
          - freq
      - id: axisInTable
        default: ant
      - id: minmax
        default:
          - -3.14
          - 3.14
      - id: plotFlag
        default: true
      - id: refAnt
        source: refant
      - id: prefix
        default: ph_
    out:
      - id: output_plots
      - id: logfile
alex's avatar
alex committed
      - id: parset
alex's avatar
alex committed
    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
    label: losoto_plot_P
    'sbg:x': 1400
alex's avatar
alex committed
    'sbg:y': 200
  - id: losoto_plot_P2
    in:
      - id: input_h5parm
        source: h5parm_collector/outh5parm
      - id: soltab
        default: sol000/phase000
      - id: axesInPlot
        default:
          - time
      - id: axisInTable
        default: ant
      - id: axisInCol
        default: pol
      - id: minmax
        default:
          - -3.14
          - 3.14
      - id: plotFlag
        default: true
      - id: refAnt
        source: refant
      - id: prefix
        default: ph_
    out:
      - id: output_plots
      - id: logfile
alex's avatar
alex committed
      - id: parset
alex's avatar
alex committed
    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
    label: losoto_plot_P2
    'sbg:x': 1400
alex's avatar
alex committed
    'sbg:y': 50
  - id: losoto_plot_Pd
    in:
      - id: input_h5parm
        source: h5parm_collector/outh5parm
      - id: soltab
        default: sol000/phase000
      - id: axesInPlot
        default:
          - time
          - freq
      - id: axisInTable
        default: ant
      - id: axisDiff
        default: pol
      - id: minmax
        default:
          - -3.14
          - 3.14
      - id: plotFlag
        default: true
      - id: refAnt
        source: refant
      - id: prefix
        default: ph_poldif_
    out:
      - id: output_plots
      - id: logfile
alex's avatar
alex committed
      - id: parset
alex's avatar
alex committed
    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
    label: losoto_plot_Pd
    'sbg:x': 1400
alex's avatar
alex committed
    'sbg:y': -100
  - id: losoto_plot_Pd2
    in:
      - id: input_h5parm
        source: h5parm_collector/outh5parm
      - id: soltab
        default: sol000/phase000
      - id: axesInPlot
        default:
          - time
      - id: axisInTable
        default: ant
      - id: axisDiff
        default: pol
      - id: minmax
        default:
          - -3.14
          - 3.14
      - id: plotFlag
        default: true
      - id: refAnt
        source: refant
      - id: prefix
        default: ph_poldif_
    out:
      - id: output_plots
      - id: logfile
alex's avatar
alex committed
      - id: parset
alex's avatar
alex committed
    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
    label: losoto_plot_Pd2
    'sbg:x': 1400
alex's avatar
alex committed
    'sbg:y': -250
alex's avatar
alex committed
requirements:
  - class: SubworkflowFeatureRequirement
  - class: ScatterFeatureRequirement
alex's avatar
alex committed
  - class: MultipleInputFeatureRequirement