Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/tclean.py: 56%

27 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 17:39 +0000

1##################### generated by xml-casa (v2) from tclean.xml #################### 

2##################### e4216b74f32e985c533b81c5ecdbefef ############################## 

3from __future__ import absolute_import 

4import numpy 

5from casatools.typecheck import CasaValidator as _val_ctor 

6_pc = _val_ctor( ) 

7from casatools.coercetype import coerce as _coerce 

8from casatools.errors import create_error_string 

9from .private.task_tclean import tclean as _tclean_t 

10from casatasks.private.task_logging import start_log as _start_log 

11from casatasks.private.task_logging import end_log as _end_log 

12from casatasks.private.task_logging import except_log as _except_log 

13 

14class _tclean: 

15 """ 

16 tclean ---- Radio Interferometric Image Reconstruction 

17 

18 Form images from visibilities and reconstruct a sky model. 

19 This task handles continuum images and spectral line cubes, 

20 supports outlier fields, contains standard clean based algorithms 

21 along with algorithms for multi-scale and wideband image 

22 reconstruction, widefield imaging correcting for the w-term, 

23 full primary-beam imaging and joint mosaic imaging (with 

24 heterogeneous array support for ALMA). 

25 

26 --------- parameter descriptions --------------------------------------------- 

27 

28 vis Name(s) of input visibility file(s) 

29 default: none; 

30 example: vis='ngc5921.ms' 

31 vis=['ngc5921a.ms','ngc5921b.ms']; multiple MSes 

32 selectdata Enable data selection parameters. 

33 field to image or mosaic. Use field id(s) or name(s). 

34 ['go listobs' to obtain the list id's or names] 

35 default: ''= all fields 

36 If field string is a non-negative integer, it is assumed to 

37 be a field index otherwise, it is assumed to be a 

38 field name 

39 field='0~2'; field ids 0,1,2 

40 field='0,4,5~7'; field ids 0,4,5,6,7 

41 field='3C286,3C295'; field named 3C286 and 3C295 

42 field = '3,4C\*'; field id 3, all names starting with 4C 

43 For multiple MS input, a list of field strings can be used: 

44 field = ['0~2','0~4']; field ids 0-2 for the first MS and 0-4 

45 for the second 

46 field = '0~2'; field ids 0-2 for all input MSes 

47 spw l window/channels 

48 NOTE: channels de-selected here will contain all zeros if 

49 selected by the parameter mode subparameters. 

50 default: ''=all spectral windows and channels 

51 spw='0~2,4'; spectral windows 0,1,2,4 (all channels) 

52 spw='0:5~61'; spw 0, channels 5 to 61 

53 spw='<2'; spectral windows less than 2 (i.e. 0,1) 

54 spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, 

55 channels 3 to 45. 

56 spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each. 

57 For multiple MS input, a list of spw strings can be used: 

58 spw=['0','0~3']; spw ids 0 for the first MS and 0-3 for the second 

59 spw='0~3' spw ids 0-3 for all input MS 

60 spw='3:10~20;50~60' for multiple channel ranges within spw id 3 

61 spw='3:10~20;50~60,4:0~30' for different channel ranges for spw ids 3 and 4 

62 spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10, 

63 spw 1, channels 20-30, and spw 2, channels, 1,2 and 3 

64 spw='1~4;6:15~48' for channels 15 through 48 for spw ids 1,2,3,4 and 6 

65 timerange Range of time to select from data 

66  

67 default: '' (all); examples, 

68 timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss' 

69 Note: if YYYY/MM/DD is missing date defaults to first 

70 day in data set 

71 timerange='09:14:0~09:54:0' picks 40 min on first day 

72 timerange='25:00:00~27:30:00' picks 1 hr to 3 hr 

73 30min on NEXT day 

74 timerange='09:44:00' pick data within one integration 

75 of time 

76 timerange='> 10:24:00' data after this time 

77 For multiple MS input, a list of timerange strings can be 

78 used: 

79 timerange=['09:14:0~09:54:0','> 10:24:00'] 

80 timerange='09:14:0~09:54:0''; apply the same timerange for 

81 all input MSes 

82 uvrange Select data within uvrange (default unit is meters) 

83 default: '' (all); example: 

84 uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda 

85 uvrange='> 4klambda';uvranges greater than 4 kilo lambda 

86 For multiple MS input, a list of uvrange strings can be 

87 used: 

88 uvrange=['0~1000klambda','100~1000klamda'] 

89 uvrange='0~1000klambda'; apply 0-1000 kilo-lambda for all 

90 input MSes 

91 antenna Select data based on antenna/baseline 

92  

93 default: '' (all) 

94 If antenna string is a non-negative integer, it is 

95 assumed to be an antenna index, otherwise, it is 

96 considered an antenna name. 

97 antenna='5\&6'; baseline between antenna index 5 and 

98 index 6. 

99 antenna='VA05\&VA06'; baseline between VLA antenna 5 

100 and 6. 

101 antenna='5\&6;7\&8'; baselines 5-6 and 7-8 

102 antenna='5'; all baselines with antenna index 5 

103 antenna='05'; all baselines with antenna number 05 

104 (VLA old name) 

105 antenna='5,6,9'; all baselines with antennas 5,6,9 

106 index number 

107 For multiple MS input, a list of antenna strings can be 

108 used: 

109 antenna=['5','5\&6']; 

110 antenna='5'; antenna index 5 for all input MSes 

111 antenna='!DV14'; use all antennas except DV14 

112 scan Scan number range 

113  

114 default: '' (all) 

115 example: scan='1~5' 

116 For multiple MS input, a list of scan strings can be used: 

117 scan=['0~100','10~200'] 

118 scan='0~100; scan ids 0-100 for all input MSes 

119 observation Observation ID range 

120 default: '' (all) 

121 example: observation='1~5' 

122 intent Scan Intent(s) 

123  

124 default: '' (all) 

125 example: intent='TARGET_SOURCE' 

126 example: intent='TARGET_SOURCE1,TARGET_SOURCE2' 

127 example: intent='TARGET_POINTING\*' 

128 datacolumn Data column to image (data or observed, corrected) 

129 default:'corrected' 

130 ( If 'corrected' does not exist, it will use 'data' instead ) 

131 imagename Pre-name of output images 

132  

133 example : imagename='try' 

134  

135 Output images will be (a subset of) : 

136  

137 try.psf - Point spread function 

138 try.residual - Residual image 

139 try.image - Restored image 

140 try.model - Model image (contains only flux components) 

141 try.sumwt - Single pixel image containing sum-of-weights. 

142 (for natural weighting, sensitivity=1/sqrt(sumwt)) 

143 try.pb - Primary beam model (values depend on the gridder used) 

144  

145 Widefield projection algorithms (gridder=mosaic,awproject) will 

146 compute the following images too. 

147 try.weight - FT of gridded weights or the 

148 un-normalized sum of PB-square (for all pointings) 

149 Here, PB = sqrt(weight) normalized to a maximum of 1.0 

150  

151 For multi-term wideband imaging, all relevant images above will 

152 have additional .tt0,.tt1, etc suffixes to indicate Taylor terms, 

153 plus the following extra output images. 

154 try.alpha - spectral index 

155 try.alpha.error - estimate of error on spectral index 

156 try.beta - spectral curvature (if nterms \> 2) 

157  

158 Tip : Include a directory name in 'imagename' for all 

159 output images to be sent there instead of the 

160 current working directory : imagename='mydir/try' 

161  

162 Tip : Restarting an imaging run without changing 'imagename' 

163 implies continuation from the existing model image on disk. 

164 - If 'startmodel' was initially specified it needs to be set to "" 

165 for the restart run (or tclean will exit with an error message). 

166 - By default, the residual image and psf will be recomputed 

167 but if no changes were made to relevant parameters between 

168 the runs, set calcres=False, calcpsf=False to resume directly from 

169 the minor cycle without the (unnecessary) first major cycle. 

170 To automatically change 'imagename' with a numerical 

171 increment, set restart=False (see tclean docs for 'restart'). 

172  

173 Note : All imaging runs will by default produce restored images. 

174 For a niter=0 run, this will be redundant and can optionally 

175 be turned off via the 'restoration=T/F' parameter. 

176 imsize Number of pixels 

177 example: 

178  

179 imsize = [350,250] 

180 imsize = 500 is equivalent to [500,500] 

181  

182 To take proper advantage of internal optimized FFT routines, the 

183 number of pixels must be even and factorizable by 2,3,5 only. 

184 To find the nearest optimal imsize to that desired by the user, please use the following tool method: 

185  

186 from casatools import synthesisutils 

187 su = synthesisutils() 

188 su.getOptimumSize(345)  

189 Output : 360 

190 cell Cell size 

191 example: cell=['0.5arcsec,'0.5arcsec'] or 

192 cell=['1arcmin', '1arcmin'] 

193 cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'] 

194 phasecenter Phase center of the image (string or field id); if the phasecenter is the name known major solar system object ('MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', 'URANUS', 'NEPTUNE', 'PLUTO', 'SUN', 'MOON') or is an ephemerides table then that source is tracked and the background sources get smeared. There is a special case, when phasecenter='TRACKFIELD', which will use the ephemerides or polynomial phasecenter in the FIELD table of the MS's as the source center to track. 

195  

196 Note : If unspecified, tclean will use the phase-center from the first data field of the MS (or list of MSs) selected for imaging.  

197  

198 example: phasecenter=6 

199 phasecenter='J2000 19h30m00 -40d00m00' 

200 phasecenter='J2000 292.5deg -40.0deg' 

201 phasecenter='J2000 5.105rad -0.698rad' 

202 phasecenter='ICRS 13:05:27.2780 -049.28.04.458' 

203 phasecenter='myComet_ephem.tab' 

204 phasecenter='MOON' 

205 phasecenter='TRACKFIELD' 

206 stokes Stokes Planes to make 

207 default='I'; example: stokes='IQUV'; 

208 Options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY','pseudoI' 

209  

210 Note : Due to current internal code constraints, if any correlation pair 

211 is flagged, by default, no data for that row in the MS will be used. 

212 So, in an MS with XX,YY, if only YY is flagged, neither a 

213 Stokes I image nor an XX image can be made from those data points. 

214 In such a situation, please split out only the unflagged correlation into 

215 a separate MS. 

216  

217 Note : The 'pseudoI' option is a partial solution, allowing Stokes I imaging 

218 when either of the parallel-hand correlations are unflagged. 

219  

220 The remaining constraints shall be removed (where logical) in a future release. 

221 projection Coordinate projection 

222 Examples : SIN, NCP 

223 A list of supported (but untested) projections can be found here : 

224 http://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1Projection.html#a3d5f9ec787e4eabdce57ab5edaf7c0cd 

225 startmodel Name of starting model image 

226  

227 The contents of the supplied starting model image will be 

228 copied to the imagename.model before the run begins. 

229  

230 example : startmodel = 'singledish.im' 

231  

232 For deconvolver='mtmfs', one image per Taylor term must be provided. 

233 example : startmodel = ['try.model.tt0', 'try.model.tt1'] 

234 startmodel = ['try.model.tt0'] will use a starting model only 

235 for the zeroth order term. 

236 startmodel = ['','try.model.tt1'] will use a starting model only 

237 for the first order term. 

238  

239 This starting model can be of a different image shape and size from 

240 what is currently being imaged. If so, an image regrid is first triggered 

241 to resample the input image onto the target coordinate system. 

242  

243 A common usage is to set this parameter equal to a single dish image 

244  

245 Negative components in the model image will be included as is. 

246  

247 [ Note : If an error occurs during image resampling/regridding, 

248 please try using task imregrid to resample the starting model 

249 image onto a CASA image with the target shape and 

250 coordinate system before supplying it via startmodel ] 

251 specmode Spectral definition mode (mfs,cube,cubedata, cubesource, mvc) 

252  

253 specmode='mfs' : Continuum imaging with only one output image channel. 

254 (mode='cont' can also be used here) 

255  

256 specmode='cube' : Spectral line imaging with one or more channels 

257 Parameters start, width,and nchan define the spectral 

258 coordinate system and can be specified either in terms 

259 of channel numbers, frequency or velocity in whatever 

260 spectral frame is specified in 'outframe'. 

261 All internal and output images are made with outframe as the 

262 base spectral frame. However imaging code internally uses the fixed 

263 spectral frame, LSRK for automatic internal software 

264 Doppler tracking so that a spectral line observed over an 

265 extended time range will line up appropriately. 

266 Therefore the output images have additional spectral frame conversion 

267 layer in LSRK on the top the base frame. 

268  

269  

270 (Note : Even if the input parameters are specified in a frame 

271 other than LSRK, the viewer still displays spectral 

272 axis in LSRK by default because of the conversion frame 

273 layer mentioned above. The viewer can be used to relabel 

274 the spectral axis in any desired frame - via the spectral 

275 reference option under axis label properties in the 

276 data display options window.) 

277  

278  

279  

280  

281  

282 specmode='cubedata' : Spectral line imaging with one or more channels 

283 There is no internal software Doppler tracking so 

284 a spectral line observed over an extended time range 

285 may be smeared out in frequency. There is strictly 

286 no valid spectral frame with which to associate with the 

287 output images, thus the image spectral frame will 

288 be labelled "Undefined". 

289  

290  

291 specmode='cubesource': Spectral line imaging while 

292 tracking moving source (near field or solar system 

293 objects). The velocity of the source is accounted 

294 and the frequency reported is in the source frame. 

295 As there is no "SOURCE" frame defined in CASA, 

296 the frame in the image will be labelled "REST" (but do note the 

297 velocity of a given line reported may be different from the rest frame 

298 velocity if the emission region is moving w.r.t the systemic 

299 velocity frame of the source) 

300  

301 specmode='mvc' : Multiterm continuum imaging with cube major cycles.  

302 This mode requires deconvolver='mtmfs' with nterms>1  

303 and user-set choices of 'reffreq' and 'nchan'.  

304  

305 The output images and minor cycle are similar to specmode='mfs'  

306 with deconvolver='mtmfs', but the major cycles are done in  

307 cube mode (and require a setting of 'reffreq' and 'nchan').  

308 By default, frequency-dependent primary beam correction is  

309 applied to each channel, before being combined across frequency 

310 to make the inputs to the 'mtmfs' deconvolver. This results in  

311 implicit wideband pb-correction, with the deconvolver seeing only 

312 the sky spectral structure. 

313  

314 Note : There is currently no option to turn off wideband pb correction 

315 as part of the flat-sky normalization between the major and minor cycles. 

316 Therefore, 'mvc' with the 'standard' and 'wproject' gridders will also apply 

317 pblimits per channel, masking all regions outside of pblimit.  

318 An option to retain sources outside the pblimit will be added in a future release.  

319  

320 Note : Below is some guidance for choosing 'nchan' and 'reffreq' : 

321  

322 The cube produced by the major cycle is used in a linear least square fits for Taylor 

323 polynomials per pixel. Therefore, one only needs as many channels in the cube, as 

324 required for an accurate polynomial fit for sources that have the strongest 

325 spectral structure. 

326  

327 In general, 'nchan' needs to be greater than or equal to 'nterms', and the 

328 frequency range selected by the data will be evenly split into nchan channels. 

329 For a low-order polynomial fit, only a small number (around 10) 

330 channels are typically needed (for VLA/ALMA bandwidth ratios). 

331 'nchan=-1' applies a heuristic that results in a default of 10 cube channels 

332 for a 2:1 bandwidth ratio. 

333  

334 nchan = MAX( bandwidth/(0.1*startfreq) , nterms+1 ) 

335  

336 Note: When running in parallel, the nchan selected may limit the speedup if it 

337 is smaller than the number of processes used. 

338  

339 The 'reffreq' is the reference frequency used for the Taylor polynomial expansion. 

340 By default, in specmode='mvc', reffreq is set to the middle of the selected 

341 frequency range. 

342 reffreq Reference frequency of the output image coordinate system 

343  

344 Example : reffreq='1.5GHz' as a string with units. 

345  

346 By default, it is calculated as the middle of the selected frequency range. 

347  

348 For deconvolver='mtmfs' the Taylor expansion is also done about 

349 this specified reference frequency. 

350 nchan Number of channels in the output image 

351 For default (=-1), the number of channels will be automatically determined 

352 based on data selected by 'spw' with 'start' and 'width'. 

353 It is often easiest to leave nchan at the default value. 

354 example: nchan=100 

355 start First channel (e.g. start=3,start=\'1.1GHz\',start=\'15343km/s\') 

356 of output cube images specified by data channel number (integer), 

357 velocity (string with a unit), or frequency (string with a unit). 

358 Default:''; The first channel is automatically determined based on 

359 the 'spw' channel selection and 'width'. 

360 channels in 'spw'.  

361 Since the integer number in 'start' represents the data channel number, 

362 when the channel number is used along with the spectral window id selection 

363 in 'spw', 'start' specified as an integer should be carefully set otherwise 

364 it may result in the blank image channels if the 'start' channel (i.e. absolute  

365 channel number) is outside of the channel range specified in 'spw'. 

366 In such a case, 'start' can be left as a default (='') to ensure 

367 matching with the data spectral channel selection. 

368 For specmode='cube', when velocity or frequency is used it is 

369 interpreted with the frame defined in outframe. [The parameters of 

370 the desired output cube can be estimated by using the 'transform' 

371 functionality of 'plotms'] 

372 examples: start='5.0km/s'; 1st channel, 5.0km/s in outframe 

373 start='22.3GHz'; 1st channel, 22.3GHz in outframe 

374 width Channel width (e.g. width=2,width=\'0.1MHz\',width=\'10km/s\') of output cube images 

375 specified by data channel number (integer), velocity (string with a unit), or 

376 or frequency (string with a unit). 

377 Default:''; data channel width 

378 The sign of width defines the direction of the channels to be incremented. 

379 For width specified in velocity or frequency with '-' in front gives image channels in 

380 decreasing velocity or frequency, respectively. 

381 For specmode='cube', when velocity or frequency is used it is interpreted with 

382 the reference frame defined in outframe. 

383 examples: width='2.0km/s'; results in channels with increasing velocity 

384 width='-2.0km/s'; results in channels with decreasing velocity 

385 width='40kHz'; results in channels with increasing frequency 

386 width=-2; results in channels averaged of 2 data channels incremented from 

387 high to low channel numbers 

388 outframe Spectral reference frame in which to interpret \'start\' and \'width\' 

389 Options: '','LSRK','LSRD','BARY','GEO','TOPO','GALACTO','LGROUP','CMB' 

390 example: outframe='bary' for Barycentric frame 

391  

392 REST -- Rest frequency 

393 LSRD -- Local Standard of Rest (J2000) 

394 -- as the dynamical definition (IAU, [9,12,7] km/s in galactic coordinates) 

395 LSRK -- LSR as a kinematical (radio) definition 

396 -- 20.0 km/s in direction ra,dec = [270,+30] deg (B1900.0) 

397 BARY -- Barycentric (J2000) 

398 GEO --- Geocentric 

399 TOPO -- Topocentric 

400 GALACTO -- Galacto centric (with rotation of 220 km/s in direction l,b = [90,0] deg. 

401 LGROUP -- Local group velocity -- 308km/s towards l,b = [105,-7] deg (F. Ghigo) 

402 CMB -- CMB velocity -- 369.5km/s towards l,b = [264.4, 48.4] deg (F. Ghigo) 

403 DEFAULT = LSRK 

404 veltype Velocity type (radio, z, ratio, beta, gamma, optical) 

405 For start and/or width specified in velocity, specifies the velocity definition 

406 Options: 'radio','optical','z','beta','gamma','optical' 

407 NOTE: the viewer always defaults to displaying the 'radio' frame, 

408 but that can be changed in the position tracking pull down. 

409  

410 The different types (with F = f/f0, the frequency ratio), are: 

411  

412 Z = (-1 + 1/F) 

413 RATIO = (F) \* 

414 RADIO = (1 - F) 

415 OPTICAL == Z 

416 BETA = ((1 - F2)/(1 + F2)) 

417 GAMMA = ((1 + F2)/2F) \* 

418 RELATIVISTIC == BETA (== v/c) 

419 DEFAULT == RADIO 

420 Note that the ones with an '\*' have no real interpretation 

421 (although the calculation will proceed) if given as a velocity. 

422 restfreq List of rest frequencies or a rest frequency in a string. 

423 Specify rest frequency to use for output image. 

424 \*Currently it uses the first rest frequency in the list for translation of 

425 velocities. The list will be stored in the output images. 

426 Default: []; look for the rest frequency stored in the MS, if not available, 

427 use center frequency of the selected channels 

428 examples: restfreq=['1.42GHz'] 

429 restfreq='1.42GHz' 

430 interpolation Spectral interpolation (nearest,linear,cubic) 

431  

432 Interpolation rules to use when binning data channels onto image channels 

433 and evaluating visibility values at the centers of image channels. 

434  

435 Note : 'linear' and 'cubic' interpolation requires data points on both sides of 

436 each image frequency. Errors are therefore possible at edge channels, or near 

437 flagged data channels. When image channel width is much larger than the data 

438 channel width there is nothing much to be gained using linear or cubic thus 

439 not worth the extra computation involved. 

440 perchanweightdensity When calculating weight density for Briggs 

441 style weighting in a cube, this parameter 

442 determines whether to calculate the weight 

443 density for each channel independently  

444 (the default, True) 

445 or a common weight density for all of the selected 

446 data. This parameter has no 

447 meaning for continuum (specmode='mfs') imaging 

448 or for natural and radial weighting schemes. 

449 For cube imaging 

450 perchanweightdensity=True is a recommended 

451 option that provides more uniform 

452 sensitivity per channel for cubes, but with 

453 generally larger psfs than the 

454 perchanweightdensity=False (prior behavior) 

455 option. When using Briggs style weight with 

456 perchanweightdensity=True, the imaging weight 

457 density calculations use only the weights of 

458 data that contribute specifically to that 

459 channel. On the other hand, when 

460 perchanweightdensity=False, the imaging 

461 weight density calculations sum all of the 

462 weights from all of the data channels 

463 selected whose (u,v) falls in a given uv cell 

464 on the weight density grid. Since the 

465 aggregated weights, in any given uv cell, 

466 will change depending on the number of 

467 channels included when imaging, the psf 

468 calculated for a given frequency channel will 

469 also necessarily change, resulting in 

470 variability in the psf for a given frequency 

471 channel when perchanweightdensity=False. In 

472 general, perchanweightdensity=False results 

473 in smaller psfs for the same value of 

474 robustness compared to 

475 perchanweightdensity=True, but the rms noise 

476 as a function of channel varies and increases 

477 toward the edge channels; 

478 perchanweightdensity=True provides more 

479 uniform sensitivity per channel for 

480 cubes. This may make it harder to find 

481 estimates of continuum when 

482 perchanweightdensity=False. If you intend to 

483 image a large cube in many smaller subcubes 

484 and subsequently concatenate, it is advisable 

485 to use perchanweightdensity=True to avoid 

486 surprisingly varying sensitivity and psfs 

487 across the concatenated cube. 

488 gridder Gridding options (standard, wproject, widefield, mosaic, awproject) 

489  

490 The following options choose different gridding convolution 

491 functions for the process of convolutional resampling of the measured 

492 visibilities onto a regular uv-grid prior to an inverse FFT. 

493 Model prediction (degridding) also uses these same functions. 

494 Several wide-field effects can be accounted for via careful choices of 

495 convolution functions. Gridding (degridding) runtime will rise in 

496 proportion to the support size of these convolution functions (in uv-pixels). 

497  

498 standard : Prolate Spheroid with 7x7 uv pixel support size 

499  

500 [ This mode can also be invoked using 'ft' or 'gridft' ] 

501  

502 wproject : W-Projection algorithm to correct for the widefield 

503 non-coplanar baseline effect. [Cornwell et.al 2008] 

504  

505 wprojplanes is the number of distinct w-values at 

506 which to compute and use different gridding convolution 

507 functions (see help for wprojplanes). 

508 Convolution function support size can range 

509 from 5x5 to few 100 x few 100. 

510  

511 [ This mode can also be invoked using 'wprojectft' ] 

512  

513 widefield : Facetted imaging with or without W-Projection per facet. 

514  

515 A set of facets x facets subregions of the specified image 

516 are gridded separately using their respective phase centers 

517 (to minimize max W). Deconvolution is done on the joint 

518 full size image, using a PSF from the first subregion. 

519  

520 wprojplanes=1 : standard prolate spheroid gridder per facet. 

521 wprojplanes > 1 : W-Projection gridder per facet. 

522 nfacets=1, wprojplanes > 1 : Pure W-Projection and no facetting 

523 nfacets=1, wprojplanes=1 : Same as standard,ft,gridft 

524  

525 A combination of facetting and W-Projection is relevant only for 

526 very large fields of view. (In our current version of tclean, this  

527 combination runs only with parallel=False.  

528  

529 mosaic : A-Projection with azimuthally symmetric beams without 

530 sidelobes, beam rotation or squint correction. 

531 Gridding convolution functions per visibility are computed 

532 from FTs of PB models per antenna. 

533 This gridder can be run on single fields as well as mosaics. 

534  

535 VLA : PB polynomial fit model (Napier and Rots, 1982) 

536 EVLA : PB polynomial fit model (Perley, 2015) 

537 ALMA : Airy disks for a 10.7m dish (for 12m dishes) and 

538 6.25m dish (for 7m dishes) each with 0.75m 

539 blockages (Hunter/Brogan 2011). Joint mosaic 

540 imaging supports heterogeneous arrays for ALMA. 

541  

542 Typical gridding convolution function support sizes are 

543 between 7 and 50 depending on the desired 

544 accuracy (given by the uv cell size or image field of view). 

545  

546 [ This mode can also be invoked using 'mosaicft' or 'ftmosaic' ] 

547  

548 awproject : A-Projection with azimuthally asymmetric beams and 

549 including beam rotation, squint correction, 

550 conjugate frequency beams and W-projection. 

551 [Bhatnagar et.al, 2008] 

552  

553 Gridding convolution functions are computed from 

554 aperture illumination models per antenna and optionally 

555 combined with W-Projection kernels and a prolate spheroid. 

556 This gridder can be run on single fields as well as mosaics. 

557  

558 VLA : Uses ray traced model (VLA and EVLA) including feed 

559 leg and subreflector shadows, off-axis feed location 

560 (for beam squint and other polarization effects), and 

561 a Gaussian fit for the feed beams (Ref: Brisken 2009) 

562 ALMA : Similar ray-traced model as above (but the correctness 

563 of its polarization properties remains un-verified). 

564  

565 Typical gridding convolution function support sizes are 

566 between 7 and 50 depending on the desired 

567 accuracy (given by the uv cell size or image field of view). 

568 When combined with W-Projection they can be significantly larger. 

569  

570 [ This mode can also be invoked using 'awprojectft' ] 

571  

572 imagemosaic : (untested implementation) 

573 Grid and iFT each pointing separately and combine the 

574 images as a linear mosaic (weighted by a PB model) in 

575 the image domain before a joint minor cycle. 

576  

577 VLA/ALMA PB models are same as for gridder='mosaicft' 

578  

579 ------ Notes on PB models : 

580  

581 (1) Several different sources of PB models are used in the modes 

582 listed above. This is partly for reasons of algorithmic flexibility 

583 and partly due to the current lack of a common beam model 

584 repository or consensus on what beam models are most appropriate. 

585  

586 (2) For ALMA and gridder='mosaic', ray-traced (TICRA) beams 

587 are also available via the vpmanager tool. 

588 For example, call the following before the tclean run. 

589 vp.setpbimage(telescope="ALMA", 

590 compleximage='/home/casa/data/trunk/alma/responses/ALMA_0_DV__0_0_360_0_45_90_348.5_373_373_GHz_ticra2007_VP.im', 

591 antnames=['DV'+'%02d'%k for k in range(25)]) 

592 vp.saveastable('mypb.tab') 

593 Then, supply vptable='mypb.tab' to tclean. 

594 ( Currently this will work only for non-parallel runs ) 

595  

596  

597 ------ Note on PB masks : 

598  

599 In tclean, A-Projection gridders (mosaic and awproject) produce a 

600 .pb image and use the 'pblimit' subparameter to decide normalization 

601 cutoffs and construct an internal T/F mask in the .pb and .image images. 

602 However, this T/F mask cannot directly be used during deconvolution 

603 (which needs a 1/0 mask). There are two options for making a pb based 

604 deconvolution mask. 

605 -- Run tclean with niter=0 to produce the .pb, construct a 1/0 image 

606 with the desired threshold (using ia.open('newmask.im'); 

607 ia.calc('iif("xxx.pb">0.3,1.0,0.0)');ia.close() for example), 

608 and supply it via the 'mask' parameter in a subsequent run 

609 (with calcres=F and calcpsf=F to restart directly from the minor cycle). 

610 -- Run tclean with usemask='pb' for it to automatically construct 

611 a 1/0 mask from the internal T/F mask from .pb at a fixed 0.2 threshold. 

612  

613 ----- Making PBs for gridders other than mosaic,awproject 

614  

615 After the PSF generation, a PB is constructed using the same 

616 models used in gridder='mosaic' but just evaluated in the image 

617 domain without consideration to weights. 

618 facets Number of facets on a side 

619  

620 A set of (facets x facets) subregions of the specified image 

621 are gridded separately using their respective phase centers 

622 (to minimize max W). Deconvolution is done on the joint 

623 full size image, using a PSF from the first subregion/facet. 

624  

625 In our current version of tclean, facets>1 may be used only 

626 with parallel=False. 

627 psfphasecenter For mosaic use psf centered on this 

628 optional direction. You may need to use 

629 this if for example the mosaic does not 

630 have any pointing in the center of the 

631 image. Another reason; as the psf is 

632 approximate for a mosaic, this may help 

633 to deconvolve a non central bright source 

634 well and quickly. 

635  

636 example: 

637  

638 psfphasecenter=6 #center psf on field 6 

639 psfphasecenter='J2000 19h30m00 -40d00m00' 

640 psfphasecenter='J2000 292.5deg -40.0deg' 

641 psfphasecenter='J2000 5.105rad -0.698rad' 

642 psfphasecenter='ICRS 13:05:27.2780 -049.28.04.458' 

643 wprojplanes Number of distinct w-values at which to compute and use different 

644 gridding convolution functions for W-Projection 

645  

646 An appropriate value of wprojplanes depends on the presence/absence 

647 of a bright source far from the phase center, the desired dynamic 

648 range of an image in the presence of a bright far out source, 

649 the maximum w-value in the measurements, and the desired trade off 

650 between accuracy and computing cost. 

651  

652 As a (rough) guide, VLA L-Band D-config may require a 

653 value of 128 for a source 30arcmin away from the phase 

654 center. A-config may require 1024 or more. To converge to an 

655 appropriate value, try starting with 128 and then increasing 

656 it if artifacts persist. W-term artifacts (for the VLA) typically look 

657 like arc-shaped smears in a synthesis image or a shift in source 

658 position between images made at different times. These artifacts 

659 are more pronounced the further the source is from the phase center. 

660  

661 There is no harm in simply always choosing a large value (say, 1024) 

662 but there will be a significant performance cost to doing so, especially 

663 for gridder='awproject' where it is combined with A-Projection. 

664  

665 wprojplanes=-1 is an option for gridder='widefield' or 'wproject' 

666 in which the number of planes is automatically computed. 

667 vptable vpmanager 

668  

669 vptable="" : Choose default beams for different telescopes 

670 ALMA : Airy disks 

671 EVLA : old VLA models. 

672  

673 Other primary beam models can be chosen via the vpmanager tool. 

674  

675 Step 1 : Set up the vpmanager tool and save its state in a table 

676  

677 vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10]) 

678 vp.saveastable('myvp.tab') 

679  

680 Step 2 : Supply the name of that table in tclean. 

681  

682 tclean(....., vptable='myvp.tab',....) 

683  

684 Please see the documentation for the vpmanager for more details on how to 

685 choose different beam models. Work is in progress to update the defaults 

686 for EVLA and ALMA. 

687  

688 Note : AWProjection currently does not use this mechanism to choose 

689 beam models. It instead uses ray-traced beams computed from 

690 parameterized aperture illumination functions, which are not 

691 available via the vpmanager. So, gridder='awproject' does not allow 

692 the user to set this parameter. 

693 mosweight When doing Brigg's style weighting (including uniform) to perform the weight density calculation for each field indepedently if True. If False the weight density is calculated from the average uv distribution of all the fields. 

694 aterm Use aperture illumination functions during gridding 

695  

696 This parameter turns on the A-term of the AW-Projection gridder. 

697 Gridding convolution functions are constructed from aperture illumination 

698 function models of each antenna. 

699 psterm Include the Prolate Spheroidal (PS) funtion as the anti-aliasing  

700 operator in the gridding convolution functions used for gridding. 

701  

702 Setting this parameter to true is necessary when aterm is set to  

703 false. It can be set to false when aterm is set to true, though  

704 with this setting effects of aliasing may be there in the image,  

705 particularly near the edges. 

706  

707 When set to true, the .pb images will contain the fourier transform 

708 of the of the PS funtion. The table below enumarates the functional 

709 effects of the psterm, aterm and wprojplanes settings. PB referes to  

710 the Primary Beam and FT() refers to the Fourier transform operation. 

711  

712 Operation aterm psterm wprojplanes Contents of the .pb image 

713 ---------------------------------------------------------------------- 

714 AW-Projection True True >1 FT(PS) x PB 

715 False PB 

716  

717 A-Projection True True 1 FT(PS) x PB 

718 False PB 

719  

720 W-Projection False True >1 FT(PS) 

721  

722 Standard False True 1 FT(PS) 

723 wbawp Use frequency dependent A-terms 

724 Scale aperture illumination functions appropriately with frequency 

725 when gridding and combining data from multiple channels. 

726 conjbeams Use conjugate frequency for wideband A-terms 

727  

728 While gridding data from one frequency channel, choose a convolution  

729 function from a 'conjugate' frequency such that the resulting baseline  

730 primary beam is approximately constant across frequency. For a system in  

731 which the primary beam scales with frequency, this step will eliminate  

732 instrumental spectral structure from the measured data and leave only the  

733 sky spectrum for the minor cycle to model and reconstruct [Bhatnagar et al., ApJ, 2013]. 

734  

735 As a rough guideline for when this is relevant, a source at the half power  

736 point of the PB at the center frequency will see an artificial spectral  

737 index of -1.4 due to the frequency dependence of the PB [Sault and Wieringa, 1994].  

738 If left uncorrected during gridding, this spectral structure must be modeled  

739 in the minor cycle (using the mtmfs algorithm) to avoid dynamic range limits  

740 (of a few hundred for a 2:1 bandwidth). 

741 This works for specmode='mfs' and its value is ignored for cubes 

742 cfcache Convolution function cache directory name 

743  

744 Name of a directory in which to store gridding convolution functions. 

745 This cache is filled at the beginning of an imaging run. This step can be time 

746 consuming but the cache can be reused across multiple imaging runs that 

747 use the same image parameters (cell size, image size , spectral data 

748 selections, wprojplanes, wbawp, psterm, aterm). The effect of the wbawp,  

749 psterm and aterm settings is frozen-in in the cfcache. Using an existing cfcache 

750 made with a different setting of these parameters will not reflect the current 

751 settings. 

752  

753 In a parallel execution, the construction of the cfcache is also parallelized  

754 and the time to compute scales close to linearly with the number of compute  

755 cores used. With the re-computation of Convolution Functions (CF) due to PA  

756 rotation turned-off (the computepastep parameter), the total number of in the 

757 cfcache can be computed as [No. of wprojplanes x No. of selected spectral windows x 4] 

758  

759 By default, cfcache = imagename + '.cf' 

760 usepointing The usepointing flag informs the gridder that it should utilize the pointing table 

761 to use the correct direction in which the antenna is pointing with respect to the pointing phasecenter. 

762 computepastep Parallactic angle interval after the AIFs are recomputed (deg) 

763  

764 This parameter controls the accuracy of the aperture illumination function 

765 used with AProjection for alt-az mount dishes where the AIF rotates on the 

766 sky as the synthesis image is built up. Once the PA in the data changes by  

767 the given interval, AIFs are re-computed at the new PA. 

768  

769 A value of 360.0 deg (the default) implies no re-computation due to PA rotation. 

770 AIFs are computed for the PA value of the first valid data received and used for  

771 all of the data. 

772 rotatepastep Parallactic angle interval after which the nearest AIF is rotated (deg)  

773  

774 Instead of recomputing the AIF for every timestep's parallactic angle, 

775 the nearest existing AIF is used and rotated 

776 after the PA changed by rotatepastep value. 

777  

778 A value of 360.0 deg (the default) disables rotation of the AIF. 

779  

780 For example, computepastep=360.0 and rotatepastep=5.0 will compute 

781 the AIFs at only the starting parallactic angle and all other timesteps will 

782 use a rotated version of that AIF at the nearest 5.0 degree point. 

783 pointingoffsetsigdev Corrections for heterogenous and time-dependent pointing  

784 offsets via AWProjection are controlled by this parameter.  

785 It is a vector of 2 ints or doubles each of which is interpreted  

786 in units of arcsec. Based on the first threshold, a clustering  

787 algorithm is applied to entries from the POINTING subtable  

788 of the MS to determine how distinct antenna groups for which 

789 the pointing offset must be computed separately. The second  

790 number controls how much a pointing change across time can  

791 be ignored and after which an antenna rebinning is required.  

792  

793  

794 Note : The default value of this parameter is [], due a programmatic constraint. 

795 If run with this value, it will internally pick [600,600] and exercise the 

796 option of using large tolerances (10arcmin) on both axes. Please choose 

797 a setting explicitly for runs that need to use this parameter.  

798  

799 Note : This option is available only for gridder='awproject' and usepointing=True and 

800 and has been validated primarily with VLASS on-the-fly mosaic data 

801 where POINTING subtables have been modified after the data are recorded. 

802  

803  

804 Examples of parameter usage :  

805  

806 [100.0,100.0] : Pointing offsets of 100 arcsec or less are considered  

807 small enough to be ignored. Using large values for both 

808 indicates a homogeneous array. 

809  

810  

811 [10.0, 100.0] : Based on entries in the POINTING subtable, antennas  

812 are grouped into clusters based on a 10arcsec bin size.  

813 All antennas in a bin are given a pointing offset calculated 

814 as the average of the offsets of all antennas in the bin. 

815 On the time axis, offset changes upto 100 arcsec will be ignored. 

816  

817 [10.0,10.0] : Calculate separate pointing offsets for each antenna group 

818 (with a 10 arcsec bin size). As a function of time, recalculate  

819 the antenna binning if the POINTING table entries change by 

820 more than 10 arcsec w.r.to the previously computed binning. 

821  

822 [1.0, 1.0] : Tight tolerances will imply a fully heterogenous situation where  

823 each antenna gets its own pointing offset. Also, time-dependent  

824 offset changes greater than 1 arcsec will trigger recomputes of  

825 the phase gradients. This is the most general situation and is also  

826 the most expensive option as it constructs and uses separate  

827 phase gradients for all baselines and timesteps.  

828  

829 For VLASS 1.1 data with two kinds of pointing offsets, the recommended 

830 setting is [ 30.0, 30.0 ]. 

831  

832 For VLASS 1.2 data with only the time-dependent pointing offsets, the 

833 recommended setting is [ 300.0, 30.0 ] to turn off the antenna grouping 

834 but to retain the time dependent corrections required from one timestep 

835 to the next. 

836 pblimit PB gain level at which to cut off normalizations 

837  

838 Divisions by .pb during normalizations have a cut off at a .pb gain 

839 level given by pblimit. Outside this limit, image values are set to zero. 

840 Additionally, by default, an internal T/F mask is applied to the .pb, .image and 

841 .residual images to mask out (T) all invalid pixels outside the pblimit area. 

842  

843 Note : This internal T/F mask cannot be used as a deconvolution mask. 

844 To do so, please follow the steps listed above in the Notes for the 

845 'gridder' parameter. 

846  

847 Note : To prevent the internal T/F mask from appearing in anything other 

848 than the .pb and .image.pbcor images, 'pblimit' can be set to a 

849 negative number.  

850 The absolute value will still be used as a valid 'pblimit' for normalization 

851 purposes. So, for example, pick pblimit=-0.1 (and not pblimit=-1).  

852 A tclean restart using existing output images on disk that already 

853 have this T/F mask in the .residual and .image but only pblimit set 

854 to a negative value, will remove this mask after the next major cycle. 

855  

856 Note : An existing internal T/F mask may be removed from an image as  

857 follows (without needing to re-run tclean itself).  

858 ia.open('test.image'); 

859 ia.maskhandler(op='set', name=''); 

860 ia.done() 

861 normtype Normalization type (flatnoise, flatsky, pbsquare) 

862  

863 Gridded (and FT'd) images represent the PB-weighted sky image. 

864 Qualitatively it can be approximated as two instances of the PB 

865 applied to the sky image (one naturally present in the data 

866 and one introduced during gridding via the convolution functions). 

867  

868 xxx.weight : Weight image approximately equal to sum ( square ( pb ) ) 

869 xxx.pb : Primary beam calculated as sqrt ( xxx.weight ) 

870  

871 normtype='flatnoise' : Divide the raw image by sqrt(.weight) so that 

872 the input to the minor cycle represents the 

873 product of the sky and PB. The noise is 'flat' 

874 across the region covered by each PB. 

875  

876 normtype='flatsky' : Divide the raw image by .weight so that the input 

877 to the minor cycle represents only the sky. 

878 The noise is higher in the outer regions of the 

879 primary beam where the sensitivity is low. 

880  

881 normtype='pbsquare' : No normalization after gridding and FFT. 

882 The minor cycle sees the sky times pb square 

883 deconvolver Name of minor cycle algorithm (hogbom,clark,multiscale,mtmfs,mem,clarkstokes,asp) 

884  

885 Each of the following algorithms operate on residual images and psfs 

886 from the gridder and produce output model and restored images. 

887 Minor cycles stop and a major cycle is triggered when cyclethreshold 

888 or cycleniter are reached. For all methods, components are picked from 

889 the entire extent of the image or (if specified) within a mask. 

890  

891 hogbom : An adapted version of Hogbom Clean [Hogbom, 1974] 

892 - Find the location of the peak residual 

893 - Add this delta function component to the model image 

894 - Subtract a scaled and shifted PSF of the same size as the image 

895 from regions of the residual image where the two overlap. 

896 - Repeat 

897  

898 clark : An adapted version of Clark Clean [Clark, 1980] 

899 - Find the location of max(I^2+Q^2+U^2+V^2) 

900 - Add delta functions to each stokes plane of the model image 

901 - Subtract a scaled and shifted PSF within a small patch size 

902 from regions of the residual image where the two overlap. 

903 - After several iterations trigger a Clark major cycle to subtract 

904 components from the visibility domain, but without de-gridding. 

905 - Repeat 

906  

907 ( Note : 'clark' maps to imagermode='' in the old clean task. 

908 'clark_exp' is another implementation that maps to 

909 imagermode='mosaic' or 'csclean' in the old clean task 

910 but the behavior is not identical. For now, please 

911 use deconvolver='hogbom' if you encounter problems. ) 

912  

913 clarkstokes : Clark Clean operating separately per Stokes plane 

914  

915 (Note : 'clarkstokes_exp' is an alternate version. See above.) 

916  

917 multiscale : MultiScale Clean [Cornwell, 2008] 

918 - Smooth the residual image to multiple scale sizes 

919 - Find the location and scale at which the peak occurs 

920 - Add this multiscale component to the model image 

921 - Subtract a scaled,smoothed,shifted PSF (within a small 

922 patch size per scale) from all residual images 

923 - Repeat from step 2 

924  

925 mtmfs : Multi-term (Multi Scale) Multi-Frequency Synthesis [Rau and Cornwell, 2011] 

926 - Smooth each Taylor residual image to multiple scale sizes 

927 - Solve a NTxNT system of equations per scale size to compute 

928 Taylor coefficients for components at all locations 

929 - Compute gradient chi-square and pick the Taylor coefficients 

930 and scale size at the location with maximum reduction in 

931 chi-square 

932 - Add multi-scale components to each Taylor-coefficient 

933 model image 

934 - Subtract scaled,smoothed,shifted PSF (within a small patch size 

935 per scale) from all smoothed Taylor residual images 

936 - Repeat from step 2 

937  

938  

939 mem : Maximum Entropy Method [Cornwell and Evans, 1985] 

940 - Iteratively solve for values at all individual pixels via the 

941 MEM method. It minimizes an objective function of 

942 chi-square plus entropy (here, a measure of difference 

943 between the current model and a flat prior model). 

944  

945 (Note : This MEM implementation is not very robust. 

946 Improvements will be made in the future.) 

947  

948 asp : Adaptive Scale Pixel algorithm [Bhatnagar and Cornwell, 2004] 

949 - Define a set of initial scales defined as 0, W, 2W 4W and 8W  

950 where W is a 2D Gaussian fitting width to the PSF  

951 - Smooth the residual image by a Gaussian beam at initial scales 

952 - Search for the global peak (F) among these smoothed residual images 

953 - form an active Aspen set: amplitude(F), amplitude location(x,y) 

954 - Optimize the Aspen set by minimizing the objective function RI-Aspen*PSF,  

955 where RI is the residual image and * is the convulition operation.  

956 - Compute the model image and update the residual image 

957 - Repeat from step 2 

958  

959 (Note : This is an experimental version of the ASP algorithm.) 

960 scales List of scale sizes (in pixels) for multi-scale and mtmfs algorithms. 

961 --> scales=[0,6,20] 

962 This set of scale sizes should represent the sizes 

963 (diameters in units of number of pixels) 

964 of dominant features in the image being reconstructed. 

965  

966 The smallest scale size is recommended to be 0 (point source), 

967 the second the size of the synthesized beam and the third 3-5 

968 times the synthesized beam, etc. For example, if the synthesized 

969 beam is 10" FWHM and cell=2",try scales = [0,5,15]. 

970  

971 For numerical stability, the largest scale must be 

972 smaller than the image (or mask) size and smaller than or 

973 comparable to the scale corresponding to the lowest measured 

974 spatial frequency (as a scale size much larger than what the 

975 instrument is sensitive to is unconstrained by the data making 

976 it harder to recovery from errors during the minor cycle). 

977 nterms Number of Taylor coefficients in the spectral model 

978  

979 - nterms=1 : Assume flat spectrum source 

980 - nterms=2 : Spectrum is a straight line with a slope 

981 - nterms=N : A polynomial of order N-1 

982  

983 From a Taylor expansion of the expression of a power law, the 

984 spectral index is derived as alpha = taylorcoeff_1 / taylorcoeff_0 

985  

986 Spectral curvature is similarly derived when possible. 

987  

988 The optimal number of Taylor terms depends on the available 

989 signal to noise ratio, bandwidth ratio, and spectral shape of the 

990 source as seen by the telescope (sky spectrum x PB spectrum). 

991  

992 nterms=2 is a good starting point for wideband EVLA imaging 

993 and the lower frequency bands of ALMA (when fractional bandwidth 

994 is greater than 10%) and if there is at least one bright source for 

995 which a dynamic range of greater than few 100 is desired. 

996  

997 Spectral artifacts for the VLA often look like spokes radiating out from 

998 a bright source (i.e. in the image made with standard mfs imaging). 

999 If increasing the number of terms does not eliminate these artifacts, 

1000 check the data for inadequate bandpass calibration. If the source is away 

1001 from the pointing center, consider including wide-field corrections too. 

1002  

1003 (Note : In addition to output Taylor coefficient images .tt0,.tt1,etc 

1004 images of spectral index (.alpha), an estimate of error on 

1005 spectral index (.alpha.error) and spectral curvature (.beta, 

1006 if nterms is greater than 2) are produced. 

1007 - These alpha, alpha.error and beta images contain 

1008 internal T/F masks based on a threshold computed 

1009 as peakresidual/10. Additional masking based on 

1010 .alpha/.alpha.error may be desirable. 

1011 - .alpha.error is a purely empirical estimate derived 

1012 from the propagation of error during the division of 

1013 two noisy numbers (alpha = xx.tt1/xx.tt0) where the 

1014 'error' on tt1 and tt0 are simply the values picked from 

1015 the corresponding residual images. The absolute value 

1016 of the error is not always accurate and it is best to interpret 

1017 the errors across the image only in a relative sense.) 

1018 smallscalebias A numerical control to bias the scales when using multi-scale or mtmfs algorithms. 

1019 The peak from each scale's smoothed residual is 

1020 multiplied by ( 1 - smallscalebias \* scale/maxscale ) 

1021 to increase or decrease the amplitude relative to other scales, 

1022 before the scale with the largest peak is chosen.  

1023 Smallscalebias can be varied between -1.0 and 1.0.  

1024 A score of 0.0 gives all scales equal weight (default).  

1025 A score larger than 0.0 will bias the solution towards smaller scales.  

1026 A score smaller than 0.0 will bias the solution towards larger scales. 

1027 The effect of smallscalebias is more pronounced when using multi-scale relative to mtmfs. 

1028 fusedthreshold ring Hogbom Clean (number in units of Jy) 

1029  

1030 fusedthreshold = 0.0001 : 0.1 mJy 

1031  

1032 This is a subparameter of the Asp Clean deconvolver. When peak residual  

1033 is lower than the threshold, Asp Clean is "switched to Hogbom Clean" (i.e. only use the 0 scale for cleaning) for  

1034 the following number of iterations until it switches back to Asp Clean. 

1035  

1036 NumberIterationsInHogbom = 50 + 2 * (exp(0.05 * NthHogbom) - 1) 

1037  

1038 , where NthHogbom is the number of times Hogbom Clean has been triggered.  

1039  

1040 When the Asp Clean detects it is approaching convergence, it uses only the 0 scale for the following number of iterations for better computational efficiency.  

1041  

1042 NumberIterationsInHogbom = 500 + 2 * (exp(0.05 * NthHogbom) - 1) 

1043  

1044 Set 'fusedthreshold = -1' to make the Asp Clean deconvolver never "switch" to Hogbom Clean. 

1045 largestscale xels) allowed for the initial guess for the Asp Clean deconvolver. 

1046  

1047 largestscale = 100 

1048  

1049 The default initial scale sizes used by Asp Clean is [0, w, 2w, 4w, 8w],  

1050 where `w` is the PSF width. The default `largestscale` is -1 which indicates  

1051 users accept these initial scales. If `largestscale` is set, the initial scales  

1052 would be [0, w, ... up to the `largestscale`]. This is only an initial guess, 

1053 and actual fitted scale sizes may evolve from these initial values. 

1054  

1055 It is recommended not to set `largestscale` unless Asp Clean picks a large  

1056 scale that has no constraints from the data (the UV hole issue). 

1057 restoration e. 

1058  

1059 Construct a restored image : imagename.image by convolving the model 

1060 image with a clean beam and adding the residual image to the result. 

1061 If a restoringbeam is specified, the residual image is also 

1062 smoothed to that target resolution before adding it in. 

1063  

1064 If a .model does not exist, it will make an empty one and create 

1065 the restored image from the residuals ( with additional smoothing if needed ). 

1066 With algorithm='mtmfs', this will construct Taylor coefficient maps from 

1067 the residuals and compute .alpha and .alpha.error. 

1068 restoringbeam ize to use. 

1069  

1070 - restoringbeam='' or [''] 

1071 A Gaussian fitted to the PSF main lobe (separately per image plane). 

1072  

1073 - restoringbeam='10.0arcsec' 

1074 Use a circular Gaussian of this width for all planes 

1075  

1076 - restoringbeam=['8.0arcsec','10.0arcsec','45deg'] 

1077 Use this elliptical Gaussian for all planes 

1078  

1079 - restoringbeam='common' 

1080 Automatically estimate a common beam shape/size appropriate for 

1081 all planes. 

1082  

1083 Note : For any restoring beam different from the native resolution 

1084 the model image is convolved with the beam and added to 

1085 residuals that have been convolved to the same target resolution. 

1086 pbcor the output restored image 

1087  

1088 A new image with extension .image.pbcor will be created from 

1089 the evaluation of .image / .pb for all pixels above the specified pblimit. 

1090  

1091 Note : Stand-alone PB-correction can be triggered by re-running 

1092 tclean with the appropriate imagename and with 

1093 niter=0, calcpsf=False, calcres=False, pbcor=True, vptable='vp.tab' 

1094 ( where vp.tab is the name of the vpmanager file. 

1095 See the inline help for the 'vptable' parameter ) 

1096  

1097 Note : For deconvolver='mtmfs', pbcor will divide each Taylor term image by the .tt0 average PB.  

1098 For all gridders, this calculation is accurate for small fractional bandwidths.  

1099  

1100 For large fractional bandwidths, please use one of the following options. 

1101  

1102 (a) For single pointings, run the tclean task with specmode='mfs', deconvolver='mtmfs',  

1103 and gridder='standard' with pbcor=True or False.  

1104 If a PB-corrected spectral index is required,  

1105 please use the widebandpbcor task to apply multi-tern PB-correction. 

1106  

1107 (b) For mosaics, run tclean task with specmode='mfs', deconvolver='mtmfs', 

1108 and gridder='awproject' , wbawp=True, conjbeams=True, with pbcor=True.  

1109 This option applies wideband PB correction as part of the gridding step and 

1110 pbcor=True will be accurate because the spectral index map will already  

1111 be PB-corrected.  

1112  

1113 (c) For mosaics, run tclean with specmode='mvc', deconvolver='mtmfs',  

1114 and gridder='standard' or 'mosaic' with pbcor=True.  

1115 This option applies wideband PB-correction to channelized residual images 

1116 prior to the minor cycle and pbcor=True will be accurate because the spectral  

1117 index map will already be PB-corrected.  

1118  

1119 Note : Frequency-dependent PB corrections are typically required for full-band imaging with the VLA.  

1120 Wideband PB corrections are required when the amplitude of the 

1121 brightest source is known accurately enough to be sensitive 

1122 to the difference in the PB gain between the upper and lower 

1123 end of the band at its location. As a guideline, the artificial spectral 

1124 index due to the PB is -1.4 at the 0.5 gain level and less than -0.2 

1125 at the 0.9 gain level at the middle frequency ) 

1126 outlierfile Name of outlier-field image definitions 

1127  

1128 A text file containing sets of parameter=value pairs, 

1129 one set per outlier field. 

1130  

1131 Example : outlierfile='outs.txt' 

1132  

1133 Contents of outs.txt : 

1134  

1135 imagename=tst1 

1136 nchan=1 

1137 imsize=[80,80] 

1138 cell=[8.0arcsec,8.0arcsec] 

1139 phasecenter=J2000 19:58:40.895 +40.55.58.543 

1140 mask=circle[[40pix,40pix],10pix] 

1141  

1142 imagename=tst2 

1143 nchan=1 

1144 imsize=[100,100] 

1145 cell=[8.0arcsec,8.0arcsec] 

1146 phasecenter=J2000 19:58:40.895 +40.56.00.000 

1147 mask=circle[[60pix,60pix],20pix] 

1148  

1149 The following parameters are currently allowed to be different between 

1150 the main field and the outlier fields (i.e. they will be recognized if found 

1151 in the outlier text file). If a parameter is not listed, the value is picked from 

1152 what is defined in the main task input. 

1153  

1154 imagename, imsize, cell, phasecenter, startmodel, mask 

1155 specmode, nchan, start, width, nterms, reffreq, 

1156 gridder, deconvolver, wprojplanes 

1157  

1158 Note : 'specmode' is an option, so combinations of mfs and cube 

1159 for different image fields, for example, are supported. 

1160 'deconvolver' and 'gridder' are also options that allow different 

1161 imaging or deconvolution algorithm per image field. 

1162  

1163 For example, multiscale with wprojection and 16 w-term planes 

1164 on the main field and mtmfs with nterms=3 and wprojection 

1165 with 64 planes on a bright outlier source for which the frequency 

1166 dependence of the primary beam produces a strong effect that 

1167 must be modeled. The traditional alternative to this approach is 

1168 to first image the outlier, subtract it out of the data (uvsub) and 

1169 then image the main field. 

1170  

1171 Note : If you encounter a use-case where some other parameter needs 

1172 to be allowed in the outlier file (and it is logical to do so), please 

1173 send us feedback. The above is an initial list. 

1174 weighting Weighting scheme (natural,uniform,briggs,superuniform,radial, briggsabs, briggsbwtaper) 

1175  

1176 During gridding of the dirty or residual image, each visibility value is 

1177 multiplied by a weight before it is accumulated on the uv-grid. 

1178 The PSF's uv-grid is generated by gridding only the weights (weightgrid). 

1179  

1180 weighting='natural' : Gridding weights are identical to the data weights 

1181 from the MS. For visibilities with similar data weights, 

1182 the weightgrid will follow the sample density 

1183 pattern on the uv-plane. This weighting scheme 

1184 provides the maximum imaging sensitivity at the 

1185 expense of a possibly fat PSF with high sidelobes. 

1186 It is most appropriate for detection experiments 

1187 where sensitivity is most important. 

1188  

1189 weighting='uniform' : Gridding weights per visibility data point are the 

1190 original data weights divided by the total weight of 

1191 all data points that map to the same uv grid cell : 

1192 ' data_weight / total_wt_per_cell '. 

1193  

1194 The weightgrid is as close to flat as possible resulting 

1195 in a PSF with a narrow main lobe and suppressed 

1196 sidelobes. However, since heavily sampled areas of 

1197 the uv-plane get down-weighted, the imaging 

1198 sensitivity is not as high as with natural weighting. 

1199 It is most appropriate for imaging experiments where 

1200 a well behaved PSF can help the reconstruction. 

1201  

1202 weighting='briggs' : Gridding weights per visibility data point are given by 

1203 'data_weight / ( A \* total_wt_per_cell + B ) ' where 

1204 A and B vary according to the 'robust' parameter. 

1205  

1206 robust = -2.0 maps to A=1,B=0 or uniform weighting. 

1207 robust = +2.0 maps to natural weighting. 

1208 (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.) 

1209  

1210 Robust/Briggs weighting generates a PSF that can 

1211 vary smoothly between 'natural' and 'uniform' and 

1212 allow customized trade-offs between PSF shape and 

1213 imaging sensitivity. 

1214 weighting='briggsabs' : Experimental option. 

1215 Same as Briggs except the formula is different A= 

1216 robust\*robust and B is dependent on the 

1217 noise per visibility estimated. Giving noise='0Jy' 

1218 is a not a reasonable option. 

1219 In this mode (or formula) robust values 

1220 from -2.0 to 0.0 only make sense (2.0 and 

1221 -2.0 will get the same weighting) 

1222  

1223 weighting='superuniform' : This is similar to uniform weighting except that 

1224 the total_wt_per_cell is replaced by the 

1225 total_wt_within_NxN_cells around the uv cell of 

1226 interest. N=7 is the default (when the  

1227 parameter 'npixels' is set to 0 with 'superuniform')  

1228  

1229 This method tends to give a PSF with inner 

1230 sidelobes that are suppressed as in uniform 

1231 weighting but with far-out sidelobes closer to 

1232 natural weighting. The peak sensitivity is also 

1233 closer to natural weighting. 

1234  

1235 weighting='radial' : Gridding weights are given by ' data_weight \* uvdistance ' 

1236 This method approximately minimizes rms sidelobes 

1237 for an east-west synthesis array. 

1238  

1239 weighting='briggsbwtaper' : A modified version of Briggs weighting for cubes where an inverse uv taper, 

1240 which is proportional to the fractional bandwidth of the entire cube, 

1241 is applied per channel. The objective is to modify cube (perchanweightdensity = True) 

1242 imaging weights to have a similar density to that of the continuum imaging weights. 

1243 This is currently an experimental weighting scheme being developed for ALMA. 

1244  

1245 For more details on weighting please see Chapter3 

1246 of Dan Briggs' thesis (http://www.aoc.nrao.edu/dissertations/dbriggs) 

1247 robust Robustness parameter for Briggs weighting. 

1248  

1249 robust = -2.0 maps to uniform weighting. 

1250 robust = +2.0 maps to natural weighting. 

1251 (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.) 

1252 noise noise parameter for briggs abs mode weighting 

1253 npixels Number of pixels to determine uv-cell size for super-uniform weighting 

1254 (0 defaults to -/+ 3 pixels) 

1255  

1256 npixels -- uv-box used for weight calculation 

1257 a box going from -npixel/2 to +npixel/2 on each side 

1258 around a point is used to calculate weight density. 

1259  

1260 npixels=2 goes from -1 to +1 and covers 3 pixels on a side. 

1261  

1262 npixels=0 implies a single pixel, which does not make sense for 

1263 superuniform weighting. Therefore, for 'superuniform' 

1264 weighting, if npixels=0 it will be forced to 6 (or a box  

1265 of -3pixels to +3pixels) to cover 7 pixels on a side. 

1266 uvtaper uv-taper on outer baselines in uv-plane 

1267  

1268 Apply a Gaussian taper in addition to the weighting scheme specified 

1269 via the 'weighting' parameter. Higher spatial frequencies are weighted 

1270 down relative to lower spatial frequencies to suppress artifacts 

1271 arising from poorly sampled areas of the uv-plane. It is equivalent to 

1272 smoothing the PSF obtained by other weighting schemes and can be 

1273 specified either as the HWHM of a Gaussian in uv-space (eg. units of lambda) 

1274 or as the FWHM of a Gaussian in the image domain (eg. angular units like arcsec). 

1275  

1276 uvtaper = [bmaj, bmin, bpa] 

1277  

1278 Note : FWHM_uv_lambda = (4 log2) / ( pi * FWHM_lm_radians )  

1279  

1280 A FWHM_lm of 100.000 arcsec maps to a HWHM_uv of 910.18 lambda 

1281 A FWHM_lm of 1 arcsec maps to a HWHM_uv of 91 klambda 

1282  

1283 default: uvtaper=[]; no Gaussian taper applied 

1284 example: uvtaper=['5klambda'] circular taper of HWHM=5 kilo-lambda 

1285 uvtaper=['5klambda','3klambda','45.0deg'] uv-domain HWHM 

1286 uvtaper=['50arcsec','30arcsec','30.0deg'] : image domain FWHM 

1287 uvtaper=['10arcsec'] : image domain FWHM  

1288 uvtaper=['300.0'] default units are lambda in aperture plane 

1289 niter Maximum number of iterations 

1290  

1291 A stopping criterion based on total iteration count. 

1292 Currently the parameter type is defined as an integer therefore the integer value  

1293 larger than 2147483647 will not be set properly as it causes an overflow. 

1294  

1295 Iterations are typically defined as the selecting one flux component 

1296 and partially subtracting it out from the residual image. 

1297  

1298 niter=0 : Do only the initial major cycle (make dirty image, psf, pb, etc) 

1299  

1300 niter larger than zero : Run major and minor cycles. 

1301  

1302 Note : Global stopping criteria vs major-cycle triggers 

1303  

1304 In addition to global stopping criteria, the following rules are 

1305 used to determine when to terminate a set of minor cycle iterations 

1306 and trigger major cycles [derived from Cotton-Schwab Clean, 1984] 

1307  

1308 'cycleniter' : controls the maximum number of iterations per image 

1309 plane before triggering a major cycle. 

1310 'cyclethreshold' : Automatically computed threshold related to the 

1311 max sidelobe level of the PSF and peak residual. 

1312 Divergence, detected as an increase of 10% in peak residual from the 

1313 minimum so far (during minor cycle iterations) 

1314  

1315 The first criterion to be satisfied takes precedence. 

1316  

1317 Note : Iteration counts for cubes or multi-field images : 

1318 For images with multiple planes (or image fields) on which the 

1319 deconvolver operates in sequence, iterations are counted across 

1320 all planes (or image fields). The iteration count is compared with 

1321 'niter' only after all channels/planes/fields have completed their 

1322 minor cycles and exited either due to 'cycleniter' or 'cyclethreshold'. 

1323 Therefore, the actual number of iterations reported in the logger 

1324 can sometimes be larger than the user specified value in 'niter'. 

1325 For example, with niter=100, cycleniter=20,nchan=10,threshold=0, 

1326 a total of 200 iterations will be done in the first set of minor cycles 

1327 before the total is compared with niter=100 and it exits. 

1328  

1329 Note : Additional global stopping criteria include 

1330 - no change in peak residual across two major cycles 

1331 - a 50% or more increase in peak residual across one major cycle 

1332 gain Loop gain 

1333  

1334 Fraction of the source flux to subtract out of the residual image 

1335 for the CLEAN algorithm and its variants. 

1336  

1337 A low value (0.2 or less) is recommended when the sky brightness 

1338 distribution is not well represented by the basis functions used by 

1339 the chosen deconvolution algorithm. A higher value can be tried when 

1340 there is a good match between the true sky brightness structure and 

1341 the basis function shapes. For example, for extended emission, 

1342 multiscale clean with an appropriate set of scale sizes will tolerate 

1343 a higher loop gain than Clark clean (for example). 

1344 threshold Stopping threshold (number in units of Jy, or string) 

1345  

1346 A global stopping threshold that the peak residual (within clean mask) 

1347 across all image planes is compared to. 

1348  

1349 threshold = 0.005 : 5mJy 

1350 threshold = '5.0mJy' 

1351  

1352 Note : A 'cyclethreshold' is internally computed and used as a major cycle 

1353 trigger. It is related what fraction of the PSF can be reliably 

1354 used during minor cycle updates of the residual image. By default 

1355 the minor cycle iterations terminate once the peak residual reaches 

1356 the first sidelobe level of the brightest source. 

1357  

1358 'cyclethreshold' is computed as follows using the settings in 

1359 parameters 'cyclefactor','minpsffraction','maxpsffraction','threshold' : 

1360  

1361 psf_fraction = max_psf_sidelobe_level \* 'cyclefactor' 

1362 psf_fraction = max(psf_fraction, 'minpsffraction'); 

1363 psf_fraction = min(psf_fraction, 'maxpsffraction'); 

1364 cyclethreshold = peak_residual \* psf_fraction 

1365 cyclethreshold = max( cyclethreshold, 'threshold' ) 

1366  

1367 If nsigma is set (>0.0), the N-sigma threshold is calculated (see 

1368 the description under nsigma), then cyclethreshold is further modified as, 

1369  

1370 cyclethreshold = max( cyclethreshold, nsgima_threshold ) 

1371  

1372  

1373 'cyclethreshold' is made visible and editable only in the 

1374 interactive GUI when tclean is run with interactive=True. 

1375 nsigma Multiplicative factor for rms-based threshold stopping 

1376  

1377 N-sigma threshold is calculated as nsigma \* rms value per image plane determined 

1378 from a robust statistics. For nsigma > 0.0, in a minor cycle, a maximum of the two values, 

1379 the N-sigma threshold and cyclethreshold, is used to trigger a major cycle 

1380 (see also the descreption under 'threshold'). 

1381 Set nsigma=0.0 to preserve the previous tclean behavior without this feature. 

1382 The top level parameter, fastnoise is relevant for the rms noise calculation which is used  

1383 to determine the threshold.  

1384  

1385 The parameter 'nsigma' may be an int, float, or a double. 

1386 cycleniter Maximum number of minor-cycle iterations (per plane) before triggering 

1387 a major cycle 

1388  

1389 For example, for a single plane image, if niter=100 and cycleniter=20, 

1390 there will be 5 major cycles after the initial one (assuming there is no 

1391 threshold based stopping criterion). At each major cycle boundary, if 

1392 the number of iterations left over (to reach niter) is less than cycleniter, 

1393 it is set to the difference. 

1394  

1395 Note : cycleniter applies per image plane, even if cycleniter x nplanes 

1396 gives a total number of iterations greater than 'niter'. This is to 

1397 preserve consistency across image planes within one set of minor 

1398 cycle iterations. 

1399 cyclefactor Scaling on PSF sidelobe level to compute the minor-cycle stopping threshold. 

1400  

1401 Please refer to the Note under the documentation for 'threshold' that 

1402 discussed the calculation of 'cyclethreshold' 

1403  

1404 cyclefactor=1.0 results in a cyclethreshold at the first sidelobe level of 

1405 the brightest source in the residual image before the minor cycle starts. 

1406  

1407 cyclefactor=0.5 allows the minor cycle to go deeper. 

1408 cyclefactor=2.0 triggers a major cycle sooner. 

1409 minpsffraction PSF fraction that marks the max depth of cleaning in the minor cycle 

1410  

1411 Please refer to the Note under the documentation for 'threshold' that 

1412 discussed the calculation of 'cyclethreshold' 

1413  

1414 For example, minpsffraction=0.5 will stop cleaning at half the height of 

1415 the peak residual and trigger a major cycle earlier. 

1416 maxpsffraction PSF fraction that marks the minimum depth of cleaning in the minor cycle 

1417  

1418 Please refer to the Note under the documentation for 'threshold' that 

1419 discussed the calculation of 'cyclethreshold' 

1420  

1421 For example, maxpsffraction=0.8 will ensure that at least the top 20 

1422 percent of the source will be subtracted out in the minor cycle even if 

1423 the first PSF sidelobe is at the 0.9 level (an extreme example), or if the 

1424 cyclefactor is set too high for anything to get cleaned. 

1425 interactive Modify masks and parameters at runtime 

1426  

1427 interactive=True will trigger an interactive GUI at every major cycle 

1428 boundary (after the major cycle and before the minor cycle). 

1429  

1430 Options for runtime parameter modification are : 

1431  

1432 Interactive clean mask : Draw a 1/0 mask (appears as a contour) by hand. 

1433 If a mask is supplied at the task interface or if 

1434 automasking is invoked, the current mask is 

1435 displayed in the GUI and is available for manual 

1436 editing. 

1437  

1438 Note : If a mask contour is not visible, please 

1439 check the cursor display at the bottom of 

1440 GUI to see which parts of the mask image 

1441 have ones and zeros. If the entire mask=1 

1442 no contours will be visible. 

1443  

1444  

1445 Operation buttons : -- Stop execution now (restore current model and exit) 

1446 -- Continue on until global stopping criteria are reached 

1447 without stopping for any more interaction 

1448 -- Continue with minor cycles and return for interaction 

1449 after the next major cycle. 

1450  

1451 Iteration control : -- max cycleniter : Trigger for the next major cycle 

1452  

1453 The display begins with 

1454 [ min( cycleniter, niter - itercount ) ] 

1455 and can be edited by hand. 

1456  

1457 -- iterations left : The display begins with [niter-itercount ] 

1458 and can be edited to increase or 

1459 decrease the total allowed niter. 

1460  

1461 -- threshold : Edit global stopping threshold 

1462  

1463 -- cyclethreshold : The display begins with the 

1464 automatically computed value 

1465 (see Note in help for 'threshold'), 

1466 and can be edited by hand. 

1467  

1468 All edits will be reflected in the log messages that appear 

1469 once minor cycles begin. 

1470 nmajor The nmajor parameter limits the number of minor and major cycle sets 

1471 that tclean executes. It is defined as the number of major cycles after the  

1472 initial set of minor cycle iterations. In other words, the count of nmajor does  

1473 not include the initial residual calculation that occurs when calcres=True.  

1474  

1475 A setting of nmajor=-1 implies no limit (default -1).  

1476 A setting of nmajor=0 implies nothing other than the initial residual calculation 

1477 A setting of nmajor>0 imples that nmajor sets of minor and major cycles will  

1478 be done in addition to the initial residual calculation.  

1479  

1480 If the major cycle limit is reached, stopcode 9 will be returned. Other stopping 

1481 criteria (such as threshold) could cause tclean to stop in fewer than this 

1482 number of major cycles. If tclean reaches another stopping criteria, first 

1483 or at the same time as nmajor, then that stopcode will be returned instead. 

1484  

1485 Note however that major cycle ids in the log messages as well as in the return 

1486 dictionary do begin with 1 for the initial residual calculation, when it exists.  

1487  

1488 Example 1 : A tclean run with 'nmajor=5' and 'calcres=True' will iterate for 

1489 5 major cycles (not counting the initial residual calculation). But, the return 

1490 dictionary will show 'nmajordone:6'. If 'calcres=False', then the return 

1491 dictionary will show 'nmajordone:5'.  

1492  

1493 Example 2 : For both the following cases, there will be a printout in the logs  

1494 "Running Major Cycle 1" and the return value will include "nmajordone: 1",  

1495 however there is a difference in the purpose of the major cycle and the  

1496 number of minor cycles executed: 

1497 Case 1; nmajor=0, calcres=True: The major cycle done is for the creation 

1498 of the residual, and no minor cycles are executed. 

1499 Case 2; nmajor=1, calcres=False: The major cycle is done as part of the 

1500 major/minor cycle loop, and 1 minor cycle will be executed. 

1501 fullsummary Return dictionary with complete convergence history 

1502  

1503 fullsummary=True: A full version of the summary dictionary is returned. 

1504 Keys include 'iterDone','peakRes','modelFlux','cycleThresh' that record the 

1505 convergence state at the end of each set of minor cycle iterations 

1506 separately for each image plane (i.e. channel/stokes) being 

1507 deconvolved. Additional keys report the convergence state at the 

1508 start of minor cycle iterations, stopping criteria that triggered major 

1509 cycles, and a processor ID per channel, for parallel cube runs. 

1510  

1511 fullsummary=False (default): A shorten version of the summary dictionary is returned 

1512 with only 'iterDone','peakRes','modelFlux', and 'cycleThresh'. 

1513  

1514  

1515 Detailed information about the return dictionary fields may be found 

1516 at CASA Docs > Synthesis Imaging > Iteration Control > Returned Dictionary. 

1517  

1518 Note : With some parallel cube imaging runs that have a large number of channels 

1519 and iterations per cube partition in a parallel run, an MPI message passing limit may 

1520 be reached due to the size of the return dictionaries being passed around, causing 

1521 CASA to crash (with fullsummary=True). The limit has been estimated to be reached 

1522 only when nchan_per_chunk x iterdone_per_minorcycleset > 8e+6. The option to set 

1523 fullsummary=False should be used to guard against this. 

1524 usemask Type of mask(s) to be used for deconvolution 

1525  

1526 user: (default) mask image(s) or user specified region file(s) or string CRTF expression(s) 

1527 subparameters: mask, pbmask 

1528 pb: primary beam mask 

1529 subparameter: pbmask 

1530  

1531 Example: usemask="pb", pbmask=0.2 

1532 Construct a mask at the 0.2 pb gain level. 

1533 (Currently, this option will work only with 

1534 gridders that produce .pb (i.e. mosaic and awproject) 

1535 or if an externally produced .pb image exists on disk) 

1536  

1537 auto-multithresh : auto-masking by multiple thresholds for deconvolution 

1538 subparameters : sidelobethreshold, noisethreshold, lownoisethreshold, negativethrehsold, smoothfactor, 

1539 minbeamfrac, cutthreshold, pbmask, growiterations, dogrowprune, minpercentchange, verbose 

1540 Additional top level parameter relevant to auto-multithresh: fastnoise 

1541  

1542 if pbmask is >0.0, the region outside the specified pb gain level is excluded from 

1543 image statistics in determination of the threshold. 

1544  

1545  

1546  

1547  

1548 Note: By default the intermediate mask generated by automask at each deconvolution cycle 

1549 is over-written in the next cycle but one can save them by setting 

1550 the environment variable, SAVE_ALL_AUTOMASKS="true". 

1551 (e.g. in the CASA prompt, os.environ['SAVE_ALL_AUTOMASKS']="true" ) 

1552 The saved CASA mask image name will be imagename.mask.autothresh#, where 

1553 # is the iteration cycle number. 

1554 mask Mask (a list of image name(s) or region file(s) or region string(s) 

1555  

1556  

1557 The name of a CASA image or region file or region string that specifies 

1558 a 1/0 mask to be used for deconvolution. Only locations with value 1 will 

1559 be considered for the centers of flux components in the minor cycle. 

1560 If regions specified fall completely outside of the image, tclean will throw an error. 

1561  

1562 Manual mask options/examples : 

1563  

1564 mask='xxx.mask' : Use this CASA image named xxx.mask and containing 

1565 ones and zeros as the mask.  

1566 If the mask is only different in spatial coordinates from what is being made  

1567 it will be resampled to the target coordinate system before being used. 

1568 The mask has to have the same shape in velocity and Stokes planes 

1569 as the output image. Exceptions are single velocity and/or single 

1570 Stokes plane masks. They will be expanded to cover all velocity and/or 

1571 Stokes planes of the output cube. 

1572  

1573 [ Note : If an error occurs during image resampling or 

1574 if the expected mask does not appear, please try 

1575 using tasks 'imregrid' or 'makemask' to resample 

1576 the mask image onto a CASA image with the target 

1577 shape and coordinates and supply it via the 'mask' 

1578 parameter. ] 

1579  

1580  

1581 mask='xxx.crtf' : A text file with region strings and the following on the first line 

1582 ( #CRTFv0 CASA Region Text Format version 0 ) 

1583 This is the format of a file created via the viewer's region 

1584 tool when saved in CASA region file format. 

1585  

1586 mask='circle[[40pix,40pix],10pix]' : A CASA region string. 

1587  

1588 mask=['xxx.mask','xxx.crtf', 'circle[[40pix,40pix],10pix]'] : a list of masks 

1589  

1590  

1591  

1592  

1593  

1594 Note : Mask images for deconvolution must contain 1 or 0 in each pixel. 

1595 Such a mask is different from an internal T/F mask that can be 

1596 held within each CASA image. These two types of masks are not 

1597 automatically interchangeable, so please use the makemask task 

1598 to copy between them if you need to construct a 1/0 based mask 

1599 from a T/F one. 

1600  

1601 Note : Work is in progress to generate more flexible masking options and 

1602 enable more controls. 

1603 pbmask Sub-parameter for usemask: primary beam mask 

1604  

1605 Examples : pbmask=0.0 (default, no pb mask) 

1606 pbmask=0.2 (construct a mask at the 0.2 pb gain level) 

1607 sidelobethreshold Sub-parameter for "auto-multithresh": mask threshold based on sidelobe levels: sidelobethreshold \* max_sidelobe_level \* peak residual 

1608 noisethreshold Sub-parameter for "auto-multithresh": mask threshold based on the noise level: noisethreshold \* rms + location (=median) 

1609  

1610 The rms is calculated from MAD with rms = 1.4826\*MAD. 

1611 lownoisethreshold Sub-parameter for "auto-multithresh": mask threshold to grow previously masked regions via binary dilation: lownoisethreshold \* rms in residual image + location (=median) 

1612  

1613 The rms is calculated from MAD with rms = 1.4826\*MAD. 

1614 negativethreshold Sub-parameter for "auto-multithresh": mask threshold for negative features: -1.0* negativethreshold \* rms + location(=median) 

1615  

1616 The rms is calculated from MAD with rms = 1.4826\*MAD. 

1617 smoothfactor Sub-parameter for "auto-multithresh": smoothing factor in a unit of the beam 

1618 minbeamfrac Sub-parameter for "auto-multithresh": minimum beam fraction in size to prune masks smaller than mimbeamfrac \* beam 

1619 <=0.0 : No pruning 

1620 cutthreshold Sub-parameter for "auto-multithresh": threshold to cut the smoothed mask to create a final mask: cutthreshold \* peak of the smoothed mask 

1621 growiterations Sub-parameter for "auto-multithresh": Maximum number of iterations to perform using binary dilation for growing the mask 

1622 dogrowprune Experimental sub-parameter for "auto-multithresh": Do pruning on the grow mask 

1623 minpercentchange If the change in the mask size in a particular channel is less than minpercentchange, stop masking that channel in subsequent cycles. This check is only applied when noise based threshold is used and when the previous clean major cycle had a cyclethreshold value equal to the clean threshold. Values equal to -1.0 (or any value less than 0.0) will turn off this check (the default). Automask will still stop masking if the current channel mask is an empty mask and the noise threshold was used to determine the mask. 

1624 verbose he summary of automasking at the end of each automasking process 

1625 is printed in the logger. Following information per channel will be listed in the summary. 

1626  

1627 chan: channel number 

1628 masking?: F - stop updating automask for the subsequent iteration cycles 

1629 RMS: robust rms noise 

1630 peak: peak in residual image 

1631 thresh_type: type of threshold used (noise or sidelobe) 

1632 thresh_value: the value of threshold used 

1633 N_reg: number of the automask regions 

1634 N_pruned: number of the automask regions removed by pruning 

1635 N_grow: number of the grow mask regions 

1636 N_grow_pruned: number of the grow mask regions removed by pruning 

1637 N_neg_pix: number of pixels for negative mask regions 

1638  

1639 Note that for a large cube, extra logging may slow down the process. 

1640 fastnoise Only relevant when automask (user='multi-autothresh') and/or n-sigma stopping threshold (nsigma>0.0) are/is used. If it is set to True, a simpler but faster noise calucation is used.  

1641 In this case, the threshold values are determined based on classic statistics (using all 

1642 unmasked pixels for the calculations). 

1643  

1644 If it is set to False, the new noise calculation 

1645 method is used based on pre-existing mask.  

1646  

1647 Case 1: no exiting mask 

1648 Calculate image statistics using Chauvenet algorithm  

1649  

1650 Case 2: there is an existing mask 

1651 Calculate image statistics by classical method on the region 

1652 outside the mask and inside the primary beam mask. 

1653  

1654 In all cases above RMS noise is calculated from MAD. 

1655 restart images (and start from an existing model image) 

1656 or automatically increment the image name and make a new image set. 

1657  

1658 True : Re-use existing images. If imagename.model exists the subsequent 

1659 run will start from this model (i.e. predicting it using current gridder 

1660 settings and starting from the residual image). Care must be taken 

1661 when combining this option with startmodel. Currently, only one or 

1662 the other can be used. 

1663  

1664 startmodel='', imagename.model exists : 

1665 - Start from imagename.model 

1666 startmodel='xxx', imagename.model does not exist : 

1667 - Start from startmodel 

1668 startmodel='xxx', imagename.model exists : 

1669 - Exit with an error message requesting the user to pick 

1670 only one model. This situation can arise when doing one 

1671 run with startmodel='xxx' to produce an output 

1672 imagename.model that includes the content of startmodel, 

1673 and wanting to restart a second run to continue deconvolution. 

1674 Startmodel should be set to '' before continuing. 

1675  

1676 If any change in the shape or coordinate system of the image is 

1677 desired during the restart, please change the image name and 

1678 use the startmodel (and mask) parameter(s) so that the old model 

1679 (and mask) can be regridded to the new coordinate system before starting. 

1680  

1681 False : A convenience feature to increment imagename with '_1', '_2', 

1682 etc as suffixes so that all runs of tclean are fresh starts (without 

1683 having to change the imagename parameter or delete images). 

1684  

1685 This mode will search the current directory for all existing 

1686 imagename extensions, pick the maximum, and adds 1. 

1687 For imagename='try' it will make try.psf, try_2.psf, try_3.psf, etc. 

1688  

1689 This also works if you specify a directory name in the path : 

1690 imagename='outdir/try'. If './outdir' does not exist, it will create it. 

1691 Then it will search for existing filenames inside that directory. 

1692  

1693 If outlier fields are specified, the incrementing happens for each 

1694 of them (since each has its own 'imagename'). The counters are 

1695 synchronized across imagefields, to make it easier to match up sets 

1696 of output images. It adds 1 to the 'max id' from all outlier names 

1697 on disk. So, if you do two runs with only the main field 

1698 (imagename='try'), and in the third run you add an outlier with 

1699 imagename='outtry', you will get the following image names 

1700 for the third run : 'try_3' and 'outtry_3' even though 

1701 'outry' and 'outtry_2' have not been used. 

1702 savemodel Options to save model visibilities (none, virtual, modelcolumn) 

1703  

1704 Often, model visibilities must be created and saved in the MS 

1705 to be later used for self-calibration (or to just plot and view them). 

1706  

1707 none : Do not save any model visibilities in the MS. The MS is opened 

1708 in readonly mode. 

1709  

1710 Model visibilities can be predicted in a separate step by 

1711 restarting tclean with niter=0,savemodel=virtual or modelcolumn 

1712 and not changing any image names so that it finds the .model on 

1713 disk (or by changing imagename and setting startmodel to the 

1714 original imagename). 

1715  

1716 virtual : In the last major cycle, save the image model and state of the 

1717 gridder used during imaging within the SOURCE subtable of the 

1718 MS. Images required for de-gridding will also be stored internally. 

1719 All future references to model visibilities will activate the 

1720 (de)gridder to compute them on-the-fly. This mode is useful 

1721 when the dataset is large enough that an additional model data 

1722 column on disk may be too much extra disk I/O, when the 

1723 gridder is simple enough that on-the-fly recomputing of the 

1724 model visibilities is quicker than disk I/O. 

1725 For e.g. that gridder='awproject' does not support virtual model.  

1726  

1727 modelcolumn : In the last major cycle, save predicted model visibilities 

1728 in the MODEL_DATA column of the MS. This mode is useful when 

1729 the de-gridding cost to produce the model visibilities is higher 

1730 than the I/O required to read the model visibilities from disk. 

1731 This mode is currently required for gridder='awproject'. 

1732 This mode is also required for the ability to later pull out 

1733 model visibilities from the MS into a python array for custom 

1734 processing. 

1735  

1736 Note 1 : The imagename.model image on disk will always be constructed 

1737 if the minor cycle runs. This savemodel parameter applies only to 

1738 model visibilities created by de-gridding the model image. 

1739  

1740 Note 2 : It is possible for an MS to have both a virtual model 

1741 as well as a model_data column, but under normal operation, 

1742 the last used mode will get triggered. Use the delmod task to 

1743 clear out existing models from an MS if confusion arises. 

1744 Note 3: when parallel=True, use savemodel='none'; Other options are not yet ready  

1745 for use in parallel. If model visibilities need to be saved (virtual or modelcolumn): 

1746 please run tclean in serial mode with niter=0; after the parallel run 

1747 calcres Calculate initial residual image 

1748  

1749 This parameter controls what the first major cycle does. 

1750  

1751 calcres=False with niter greater than 0 will assume that 

1752 a .residual image already exists and that the minor cycle can 

1753 begin without recomputing it. 

1754  

1755 calcres=False with niter=0 implies that only the PSF will be made 

1756 and no data will be gridded. 

1757  

1758 calcres=True requires that calcpsf=True or that the .psf and .sumwt 

1759 images already exist on disk (for normalization purposes). 

1760  

1761 Usage example : For large runs (or a pipeline scripts) it may be 

1762 useful to first run tclean with niter=0 to create 

1763 an initial .residual to look at and perhaps make 

1764 a custom mask for. Imaging can be resumed 

1765 without recomputing it. 

1766 calcpsf Calculate PSF 

1767  

1768 This parameter controls what the first major cycle does. 

1769  

1770 calcpsf=False will assume that a .psf image already exists 

1771 and that the minor cycle can begin without recomputing it. 

1772 psfcutoff When the .psf image is created a 2 dimensional Gaussian is fit to the main lobe of the PSF. 

1773 Which pixels in the PSF are fitted is determined by psfcutoff. 

1774 The default value of psfcutoff is 0.35 and can varied from 0.01 to 0.99. 

1775 Fitting algorithm: 

1776 - A region of 41 x 41 pixels around the peak of the PSF is compared against the psfcutoff. 

1777 Sidelobes are ignored by radially searching from the PSF peak. 

1778 - Calculate the bottom left corner (blc) and top right corner (trc) from the points. Expand blc and trc with a number of pixels (5). 

1779 - Create a new sub-matrix from blc and trc. 

1780 - Interpolate matrix to a target number of points (3001) using CUBIC spline. 

1781 - All the non-sidelobe points, in the interpolated matrix, that are above the psfcutoff are used to fit a Gaussian. 

1782 A Levenberg-Marquardt algorithm is used. 

1783 - If the fitting fails the algorithm is repeated with the psfcutoff decreased (psfcutoff=psfcutoff/1.5). 

1784 A message in the log will apear if the fitting fails along with the new value of psfcutoff. 

1785 This will be done up to 50 times if fitting fails. 

1786 This Gaussian beam is defined by a major axis, minor axis, and position angle. 

1787 During the restoration process, this Gaussian beam is used as the Clean beam. 

1788 Varying psfcutoff might be useful for producing a better fit for highly non-Gaussian PSFs, however, the resulting fits should be carefully checked. 

1789 This parameter should rarely be changed. 

1790  

1791 (This is not the support size for clark clean.) 

1792 parallel Run major cycles in parallel (this feature is experimental) 

1793  

1794 Parallel tclean will run only if casa has already been started using mpirun. 

1795 Please refer to HPC documentation for details on how to start this on your system. 

1796  

1797 Example : mpirun -n 3 -xterm 0 `which casa` 

1798  

1799 Continuum Imaging : 

1800 - Data are partitioned (in time) into NProc pieces 

1801 - Gridding/iFT is done separately per partition 

1802 - Images (and weights) are gathered and then normalized 

1803 - One non-parallel minor cycle is run 

1804 - Model image is scattered to all processes 

1805 - Major cycle is done in parallel per partition 

1806  

1807 Cube Imaging : 

1808 - Data and Image coordinates are partitioned (in freq) into NProc pieces 

1809 - Each partition is processed independently (major and minor cycles) 

1810 - All processes are synchronized at major cycle boundaries for convergence checks 

1811 - At the end, cubes from all partitions are concatenated along the spectral axis 

1812  

1813 Note 1 : Iteration control for cube imaging is independent per partition. 

1814 - There is currently no communication between them to synchronize 

1815 information such as peak residual and cyclethreshold. Therefore, 

1816 different chunks may trigger major cycles at different levels. 

1817 (Proper synchronization of iteration control is work in progress.) 

1818 RETURNS void 

1819 

1820 --------- examples ----------------------------------------------------------- 

1821 

1822  

1823  

1824 Please refer to the CASAdocs pages for the task tclean for examples. 

1825  

1826  

1827 

1828 

1829 """ 

1830 

1831 _info_group_ = """imaging""" 

1832 _info_desc_ = """Radio Interferometric Image Reconstruction""" 

1833 

1834 def __call__( self, vis='', selectdata=True, field='', spw='', timerange='', uvrange='', antenna='', scan='', observation='', intent='', datacolumn='corrected', imagename='', imsize=[ int(100) ], cell=[ ], phasecenter='', stokes='I', projection='SIN', startmodel='', specmode='mfs', reffreq='', nchan=int(-1), start='', width='', outframe='LSRK', veltype='radio', restfreq=[ ], interpolation='linear', perchanweightdensity=True, gridder='standard', facets=int(1), psfphasecenter='', wprojplanes=int(1), vptable='', mosweight=True, aterm=True, psterm=False, wbawp=True, conjbeams=False, cfcache='', usepointing=False, computepastep=float(360.0), rotatepastep=float(360.0), pointingoffsetsigdev=[ ], pblimit=float(0.2), normtype='flatnoise', deconvolver='hogbom', scales=[ ], nterms=int(2), smallscalebias=float(0.0), fusedthreshold=float(0.0), largestscale=int(-1), restoration=True, restoringbeam=[ ], pbcor=False, outlierfile='', weighting='natural', robust=float(0.5), noise='1.0Jy', npixels=int(0), uvtaper=[ '' ], niter=int(0), gain=float(0.1), threshold=float(0.0), nsigma=float(0.0), cycleniter=int(-1), cyclefactor=float(1.0), minpsffraction=float(0.05), maxpsffraction=float(0.8), interactive=False, nmajor=int(-1), fullsummary=False, usemask='user', mask='', pbmask=float(0.0), sidelobethreshold=float(3.0), noisethreshold=float(5.0), lownoisethreshold=float(1.5), negativethreshold=float(0.0), smoothfactor=float(1.0), minbeamfrac=float(0.3), cutthreshold=float(0.01), growiterations=int(75), dogrowprune=True, minpercentchange=float(-1.0), verbose=False, fastnoise=True, restart=True, savemodel='none', calcres=True, calcpsf=True, psfcutoff=float(0.35), parallel=False ): 

1835 schema = {'vis': {'anyof': [{'type': 'cReqPath', 'coerce': _coerce.expand_path}, {'type': 'cReqPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}]}, 'selectdata': {'type': 'cBool'}, 'field': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'spw': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'timerange': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'uvrange': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'antenna': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'scan': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'observation': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}]}, 'intent': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str}, 'imagename': {'anyof': [{'type': 'cInt'}, {'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'imsize': {'anyof': [{'type': 'cInt'}, {'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}]}, 'cell': {'anyof': [{'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, {'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cFloat', 'coerce': _coerce.to_float}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, {'type': 'cInt'}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'phasecenter': {'anyof': [{'type': 'cInt'}, {'type': 'cStr', 'coerce': _coerce.to_str}]}, 'stokes': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'I', 'IQUV', 'UV', 'RRLL', 'IQ', 'V', 'pseudoI', 'QU', 'YY', 'RR', 'Q', 'U', 'IV', 'XX', 'XXYY', 'LL' ]}, 'projection': {'type': 'cStr', 'coerce': _coerce.to_str}, 'startmodel': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'specmode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'cont', 'cubedata', 'cube', 'cubesource', 'mfs', 'mvc' ]}, 'reffreq': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'nchan': {'type': 'cInt'}, 'start': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'width': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'outframe': {'type': 'cStr', 'coerce': _coerce.to_str}, 'veltype': {'type': 'cStr', 'coerce': _coerce.to_str}, 'restfreq': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'interpolation': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'nearest', 'linear', 'cubic' ]}, 'perchanweightdensity': {'type': 'cBool'}, 'gridder': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'widefield', 'wproject', 'imagemosaic', 'standard', 'awproject', 'wprojectft', 'mosaicft', 'ft', 'ftmosaic', 'mosaic', 'awprojectft', 'gridft' ]}, 'facets': {'type': 'cInt'}, 'psfphasecenter': {'anyof': [{'type': 'cInt'}, {'type': 'cStr', 'coerce': _coerce.to_str}]}, 'wprojplanes': {'type': 'cInt'}, 'vptable': {'type': 'cStr', 'coerce': _coerce.to_str}, 'mosweight': {'type': 'cBool'}, 'aterm': {'type': 'cBool'}, 'psterm': {'type': 'cBool'}, 'wbawp': {'type': 'cBool'}, 'conjbeams': {'type': 'cBool'}, 'cfcache': {'type': 'cStr', 'coerce': _coerce.to_str}, 'usepointing': {'type': 'cBool'}, 'computepastep': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'rotatepastep': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'pointingoffsetsigdev': {'anyof': [{'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'pblimit': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'normtype': {'type': 'cStr', 'coerce': _coerce.to_str}, 'deconvolver': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'clarkstokes_exp', 'mtmfs', 'mem', 'clarkstokes', 'hogbom', 'clark_exp', 'clark', 'asp', 'multiscale' ]}, 'scales': {'anyof': [{'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'nterms': {'type': 'cInt'}, 'smallscalebias': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'fusedthreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'largestscale': {'type': 'cInt'}, 'restoration': {'type': 'cBool'}, 'restoringbeam': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'pbcor': {'type': 'cBool'}, 'outlierfile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'weighting': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'briggsabs', 'briggs', 'briggsbwtaper', 'natural', 'radial', 'superuniform', 'uniform' ]}, 'robust': {'type': 'cFloat', 'coerce': _coerce.to_float, 'min': -2.0, 'max': 2.0}, 'noise': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'npixels': {'type': 'cInt'}, 'uvtaper': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'niter': {'type': 'cInt'}, 'gain': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'threshold': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'nsigma': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'cycleniter': {'type': 'cInt'}, 'cyclefactor': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'minpsffraction': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'maxpsffraction': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'interactive': {'type': 'cBool'}, 'nmajor': {'type': 'cInt'}, 'fullsummary': {'type': 'cBool'}, 'usemask': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'user', 'pb', 'auto-multithresh' ]}, 'mask': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'pbmask': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'sidelobethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'noisethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'lownoisethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'negativethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'smoothfactor': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'minbeamfrac': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'cutthreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'growiterations': {'type': 'cInt'}, 'dogrowprune': {'type': 'cBool'}, 'minpercentchange': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'verbose': {'type': 'cBool'}, 'fastnoise': {'type': 'cBool'}, 'restart': {'type': 'cBool'}, 'savemodel': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'none', 'virtual', 'modelcolumn' ]}, 'calcres': {'type': 'cBool'}, 'calcpsf': {'type': 'cBool'}, 'psfcutoff': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'parallel': {'type': 'cBool'}} 

1836 doc = {'vis': vis, 'selectdata': selectdata, 'field': field, 'spw': spw, 'timerange': timerange, 'uvrange': uvrange, 'antenna': antenna, 'scan': scan, 'observation': observation, 'intent': intent, 'datacolumn': datacolumn, 'imagename': imagename, 'imsize': imsize, 'cell': cell, 'phasecenter': phasecenter, 'stokes': stokes, 'projection': projection, 'startmodel': startmodel, 'specmode': specmode, 'reffreq': reffreq, 'nchan': nchan, 'start': start, 'width': width, 'outframe': outframe, 'veltype': veltype, 'restfreq': restfreq, 'interpolation': interpolation, 'perchanweightdensity': perchanweightdensity, 'gridder': gridder, 'facets': facets, 'psfphasecenter': psfphasecenter, 'wprojplanes': wprojplanes, 'vptable': vptable, 'mosweight': mosweight, 'aterm': aterm, 'psterm': psterm, 'wbawp': wbawp, 'conjbeams': conjbeams, 'cfcache': cfcache, 'usepointing': usepointing, 'computepastep': computepastep, 'rotatepastep': rotatepastep, 'pointingoffsetsigdev': pointingoffsetsigdev, 'pblimit': pblimit, 'normtype': normtype, 'deconvolver': deconvolver, 'scales': scales, 'nterms': nterms, 'smallscalebias': smallscalebias, 'fusedthreshold': fusedthreshold, 'largestscale': largestscale, 'restoration': restoration, 'restoringbeam': restoringbeam, 'pbcor': pbcor, 'outlierfile': outlierfile, 'weighting': weighting, 'robust': robust, 'noise': noise, 'npixels': npixels, 'uvtaper': uvtaper, 'niter': niter, 'gain': gain, 'threshold': threshold, 'nsigma': nsigma, 'cycleniter': cycleniter, 'cyclefactor': cyclefactor, 'minpsffraction': minpsffraction, 'maxpsffraction': maxpsffraction, 'interactive': interactive, 'nmajor': nmajor, 'fullsummary': fullsummary, 'usemask': usemask, 'mask': mask, 'pbmask': pbmask, 'sidelobethreshold': sidelobethreshold, 'noisethreshold': noisethreshold, 'lownoisethreshold': lownoisethreshold, 'negativethreshold': negativethreshold, 'smoothfactor': smoothfactor, 'minbeamfrac': minbeamfrac, 'cutthreshold': cutthreshold, 'growiterations': growiterations, 'dogrowprune': dogrowprune, 'minpercentchange': minpercentchange, 'verbose': verbose, 'fastnoise': fastnoise, 'restart': restart, 'savemodel': savemodel, 'calcres': calcres, 'calcpsf': calcpsf, 'psfcutoff': psfcutoff, 'parallel': parallel} 

1837 assert _pc.validate(doc,schema), create_error_string(_pc.errors) 

1838 _logging_state_ = _start_log( 'tclean', [ 'vis=' + repr(_pc.document['vis']), 'selectdata=' + repr(_pc.document['selectdata']), 'field=' + repr(_pc.document['field']), 'spw=' + repr(_pc.document['spw']), 'timerange=' + repr(_pc.document['timerange']), 'uvrange=' + repr(_pc.document['uvrange']), 'antenna=' + repr(_pc.document['antenna']), 'scan=' + repr(_pc.document['scan']), 'observation=' + repr(_pc.document['observation']), 'intent=' + repr(_pc.document['intent']), 'datacolumn=' + repr(_pc.document['datacolumn']), 'imagename=' + repr(_pc.document['imagename']), 'imsize=' + repr(_pc.document['imsize']), 'cell=' + repr(_pc.document['cell']), 'phasecenter=' + repr(_pc.document['phasecenter']), 'stokes=' + repr(_pc.document['stokes']), 'projection=' + repr(_pc.document['projection']), 'startmodel=' + repr(_pc.document['startmodel']), 'specmode=' + repr(_pc.document['specmode']), 'reffreq=' + repr(_pc.document['reffreq']), 'nchan=' + repr(_pc.document['nchan']), 'start=' + repr(_pc.document['start']), 'width=' + repr(_pc.document['width']), 'outframe=' + repr(_pc.document['outframe']), 'veltype=' + repr(_pc.document['veltype']), 'restfreq=' + repr(_pc.document['restfreq']), 'interpolation=' + repr(_pc.document['interpolation']), 'perchanweightdensity=' + repr(_pc.document['perchanweightdensity']), 'gridder=' + repr(_pc.document['gridder']), 'facets=' + repr(_pc.document['facets']), 'psfphasecenter=' + repr(_pc.document['psfphasecenter']), 'wprojplanes=' + repr(_pc.document['wprojplanes']), 'vptable=' + repr(_pc.document['vptable']), 'mosweight=' + repr(_pc.document['mosweight']), 'aterm=' + repr(_pc.document['aterm']), 'psterm=' + repr(_pc.document['psterm']), 'wbawp=' + repr(_pc.document['wbawp']), 'conjbeams=' + repr(_pc.document['conjbeams']), 'cfcache=' + repr(_pc.document['cfcache']), 'usepointing=' + repr(_pc.document['usepointing']), 'computepastep=' + repr(_pc.document['computepastep']), 'rotatepastep=' + repr(_pc.document['rotatepastep']), 'pointingoffsetsigdev=' + repr(_pc.document['pointingoffsetsigdev']), 'pblimit=' + repr(_pc.document['pblimit']), 'normtype=' + repr(_pc.document['normtype']), 'deconvolver=' + repr(_pc.document['deconvolver']), 'scales=' + repr(_pc.document['scales']), 'nterms=' + repr(_pc.document['nterms']), 'smallscalebias=' + repr(_pc.document['smallscalebias']), 'fusedthreshold=' + repr(_pc.document['fusedthreshold']), 'largestscale=' + repr(_pc.document['largestscale']), 'restoration=' + repr(_pc.document['restoration']), 'restoringbeam=' + repr(_pc.document['restoringbeam']), 'pbcor=' + repr(_pc.document['pbcor']), 'outlierfile=' + repr(_pc.document['outlierfile']), 'weighting=' + repr(_pc.document['weighting']), 'robust=' + repr(_pc.document['robust']), 'noise=' + repr(_pc.document['noise']), 'npixels=' + repr(_pc.document['npixels']), 'uvtaper=' + repr(_pc.document['uvtaper']), 'niter=' + repr(_pc.document['niter']), 'gain=' + repr(_pc.document['gain']), 'threshold=' + repr(_pc.document['threshold']), 'nsigma=' + repr(_pc.document['nsigma']), 'cycleniter=' + repr(_pc.document['cycleniter']), 'cyclefactor=' + repr(_pc.document['cyclefactor']), 'minpsffraction=' + repr(_pc.document['minpsffraction']), 'maxpsffraction=' + repr(_pc.document['maxpsffraction']), 'interactive=' + repr(_pc.document['interactive']), 'nmajor=' + repr(_pc.document['nmajor']), 'fullsummary=' + repr(_pc.document['fullsummary']), 'usemask=' + repr(_pc.document['usemask']), 'mask=' + repr(_pc.document['mask']), 'pbmask=' + repr(_pc.document['pbmask']), 'sidelobethreshold=' + repr(_pc.document['sidelobethreshold']), 'noisethreshold=' + repr(_pc.document['noisethreshold']), 'lownoisethreshold=' + repr(_pc.document['lownoisethreshold']), 'negativethreshold=' + repr(_pc.document['negativethreshold']), 'smoothfactor=' + repr(_pc.document['smoothfactor']), 'minbeamfrac=' + repr(_pc.document['minbeamfrac']), 'cutthreshold=' + repr(_pc.document['cutthreshold']), 'growiterations=' + repr(_pc.document['growiterations']), 'dogrowprune=' + repr(_pc.document['dogrowprune']), 'minpercentchange=' + repr(_pc.document['minpercentchange']), 'verbose=' + repr(_pc.document['verbose']), 'fastnoise=' + repr(_pc.document['fastnoise']), 'restart=' + repr(_pc.document['restart']), 'savemodel=' + repr(_pc.document['savemodel']), 'calcres=' + repr(_pc.document['calcres']), 'calcpsf=' + repr(_pc.document['calcpsf']), 'psfcutoff=' + repr(_pc.document['psfcutoff']), 'parallel=' + repr(_pc.document['parallel']) ] ) 

1839 task_result = None 

1840 try: 

1841 task_result = _tclean_t( _pc.document['vis'], _pc.document['selectdata'], _pc.document['field'], _pc.document['spw'], _pc.document['timerange'], _pc.document['uvrange'], _pc.document['antenna'], _pc.document['scan'], _pc.document['observation'], _pc.document['intent'], _pc.document['datacolumn'], _pc.document['imagename'], _pc.document['imsize'], _pc.document['cell'], _pc.document['phasecenter'], _pc.document['stokes'], _pc.document['projection'], _pc.document['startmodel'], _pc.document['specmode'], _pc.document['reffreq'], _pc.document['nchan'], _pc.document['start'], _pc.document['width'], _pc.document['outframe'], _pc.document['veltype'], _pc.document['restfreq'], _pc.document['interpolation'], _pc.document['perchanweightdensity'], _pc.document['gridder'], _pc.document['facets'], _pc.document['psfphasecenter'], _pc.document['wprojplanes'], _pc.document['vptable'], _pc.document['mosweight'], _pc.document['aterm'], _pc.document['psterm'], _pc.document['wbawp'], _pc.document['conjbeams'], _pc.document['cfcache'], _pc.document['usepointing'], _pc.document['computepastep'], _pc.document['rotatepastep'], _pc.document['pointingoffsetsigdev'], _pc.document['pblimit'], _pc.document['normtype'], _pc.document['deconvolver'], _pc.document['scales'], _pc.document['nterms'], _pc.document['smallscalebias'], _pc.document['fusedthreshold'], _pc.document['largestscale'], _pc.document['restoration'], _pc.document['restoringbeam'], _pc.document['pbcor'], _pc.document['outlierfile'], _pc.document['weighting'], _pc.document['robust'], _pc.document['noise'], _pc.document['npixels'], _pc.document['uvtaper'], _pc.document['niter'], _pc.document['gain'], _pc.document['threshold'], _pc.document['nsigma'], _pc.document['cycleniter'], _pc.document['cyclefactor'], _pc.document['minpsffraction'], _pc.document['maxpsffraction'], _pc.document['interactive'], _pc.document['nmajor'], _pc.document['fullsummary'], _pc.document['usemask'], _pc.document['mask'], _pc.document['pbmask'], _pc.document['sidelobethreshold'], _pc.document['noisethreshold'], _pc.document['lownoisethreshold'], _pc.document['negativethreshold'], _pc.document['smoothfactor'], _pc.document['minbeamfrac'], _pc.document['cutthreshold'], _pc.document['growiterations'], _pc.document['dogrowprune'], _pc.document['minpercentchange'], _pc.document['verbose'], _pc.document['fastnoise'], _pc.document['restart'], _pc.document['savemodel'], _pc.document['calcres'], _pc.document['calcpsf'], _pc.document['psfcutoff'], _pc.document['parallel'] ) 

1842 except Exception as exc: 

1843 _except_log('tclean', exc) 

1844 raise 

1845 finally: 

1846 task_result = _end_log( _logging_state_, 'tclean', task_result ) 

1847 return task_result 

1848 

1849tclean = _tclean( ) 

1850