-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddf-mosaic.yaml
295 lines (270 loc) · 9.29 KB
/
ddf-mosaic.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
_include:
- ddf-mosaic-lib.yaml
mosaic:
# note use of markdown for info strings (usefully rendered by "stimela help")
info: |
---
Example recipe implementing *uv*-plane mosaicing and DD-calibration using **DDFacet**/**killMS**.
This recipe is based on @cyriltasse's write-up here:
https://github.com/cyriltasse/DDFacet/wiki/Creating-a-MeerKAT-DD-corrected-intrinsic-flux-image-with-DDF-kMS
Note that there is a manual pre-clustering step needed where you pick your facet centers. These
steps are marked as skipped by default, since you only run them once by hand.
First run the recipe with ``-s image-pre`` to make an initial dirty image, then use DS9 or CARTA
to make a ds9 regions file with circular (or elliptic, or box) regions at desired tesselaltion
centres (tip, use bright sources for your initial centers), then run with ``-s clustercat:`` to
generate the clustering file and continue processing. Once the clustering file is ready, you can
re-run the recipe with it from any point.
---
inputs:
obs:
choices: [M1, M2]
info: "Selects observation set -- various settings will be auto-assigned based on this"
required: true
default: M2
suffix:
dtype: str
info: "Optional additional suffix for all output filenames, can be empty"
default: ''
dir_out:
dtype: str
required: true
info: "Output directory for all data products"
centre:
info: "Mosaic phase centre, specified as '[HH:MM:SS DD:MM:SS]'"
required: true
aliases: [(ddfacet).Image-PhaseCenterRADEC]
ncpu:
info: "Number of CPUs to use"
default: 64
# note use of aliases directive to push this value up to all "ddfacet" cabs, and all "ddcal*" steps
aliases: [(ddfacet).Parallel-NCPU, ddcal*.NCPU]
ms_list:
info: "List of MSs"
aliases: [(ddfacet).Data-MS, ddcal*.MSList, dical*.ms_list]
precluster:
info: "Preclustering regions file to be used for clustercat step"
aliases: [clustercat.precluster]
# default: ds9.reg
# automatically set some things up based on the value of the 'obs' input
assign_based_on:
run.node:
simon:
obs: M1
young:
obs: M2
obs:
M1:
ms_list:
- ../msdir/1563189318_sdp_l0-A3528N_corr.ms
- ../msdir/1563189318_sdp_l0-A3528S_corr.ms
- ../msdir/1563189318_sdp_l0-A3532_corr.ms
dir_out: mos1
pixel_scale: 1
image_size: 18000
image_nchan: 3
image_nchan_degrid: 10
centre: "[12:55:23.00, -29:41:40.00]"
precluster: m1-ds9.reg
ms_corrs: 2
M2:
ms_list:
- ../msdir/1562500862_sdp_l0-A3556_corr.ms
- ../msdir/1562500862_sdp_l0-A3562-corr.ms
dir_out: mos2
pixel_scale: 1
image_size: 18000
image_nchan: 3
image_nchan_degrid: 10
centre: "[13:29:18.00, -31:35:56.00]"
precluster: m2-ds9.reg
ms_corrs: 2
# standardized image filename prefix used by all imaging steps below: based on step suffix (aka info.suffix) and recipe suffix
# (available to substitute as {recipe.image-prefix})
assign:
image-prefix: '{recipe.dir_out}/im{info.suffix}/im{info.suffix}{recipe.suffix}'
clustercat: '{recipe.dir_out}/ClusterCat.npy'
log.dir: '{recipe.dir_out}/logs/log-{run.datetime}'
# and now the actual recipe steps
steps:
image-pre:
_use: lib.steps.ddfacet.base
info: makes a dirty image from which a ds9 pre-clustering file can be produced.
Run this once, then make a DS9 regions file with tesselation centers for DD solutions.
# skip if dirty exists
skip: "=EXISTS(current.dirty_mfs)"
params:
Output-Mode: Dirty
clustercat:
skip: "=EXISTS(recipe.clustercat)"
info: makes a node catalog file based on the image-pre outputs and a pre-clustering file.
Run this once, after you've made the DS9 regions file.
recipe:
aliases:
precluster: [make_model.ds9PreClusterFile]
clustercat: [copy_model.dest]
steps:
make_model:
cab: ddf_makemodel
params:
ds9PreClusterFile: '{recipe.precluster}'
BaseImageName: '{steps.image-pre.Output-Name}'
copy_model:
cab: cp
params:
src: '{steps.make_model.ClusterCat}'
params:
clustercat: '{recipe.clustercat}'
image-di2:
skip: "=EXISTS(current.app_restored_mfs)"
info: "initial SSD2 deconvolution step"
_use: lib.steps.ddfacet.base
params:
Output-Mode: Clean
Facets-CatNodes: '{recipe.clustercat}'
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 2
Mask-Auto: 1
mask-di2:
skip: "=EXISTS(current.mask)"
info: "generate a deep mask"
cab: breizorro
params:
restored_image: '{steps.image-di2.app_restored_mfs}'
threshold: 5
mask: '{recipe.image-prefix}-mask-{current.threshold}.fits'
image-di3:
skip: "=EXISTS(current.app_restored_mfs)"
info: "deeper SSD2 deconvolution step using the new mask"
_use: lib.steps.ddfacet.base
params:
Output-Mode: Clean
Facets-CatNodes: '{recipe.clustercat}'
Predict-InitDicoModel: '{steps.image-di2.skymodel}'
Cache-Reset: 0
Cache-Dirty: forceresidual
Cache-PSF: force
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 1
Mask-Auto: 0
Mask-External: '{steps.mask-di2.mask}'
predict-di3:
skip: true
_use: lib.steps.ddfacet.predict-previous
dical-3:
skip: true
recipe:
_use: lib.recipes.quartical-multi
params:
ms_corrs: =recipe.ms_corrs
output_dir: '{info.label}-gains.qc'
model: 'MODEL_DATA'
output_col: 'SELFCAL{info.suffix}_DATA'
image-di4:
skip: "=EXISTS(current.app_restored_mfs)"
info: "deep SSD2 deconvolution of selfcal data from above"
_use: lib.steps.ddfacet.base
params:
Data-ColName: =previous.output_col
Output-Mode: Clean
Facets-CatNodes: '{recipe.clustercat}'
Cache-Reset: true
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 3
Mask-Auto: 0
Mask-External: =steps.mask-di2.mask
predict-di4:
skip: true
_use: lib.steps.ddfacet.predict-previous
mask-di4:
skip: "=EXISTS(current.mask)"
info: "generate a deep mask"
cab: breizorro
params:
restored_image: =previous.app_restored_mfs
threshold: 5
mask: '{recipe.image-prefix}-mask-{current.threshold}.fits'
dical-4:
skip: true
recipe:
_use: lib.recipes.quartical-multi
params:
ms_corrs: =recipe.ms_corrs
output_dir: '{info.label}-gains.qc'
model: 'MODEL_DATA'
output_col: 'SELFCAL{info.suffix}_DATA'
image-di5:
skip: "=EXISTS(current.app_restored_mfs)"
info: "deep SSD2 deconvolution of selfcal data from above"
_use: lib.steps.ddfacet.base
params:
Data-ColName: =previous.output_col
Output-Mode: Clean
Facets-CatNodes: =recipe.clustercat
Cache-Reset: true
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 3
Mask-Auto: 0
Mask-External: =steps.mask-di4.mask
ddcal-1:
info: "DD-calibration using killMS, over multiple MSs"
recipe:
_use: lib.recipes.killms-multi
params:
InCol: =previous.Data-ColName
BaseImageName: =previous.Output-Name
OutSolsName: DD0
image-dd1:
info: "DD-imaging using solutions derived above"
_use: lib.steps.ddfacet.base
params:
Data-ColName: =previous.InCol
Output-Mode: Clean
DDESolutions-DDSols: =previous.OutSolsName
Predict-InitDicoModel: '{steps.image-di5.skymodel}'
Predict-ColName: MODEL_DATA
Cache-Reset: true
Cache-PSF: auto
Cache-Dirty: auto
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 1
Mask-External: '{steps.mask-di2.mask}'
Beam-Smooth: 1
Weight-ColName: '[WEIGHT_SPECTRUM,IMAGING_WEIGHT]'
ddcal-2:
skip: true
info: "DD-calibration using killMS, over multiple MSs"
recipe:
_use: lib.recipes.killms-multi
params:
InCol: =steps.ddcal-1.InCol
BaseImageName: =steps.image-di5.Output-Name
OutSolsName: DD1
dt: 2
NChanSols: 24
image-dd2:
skip: true
info: "DD-imaging using solutions derived above"
_use: lib.steps.ddfacet.base
params:
Data-ColName: =previous.InCol
Output-Mode: Clean
DDESolutions-DDSols: =previous.OutSolsName
Predict-InitDicoModel: '{steps.image-di5.skymodel}'
Predict-ColName: MODEL_DATA
Cache-Reset: true
Cache-PSF: auto
Cache-Dirty: auto
Deconv-Mode: SSD2
SSD2-PolyFreqOrder: 3
Deconv-MaxMajorIter: 1
Mask-External: '{steps.mask-di2.mask}'
Beam-Smooth: 1
Weight-ColName: '[WEIGHT_SPECTRUM,IMAGING_WEIGHT]'
predict-dd2:
skip: true
_use: lib.steps.ddfacet.predict-previous