Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies = [
"LINC @ git+https://git.astron.nl/RD/LINC",
"lofar_facet_selfcal @ git+https://github.com/rvweeren/lofar_facet_selfcal",
"lofar_helpers @ git+https://github.com/jurjen93/lofar_helpers",
"lofar-vlbi-plot",
"losoto",
"numpy",
"pandas",
Expand Down
3 changes: 0 additions & 3 deletions steps/delay_cal_model.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ inputs:
position: 2
prefix: --model-image
separate: true
valueFrom: $(self.basename)


- id: process_all
type: boolean?
default: false
Expand Down
5 changes: 5 additions & 0 deletions steps/lofar_vlbi_plot.cwl
Comment thread
lonbar marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ outputs:
doc: Delay Calibrator CSV
outputBinding:
glob: delay_calibrators.csv
- id: image_catalogue_pf
type: File
doc: Image catalogue CSV
outputBinding:
glob: image_catalogue.csv

arguments:
- --continue_no_lotss
Expand Down
23 changes: 12 additions & 11 deletions workflows/delay-calibration.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ inputs:
If not provided, lofar-vlbi-plot will be run to generate the CSV (requires internet access).

- id: image_catalogue
type: File
type: File?
doc: An image catalogue file in CSV format.

- id: Ateam_skymodel
Expand Down Expand Up @@ -71,10 +71,6 @@ inputs:
default: TGSSphase
doc: The name of the target solution table to use from the solset input.

- id: configfile
type: File
doc: Settings for the delay calibration in delay_solve.

- id: reference_stationSB
type: int?
default: 104
Expand Down Expand Up @@ -158,10 +154,11 @@ inputs:

- id: starting_skymodel
type:
- File?
- File[]?
doc: |
Optional starting model(s) in BBS-compatible text format used to kickstart the delay calibration. If given and `do_auto_delay_selection` is enabled, the number of skymodels must be equal to `select_best_n_delay_calibrators`. Additionally, they should be named in such a way that when sorted by name, the delay calibrator MSes and skymodels end up in the same order.
Optional starting model(s) in FITS format used to kickstart the delay calibration when automatic selection from multiple delay candidates is used.
If given and `do_auto_delay_selection` is enabled, the number of skymodels must be equal to `select_best_n_delay_calibrators`.
Additionally, they should be named in such a way that when sorted by name, the delay calibrator MSes and skymodels end up in the same order.

- id: do_auto_delay_selection
type: boolean?
Expand Down Expand Up @@ -206,6 +203,7 @@ steps:
source: delay_calibrator
out:
- id: delay_calibrator_pf
- id: image_catalogue_pf
run: ../steps/lofar_vlbi_plot.cwl
when: $(inputs.delay_calibrator == null)

Expand Down Expand Up @@ -320,14 +318,18 @@ steps:
linkMerge: merge_nested
pickValue: first_non_null
valueFrom: $(self)
- id: configfile
source: configfile
- id: delay_calibrator
source:
- delay_calibrator
- lofar_vlbi_plot/delay_calibrator_pf
pickValue: first_non_null
valueFrom: $(self)
- id: image_catalogue
source:
- image_catalogue
- lofar_vlbi_plot/image_catalogue_pf
pickValue: first_non_null
Comment thread
tikk3r marked this conversation as resolved.
valueFrom: $(self)
- id: select_best_n_delay_calibrators
source: select_best_n_delay_calibrators
- id: do_auto_delay_selection
Expand Down Expand Up @@ -461,8 +463,7 @@ outputs:
- phaseup/starting_skymodel
- select_best_delay_cal/starting_skymodels
type: File[]
pickValue: all_non_null
linkMerge: merge_flattened
pickValue: first_non_null
doc: |
The starting model(s) that were used to kick start the delay calibration.

Expand Down
73 changes: 40 additions & 33 deletions workflows/subworkflows/find-best-delay-calibrator.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ inputs:
- id: delay_calibrator
type: File
doc: A delay calibrator catalogue in CSV format.
- id: configfile
- id: image_catalogue
type: File
doc: Settings for the delay calibration in delay_solve.
doc: A catalogue with other sources in the field (e.g. a LoTSS catalogue).
- id: starting_skymodel
type:
- File[]?
doc: |
Optional starting models in BBS-compatible text format used to kickstart the delay calibration. If given, the number of skymodels must be equal to `select_best_n_delay_calibrators`. Additionally, they should be named in such a way that when sorted by name, the delay calibrator MSes and skymodels end up in the same order.
Optional starting models in FITS format used to kickstart the delay calibration. If given, the number of skymodels must be equal to `select_best_n_delay_calibrators`. Additionally, they should be named in such a way that when sorted by name, the delay calibrator MSes and skymodels end up in the same order.
- id: select_best_n_delay_calibrators
type: int?
default: 1
Expand All @@ -43,34 +43,18 @@ inputs:
Time resolution to average the split off delay calibrators to.

steps:
- id: generate_skymodels
in:
- id: msin
source: msin
valueFrom: $(self[0])
- id: delay_calibrator
source: delay_calibrator
- id: process_all
default: true
out:
- id: skymodel
- id: logfile
run: ../../steps/delay_cal_model.cwl

- id: select_best_delay_cal
in:
- id: msin
source: msin
- id: dd_selection
default: true
- id: do_selfcal
default: true
default: false
- id: image_cat
source: delay_calibrator
- id: select_best_n
source: select_best_n_delay_calibrators
- id: configfile
source: configfile
Comment thread
tikk3r marked this conversation as resolved.
- id: frequency_resolution
source: frequency_resolution
- id: time_resolution
Expand All @@ -86,9 +70,8 @@ steps:
- id: sort_skymodels
in:
- id: input_entry
source:
source:
- starting_skymodel
- generate_skymodels/skymodel
pickValue: all_non_null
linkMerge: merge_flattened
out:
Expand All @@ -108,26 +91,40 @@ steps:
in:
- id: msin
source: sort_ms/sorted_entries
- id: configfile
source: configfile
- id: skymodel
- id: delay_calibrator
source: delay_calibrator
- id: image_catalogue
source: image_catalogue
- id: model_image
source: sort_skymodels/sorted_entries
out:
- id: images
- id: h5parm
run: ../../steps/facet_selfcal.cwl
scatter: [msin, skymodel]
- id: solutions
- id: starting_skymodel
- id: config
- id: pictures
- id: logfile
run: ./delay_cal_run.cwl
scatter: [msin, model_image]
scatterMethod: dotproduct

- id: flatten_delay_images
in:
- id: nestedarray
source: delay_selfcal/images
source: delay_selfcal/pictures
out:
- id: flattenedarray
run: ../../steps/flatten.cwl
label: flatten_delay_images

- id: flatten_delay_models
in:
- id: nestedarray
source: delay_selfcal/starting_skymodel
out:
- id: flattenedarray
run: ../../steps/flatten.cwl
label: flatten_delay_models

outputs:
- id: msout
outputSource:
Expand All @@ -139,9 +136,11 @@ outputs:
format, phase-shifted to the delay calibrator.

- id: starting_skymodels
outputSource: generate_skymodels/skymodel
outputSource:
- flatten_delay_models/flattenedarray
pickValue: first_non_null
type: File[]
doc: Starting models that were used to kickstart the delay calibration.
doc: Starting skymodels that were used to kickstart the delay calibration.

- id: pictures
outputSource:
Expand All @@ -151,6 +150,14 @@ outputs:
linkMerge: merge_flattened
doc: Inspection plots generated by lofar_facet_selfcal.

- id: configs
outputSource:
- delay_selfcal/config
type: File[]
pickValue: all_non_null
linkMerge: merge_flattened
doc: Facetselfcal config files used for the calibration.

- id: phasediff_score_csv
outputSource: select_best_delay_cal/phasediff_score_csv
type:
Expand All @@ -159,7 +166,7 @@ outputs:
A CSV file containing the phasediff scores for each of the calibrators that were split out.

- id: solutions
outputSource: delay_selfcal/h5parm
outputSource: delay_selfcal/solutions
type:
- File
- File[]
Expand Down
Loading