cubevis 0.5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. cubevis/LICENSE.rst +500 -0
  2. cubevis/__icons__/20px/fast-backward.svg +13 -0
  3. cubevis/__icons__/20px/fast-forward.svg +13 -0
  4. cubevis/__icons__/20px/step-backward.svg +12 -0
  5. cubevis/__icons__/20px/step-forward.svg +12 -0
  6. cubevis/__icons__/add-chan.png +0 -0
  7. cubevis/__icons__/add-chan.svg +84 -0
  8. cubevis/__icons__/add-cube.png +0 -0
  9. cubevis/__icons__/add-cube.svg +186 -0
  10. cubevis/__icons__/drag.png +0 -0
  11. cubevis/__icons__/drag.svg +109 -0
  12. cubevis/__icons__/mask-selected.png +0 -0
  13. cubevis/__icons__/mask.png +0 -0
  14. cubevis/__icons__/mask.svg +1 -0
  15. cubevis/__icons__/new-layer-sm-selected.png +0 -0
  16. cubevis/__icons__/new-layer-sm-selected.svg +88 -0
  17. cubevis/__icons__/new-layer-sm.png +0 -0
  18. cubevis/__icons__/new-layer-sm.svg +15 -0
  19. cubevis/__icons__/reset.png +0 -0
  20. cubevis/__icons__/reset.svg +11 -0
  21. cubevis/__icons__/sub-chan.png +0 -0
  22. cubevis/__icons__/sub-chan.svg +71 -0
  23. cubevis/__icons__/sub-cube.png +0 -0
  24. cubevis/__icons__/sub-cube.svg +95 -0
  25. cubevis/__icons__/zoom-to-fit.png +0 -0
  26. cubevis/__icons__/zoom-to-fit.svg +21 -0
  27. cubevis/__init__.py +58 -0
  28. cubevis/__js__/bokeh-3.6.1.min.js +728 -0
  29. cubevis/__js__/bokeh-tables-3.6.1.min.js +119 -0
  30. cubevis/__js__/bokeh-widgets-3.6.1.min.js +141 -0
  31. cubevis/__js__/casalib.min.js +1 -0
  32. cubevis/__js__/cubevisjs.min.js +62 -0
  33. cubevis/__version__.py +1 -0
  34. cubevis/apps/__init__.py +44 -0
  35. cubevis/apps/_createmask.py +461 -0
  36. cubevis/apps/_createregion.py +513 -0
  37. cubevis/apps/_interactiveclean.py +3260 -0
  38. cubevis/apps/_interactiveclean_wrappers.py +130 -0
  39. cubevis/apps/_ms_raster.py +815 -0
  40. cubevis/apps/_plotants.py +286 -0
  41. cubevis/apps/_plotbandpass.py +7 -0
  42. cubevis/bokeh/__init__.py +29 -0
  43. cubevis/bokeh/annotations/__init__.py +1 -0
  44. cubevis/bokeh/annotations/_ev_poly_annotation.py +6 -0
  45. cubevis/bokeh/components/__init__.py +28 -0
  46. cubevis/bokeh/format/__init__.py +31 -0
  47. cubevis/bokeh/format/_time_ticks.py +44 -0
  48. cubevis/bokeh/format/_wcs_ticks.py +45 -0
  49. cubevis/bokeh/models/__init__.py +4 -0
  50. cubevis/bokeh/models/_edit_span.py +7 -0
  51. cubevis/bokeh/models/_ev_text_input.py +6 -0
  52. cubevis/bokeh/models/_tip.py +37 -0
  53. cubevis/bokeh/models/_tip_button.py +50 -0
  54. cubevis/bokeh/sources/__init__.py +35 -0
  55. cubevis/bokeh/sources/_data_pipe.py +258 -0
  56. cubevis/bokeh/sources/_image_data_source.py +83 -0
  57. cubevis/bokeh/sources/_image_pipe.py +581 -0
  58. cubevis/bokeh/sources/_spectra_data_source.py +55 -0
  59. cubevis/bokeh/sources/_updatable_data_source.py +189 -0
  60. cubevis/bokeh/state/__init__.py +34 -0
  61. cubevis/bokeh/state/_initialize.py +164 -0
  62. cubevis/bokeh/state/_javascript.py +53 -0
  63. cubevis/bokeh/state/_palette.py +58 -0
  64. cubevis/bokeh/state/_session.py +44 -0
  65. cubevis/bokeh/state/js/bokeh-2.4.1.min.js +596 -0
  66. cubevis/bokeh/state/js/bokeh-gl-2.4.1.min.js +74 -0
  67. cubevis/bokeh/state/js/bokeh-tables-2.4.1.min.js +132 -0
  68. cubevis/bokeh/state/js/bokeh-widgets-2.4.1.min.js +118 -0
  69. cubevis/bokeh/state/js/casaguijs-v0.0.4.0-b2.4.min.js +49 -0
  70. cubevis/bokeh/state/js/casaguijs-v0.0.5.0-b2.4.min.js +49 -0
  71. cubevis/bokeh/state/js/casaguijs-v0.0.6.0-b2.4.min.js +49 -0
  72. cubevis/bokeh/state/js/casalib-v0.0.1.min.js +1 -0
  73. cubevis/bokeh/tools/__init__.py +31 -0
  74. cubevis/bokeh/tools/_cbreset_tool.py +52 -0
  75. cubevis/bokeh/tools/_drag_tool.py +61 -0
  76. cubevis/bokeh/utils/__init__.py +35 -0
  77. cubevis/bokeh/utils/_axes_labels.py +94 -0
  78. cubevis/bokeh/utils/_svg_icon.py +136 -0
  79. cubevis/data/__init__.py +1 -0
  80. cubevis/data/casaimage/__init__.py +114 -0
  81. cubevis/data/measurement_set/__init__.py +7 -0
  82. cubevis/data/measurement_set/_ms_data.py +178 -0
  83. cubevis/data/measurement_set/processing_set/__init__.py +30 -0
  84. cubevis/data/measurement_set/processing_set/_ps_concat.py +98 -0
  85. cubevis/data/measurement_set/processing_set/_ps_coords.py +78 -0
  86. cubevis/data/measurement_set/processing_set/_ps_data.py +213 -0
  87. cubevis/data/measurement_set/processing_set/_ps_io.py +55 -0
  88. cubevis/data/measurement_set/processing_set/_ps_raster_data.py +154 -0
  89. cubevis/data/measurement_set/processing_set/_ps_select.py +91 -0
  90. cubevis/data/measurement_set/processing_set/_ps_stats.py +218 -0
  91. cubevis/data/measurement_set/processing_set/_xds_data.py +149 -0
  92. cubevis/plot/__init__.py +1 -0
  93. cubevis/plot/ms_plot/__init__.py +29 -0
  94. cubevis/plot/ms_plot/_ms_plot.py +242 -0
  95. cubevis/plot/ms_plot/_ms_plot_constants.py +22 -0
  96. cubevis/plot/ms_plot/_ms_plot_selectors.py +348 -0
  97. cubevis/plot/ms_plot/_raster_plot.py +292 -0
  98. cubevis/plot/ms_plot/_raster_plot_inputs.py +116 -0
  99. cubevis/plot/ms_plot/_xds_plot_axes.py +110 -0
  100. cubevis/private/__java__/xml-casa-assembly-1.86.jar +0 -0
  101. cubevis/private/_gclean.py +798 -0
  102. cubevis/private/casashell/createmask.py +332 -0
  103. cubevis/private/casashell/iclean.py +4432 -0
  104. cubevis/private/casatasks/__init__.py +140 -0
  105. cubevis/private/casatasks/createmask.py +86 -0
  106. cubevis/private/casatasks/createregion.py +83 -0
  107. cubevis/private/casatasks/iclean.py +1831 -0
  108. cubevis/readme.rst +16 -0
  109. cubevis/remote/__init__.py +10 -0
  110. cubevis/remote/_gclean.py +61 -0
  111. cubevis/remote/_local.py +287 -0
  112. cubevis/remote/_remote_kernel.py +80 -0
  113. cubevis/toolbox/__init__.py +32 -0
  114. cubevis/toolbox/_app_context.py +74 -0
  115. cubevis/toolbox/_cube.py +3457 -0
  116. cubevis/toolbox/_region_list.py +197 -0
  117. cubevis/utils/_ResourceManager.py +86 -0
  118. cubevis/utils/__init__.py +620 -0
  119. cubevis/utils/_contextmgrchain.py +84 -0
  120. cubevis/utils/_conversion.py +93 -0
  121. cubevis/utils/_copydoc.py +55 -0
  122. cubevis/utils/_docenum.py +25 -0
  123. cubevis/utils/_import_protected_module.py +35 -0
  124. cubevis/utils/_logging.py +85 -0
  125. cubevis/utils/_pkgs.py +77 -0
  126. cubevis/utils/_regions.py +40 -0
  127. cubevis/utils/_static.py +66 -0
  128. cubevis/utils/_tiles.py +167 -0
  129. cubevis-0.5.2.dist-info/METADATA +151 -0
  130. cubevis-0.5.2.dist-info/RECORD +132 -0
  131. cubevis-0.5.2.dist-info/WHEEL +4 -0
  132. cubevis-0.5.2.dist-info/licenses/LICENSE +504 -0
@@ -0,0 +1,4432 @@
1
+ ########################################################################
2
+ #
3
+ # Copyright (C) 2024
4
+ # Associated Universities, Inc. Washington DC, USA.
5
+ #
6
+ # This script is free software; you can redistribute it and/or modify it
7
+ # under the terms of the GNU Library General Public License as published by
8
+ # the Free Software Foundation; either version 2 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This library is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
+ # License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Library General Public License
17
+ # along with this library; if not, write to the Free Software Foundation,
18
+ # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19
+ #
20
+ # Correspondence concerning AIPS++ should be adressed as follows:
21
+ # Internet email: casa-feedback@nrao.edu.
22
+ # Postal address: AIPS++ Project Office
23
+ # National Radio Astronomy Observatory
24
+ # 520 Edgemont Road
25
+ # Charlottesville, VA 22903-2475 USA
26
+ #
27
+ ########################################################################
28
+ ##################### generated by xml-casa (v2) from tclean.xml
29
+ ##################### 214e4c0dbbbeb35a4a041ccbbea77d9a ##############################
30
+ from __future__ import absolute_import
31
+ from casashell.private.stack_manip import find_local as __sf__
32
+ from casashell.private.stack_manip import find_frame as _find_frame
33
+ from casatools.typecheck import validator as _pc
34
+ from casatools.coercetype import coerce as _coerce
35
+ from casatools.errors import create_error_string
36
+ from casatasks.private.task_logging import start_log as _start_log
37
+ from casatasks.private.task_logging import end_log as _end_log
38
+ from cubevis.apps import InteractiveClean
39
+ from collections import OrderedDict
40
+ import numpy
41
+ import sys
42
+ import os
43
+
44
+ import shutil
45
+
46
+ def static_var(varname, value):
47
+ def decorate(func):
48
+ setattr(func, varname, value)
49
+ return func
50
+ return decorate
51
+
52
+
53
+ def _iclean_t( *args, **kwargs ):
54
+ ic = InteractiveClean( *args, **kwargs )
55
+ return ic( )
56
+
57
+
58
+ class _iclean:
59
+ """
60
+ tclean ---- Radio Interferometric Image Reconstruction
61
+
62
+ Form images from visibilities and reconstruct a sky model.
63
+ This task handles continuum images and spectral line cubes,
64
+ supports outlier fields, contains standard clean based algorithms
65
+ along with algorithms for multi-scale and wideband image
66
+ reconstruction, widefield imaging correcting for the w-term,
67
+ full primary-beam imaging and joint mosaic imaging (with
68
+ heterogeneous array support for ALMA).
69
+
70
+ --------- parameter descriptions ---------------------------------------------
71
+
72
+ vis Name(s) of input visibility file(s)
73
+ default: none;
74
+ example: vis='ngc5921.ms'
75
+ vis=['ngc5921a.ms','ngc5921b.ms']; multiple MSs
76
+ selectdata Enable data selection parameters.
77
+ field to image or mosaic. Use field id(s) or name(s).
78
+ ['go listobs' to obtain the list id's or names]
79
+ default: ''= all fields.
80
+ If field string is a non-negative integer, it is assumed to
81
+ be a field index, otherwise it is assumed to be a
82
+ field name.
83
+ field='0~2'; field ids 0,1,2.
84
+ field='0,4,5~7'; field ids 0,4,5,6,7.
85
+ field='3C286,3C295'; field names 3C286 and 3C295.
86
+ field = '3,4C\*'; field id 3, all names starting with 4C.
87
+ For multiple MS input, a list of field strings can be used:
88
+ field = ['0~2','0~4']; field ids 0-2 for the first MS and 0-4
89
+ for the second.
90
+ field = '0~2'; field ids 0-2 for all input MSs.
91
+ spw l window/channels.
92
+ NOTE: channels not selected here will contain all zeros if
93
+ selected by other subparameters.
94
+ default: ''=all spectral windows and channels.
95
+ spw='0~2,4'; spectral windows 0,1,2,4 (all channels).
96
+ spw='0:5~61'; spw 0, channels 5 to 61.
97
+ spw='<2'; spectral windows less than 2 (i.e. 0,1).
98
+ spw='0,10,3:3~45'; spw 0,10 all channels, and spw 3
99
+ channels 3 to 45.
100
+ spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each.
101
+ For multiple MS input, a list of spw strings can be used:
102
+ spw=['0','0~3']; spw ids 0 for the first MS and 0-3 for the second.
103
+ spw='0~3' spw ids 0-3 for all input MS.
104
+ spw='3:10~20;50~60' for multiple channel ranges within spw id 3.
105
+ spw='3:10~20;50~60,4:0~30' for different channel ranges for spw ids 3 and 4.
106
+ spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10,
107
+ spw 1, channels 20-30, and spw 2, channels, 1,2 and 3.
108
+ spw='1~4;6:15~48' for channels 15 through 48 for spw ids 1,2,3,4 and 6.
109
+ timerange Range of time to select from data
110
+
111
+ default: '' (all); examples,
112
+ timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss'
113
+ Note: if YYYY/MM/DD is missing date defaults to first
114
+ day in data set.
115
+ timerange='09:14:0~09:54:0' picks 40 min on first day.
116
+ timerange='25:00:00~27:30:00' picks 1 hr to 3 hr
117
+ 30min on NEXT day.
118
+ timerange='09:44:00' pick data within one integration
119
+ of time.
120
+ timerange='> 10:24:00' data after this time.
121
+ For multiple MS input, a list of timerange strings can be
122
+ used:
123
+ timerange=['09:14:0~09:54:0','> 10:24:00'].
124
+ timerange='09:14:0~09:54:0''; apply the same timerange for
125
+ all input MSs.
126
+ uvrange Select data within uvrange (default unit is meters)
127
+ default: '' (all); example:
128
+ uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda.
129
+ uvrange='> 4klambda';uvranges greater than 4 kilo lambda.
130
+ For multiple MS input, a list of uvrange strings can be
131
+ used:
132
+ uvrange=['0~1000klambda','100~1000klamda'].
133
+ uvrange='0~1000klambda'; apply 0-1000 kilo-lambda for all
134
+ input MSs.
135
+ uvrange='0~1000'; apply 0-1000 meter for all input MSs.
136
+ antenna Select data based on antenna/baseline
137
+
138
+ default: '' (all)
139
+ If antenna string is a non-negative integer, it is
140
+ assumed to be an antenna index, otherwise, it is
141
+ considered an antenna name.
142
+ antenna='5\&6'; baseline between antenna index 5 and
143
+ index 6.
144
+ antenna='VA05\&VA06'; baseline between VLA antenna 5
145
+ and 6.
146
+ antenna='5\&6;7\&8'; baselines 5-6 and 7-8.
147
+ antenna='5'; all baselines with antenna index 5.
148
+ antenna='05'; all baselines with antenna number 05
149
+ (VLA old name).
150
+ antenna='5,6,9'; all baselines with antennas 5,6,9
151
+ index number.
152
+ For multiple MS input, a list of antenna strings can be
153
+ used:
154
+ antenna=['5','5\&6'];
155
+ antenna='5'; antenna index 5 for all input MSs.
156
+ antenna='!DV14'; use all antennas except DV14.
157
+ scan Scan number range
158
+
159
+ default: '' (all).
160
+ example: scan='1~5'.
161
+ For multiple MS input, a list of scan strings can be used:
162
+ scan=['0~100','10~200'].
163
+ scan='0~100; scan ids 0-100 for all input MSs.
164
+ observation Observation ID range
165
+ default: '' (all).
166
+ example: observation='1~5'.
167
+ intent Scan Intent(s)
168
+
169
+ default: '' (all).
170
+ example: intent='TARGET_SOURCE'.
171
+ example: intent='TARGET_SOURCE1,TARGET_SOURCE2'.
172
+ example: intent='TARGET_POINTING\*'.
173
+ datacolumn Data column to image (data or observed, corrected)
174
+ default:'corrected'
175
+ ( If 'corrected' does not exist, it will use 'data' instead )
176
+ imagename Pre-name of output images
177
+
178
+ example : imagename='try'
179
+
180
+ Output images will be (a subset of) :
181
+
182
+ try.psf - Point Spread Function (PSF).
183
+ try.residual - Residual image.
184
+ try.image - Restored image.
185
+ try.model - Model image (contains only flux components).
186
+ try.sumwt - Single pixel image containing sum-of-weights.
187
+ (for natural weighting, sensitivity=1/sqrt(sumwt)).
188
+ try.pb - Primary Beam (PB) model (values depend on the gridder used).
189
+
190
+ A-projection algorithms (gridder=mosaic,awproject, awp2) will
191
+ compute the following images too.
192
+
193
+ try.weight - FT of gridded weights or the
194
+ un-normalized sum of PB-square (for all pointings).
195
+ Here, PB = sqrt(weight) normalized to a maximum of 1.0.
196
+
197
+ For multi-term wideband imaging, all relevant images above will
198
+ have additional .tt0,.tt1, etc suffixes to indicate Taylor terms,
199
+ plus the following extra output images.
200
+ try.alpha - spectral index.
201
+ try.alpha.error - estimate of error on spectral index.
202
+ try.beta - spectral curvature (if nterms \> 2).
203
+
204
+ Tip : Include a directory name in 'imagename' for all
205
+ output images to be sent there instead of the
206
+ current working directory : imagename='mydir/try'.
207
+
208
+ Tip : Restarting an imaging run without changing 'imagename'
209
+ implies continuation from the existing model image on disk.
210
+ - If 'startmodel' was initially specified it needs to be set to ""
211
+ for the restart run (or tclean will exit with an error message).
212
+ - By default, the residual image and psf will be recomputed
213
+ but if no changes were made to relevant parameters between
214
+ the runs, set calcres=False, calcpsf=False to resume directly from
215
+ the minor cycle without the (unnecessary) first major cycle.
216
+ To automatically change 'imagename' with a numerical
217
+ increment, set restart=False (see tclean docs for 'restart').
218
+
219
+ Note : All imaging runs will by default produce restored images.
220
+ For a niter=0 run, this will be redundant and can optionally
221
+ be turned off via the 'restoration=T/F' parameter.
222
+ imsize Number of pixels
223
+ example:
224
+
225
+ imsize = [350,250].
226
+ imsize = 500 is equivalent to [500,500].
227
+
228
+ To take proper advantage of internal optimized FFT routines, the
229
+ number of pixels must be even and factorizable by 2,3,5 only.
230
+ To find the nearest optimal imsize to that desired by the user, please use the following tool method:
231
+
232
+ from casatools import synthesisutils
233
+ su = synthesisutils()
234
+ su.getOptimumSize(345)
235
+ Output : 360
236
+ cell Cell size
237
+ example: cell=['0.5arcsec,'0.5arcsec'] or
238
+ cell=['1arcmin', '1arcmin'].
239
+ cell = '1arcsec' is equivalent to ['1arcsec','1arcsec'].
240
+ 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.
241
+
242
+ Note : If unspecified, tclean will use the phase-center from the first data field of the MS (or list of MSs) selected for imaging.
243
+
244
+ example: phasecenter='6'.
245
+ phasecenter='J2000 19h30m00 -40d00m00'.
246
+ phasecenter='J2000 292.5deg -40.0deg'.
247
+ phasecenter='J2000 5.105rad -0.698rad'.
248
+ phasecenter='ICRS 13:05:27.2780 -049.28.04.458'.
249
+ phasecenter='myComet_ephem.tab'.
250
+ phasecenter='MOON'.
251
+ phasecenter='TRACKFIELD'.
252
+ stokes Stokes Planes to make
253
+ default='I'; example: stokes='IQUV';
254
+ Options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY','pseudoI'
255
+
256
+ Note : Due to current internal code constraints, if any correlation pair
257
+ is flagged, by default, no data for that row in the MS will be used.
258
+ So, in an MS with XX,YY, if only YY is flagged, neither a
259
+ Stokes I image nor an XX image can be made from those data points.
260
+ In such a situation, please split out only the unflagged correlation into
261
+ a separate MS, or use the option 'pseudoI'.
262
+
263
+ Note : The 'pseudoI' option is a partial solution, allowing Stokes I imaging
264
+ when either of the parallel-hand correlations are unflagged.
265
+
266
+ The remaining constraints shall be removed (where logical) in a future release.
267
+ projection Coordinate projection
268
+ Examples : SIN, NCP.
269
+ A list of supported (but untested) projections can be found here :
270
+ http://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1Projection.html#a3d5f9ec787e4eabdce57ab5edaf7c0cd
271
+ startmodel Name of starting model image
272
+
273
+ The contents of the supplied starting model image will be
274
+ copied to the imagename.model before the run begins.
275
+
276
+ example : startmodel = 'singledish.im'.
277
+
278
+ For deconvolver='mtmfs', one image per Taylor term must be provided.
279
+ example : startmodel = ['try.model.tt0', 'try.model.tt1'].
280
+ startmodel = ['try.model.tt0'] will use a starting model only
281
+ for the zeroth order term.
282
+ startmodel = ['','try.model.tt1'] will use a starting model only
283
+ for the first order term.
284
+
285
+ This starting model can be of a different image shape and size from
286
+ what is currently being imaged. If so, an image regrid is first triggered
287
+ to resample the input image onto the target coordinate system.
288
+
289
+ A common usage is to set this parameter equal to a single dish image.
290
+
291
+ Negative components in the model image will be included as is.
292
+
293
+ Note : If an error occurs during image resampling/regridding,
294
+ please try using task imregrid to resample the starting model
295
+ image onto a CASA image with the target shape and
296
+ coordinate system before supplying it via startmodel.
297
+ specmode Spectral definition mode (mfs,cube,cubedata, cubesource, mvc)
298
+
299
+ specmode='mfs' : Continuum imaging with only one output image channel.
300
+ (mode='cont' can also be used here)
301
+
302
+ specmode='cube' : Spectral line imaging with one or more channels.
303
+ Parameters start, width,and nchan define the spectral
304
+ coordinate system and can be specified either in terms
305
+ of channel numbers, frequency or velocity in whatever
306
+ spectral frame is specified in 'outframe'.
307
+ All internal and output images are made with outframe as the
308
+ base spectral frame. However imaging code internally uses the fixed
309
+ spectral frame, LSRK for automatic internal software
310
+ Doppler correction, so that a spectral line observed over an
311
+ extended time range will line up appropriately.
312
+ Therefore the output images have additional spectral frame conversion
313
+ layer in LSRK on the top the base frame.
314
+
315
+
316
+
317
+
318
+ specmode='cubedata' : Spectral line imaging with one or more channels.
319
+ There is no internal software Doppler correction, so
320
+ a spectral line observed over an extended time range
321
+ may be smeared out in frequency. There is strictly
322
+ no valid spectral frame with which to associate with the
323
+ output images, thus the image spectral frame will
324
+ be labelled "Undefined".
325
+
326
+
327
+ specmode='cubesource': Spectral line imaging while
328
+ tracking moving source (near field or solar system
329
+ objects). The velocity of the source is accounted
330
+ and the frequency reported is in the source frame.
331
+ As there is no "SOURCE" frame defined in CASA,
332
+ the frame in the image will be labelled "REST" (but do note the
333
+ velocity of a given line reported may be different from the rest frame
334
+ velocity if the emission region is moving w.r.t the systemic
335
+ velocity frame of the source).
336
+
337
+ specmode='mvc' : Multiterm continuum imaging with cube major cycles.
338
+ This mode requires deconvolver='mtmfs' with nterms>1
339
+ and user-set choices of 'reffreq' and 'nchan'.
340
+
341
+ The output images and minor cycle are similar to specmode='mfs'
342
+ with deconvolver='mtmfs', but the major cycles are done in
343
+ cube mode (and require a setting of 'reffreq' and 'nchan').
344
+ By default, frequency-dependent primary beam correction is
345
+ applied to each channel, before being combined across frequency
346
+ to make the inputs to the 'mtmfs' deconvolver. This results in
347
+ implicit wideband pb-correction, with the deconvolver seeing only
348
+ the sky spectral structure.
349
+
350
+ Note : There is currently no option to turn off wideband pb correction
351
+ as part of the flat-sky normalization between the major and minor cycles.
352
+ Therefore, 'mvc' with the 'standard' and 'wproject' gridders will also apply
353
+ pblimits per channel, masking all regions outside of pblimit.
354
+ An option to retain sources outside the pblimit will be added in a future release.
355
+
356
+ Note : Below is some guidance for choosing 'nchan' and 'reffreq' :
357
+
358
+ The cube produced by the major cycle is used in a linear least square fits for Taylor
359
+ polynomials per pixel. Therefore, one only needs as many channels in the cube, as
360
+ required for an accurate polynomial fit for sources that have the strongest
361
+ spectral structure.
362
+
363
+ In general, 'nchan' needs to be greater than or equal to 'nterms', and the
364
+ frequency range selected by the data will be evenly split into nchan channels.
365
+ For a low-order polynomial fit, only a small number (around 10)
366
+ channels are typically needed (for VLA/ALMA bandwidth ratios).
367
+ 'nchan=-1' applies a heuristic that results in a default of 10 cube channels
368
+ for a 2:1 bandwidth ratio.
369
+
370
+ nchan = MAX( bandwidth/(0.1*startfreq) , nterms+1 )
371
+
372
+ Note: When running in parallel, the nchan selected may limit the speedup if it
373
+ is smaller than the number of processes used.
374
+
375
+ The 'reffreq' is the reference frequency used for the Taylor polynomial expansion.
376
+ By default, in specmode='mvc', reffreq is set to the middle of the selected
377
+ frequency range.
378
+ reffreq Reference frequency of the output image coordinate system.
379
+
380
+ Example : reffreq='1.5GHz' as a string with units.
381
+
382
+ By default, it is calculated as the middle of the selected frequency range.
383
+
384
+ For deconvolver='mtmfs' the Taylor expansion is also done about
385
+ this specified reference frequency.
386
+ nchan Number of channels in the output image.
387
+ For default (=-1), the number of channels will be automatically determined
388
+ based on data selected by 'spw' with 'start' and 'width'.
389
+ It is often easiest to leave nchan at the default value.
390
+ example: nchan=100
391
+ start First channel (e.g. start=3,start=\'1.1GHz\',start=\'15343km/s\')
392
+ of output cube images specified by data channel number (integer),
393
+ velocity (string with a unit), or frequency (string with a unit).
394
+ Default:''; The first channel is automatically determined based on
395
+ the 'spw' channel selection and 'width'.
396
+ channels in 'spw'.
397
+ Since the integer number in 'start' represents the data channel number,
398
+ when the channel number is used along with the spectral window id selection
399
+ in 'spw', 'start' specified as an integer should be carefully set otherwise
400
+ it may result in the blank image channels if the 'start' channel (i.e. absolute
401
+ channel number) is outside of the channel range specified in 'spw'.
402
+ In such a case, 'start' can be left as a default (='') to ensure
403
+ matching with the data spectral channel selection.
404
+ For specmode='cube', when velocity or frequency is used it is
405
+ interpreted with the frame defined in outframe. [The parameters of
406
+ the desired output cube can be estimated by using the 'transform'
407
+ functionality of 'plotms'].
408
+ examples: start='5.0km/s'; 1st channel, 5.0km/s in outframe.
409
+ start='22.3GHz'; 1st channel, 22.3GHz in outframe.
410
+ width Channel width (e.g. width=2,width=\'0.1MHz\',width=\'10km/s\') of output cube images
411
+ specified by data channel number (integer), velocity (string with a unit), or
412
+ or frequency (string with a unit).
413
+ Default:''; data channel width.
414
+ The sign of width defines the direction of the channels to be incremented.
415
+ For width specified in velocity or frequency with '-' in front gives image channels in
416
+ decreasing velocity or frequency, respectively.
417
+ For specmode='cube', when velocity or frequency is used it is interpreted with
418
+ the reference frame defined in outframe.
419
+ examples: width='2.0km/s'; results in channels with increasing velocity.
420
+ width='-2.0km/s'; results in channels with decreasing velocity.
421
+ width='40kHz'; results in channels with increasing frequency.
422
+ width=-2; results in channels averaged of 2 data channels incremented from
423
+ high to low channel numbers.
424
+ outframe Spectral reference frame in which to interpret \'start\' and \'width\'
425
+ Options: '','LSRK','LSRD','BARY','GEO','TOPO','GALACTO','LGROUP','CMB'
426
+ example: outframe='bary' for Barycentric frame.
427
+
428
+ REST -- Rest frequency.
429
+ LSRD -- Local Standard of Rest (J2000).
430
+ -- as the dynamical definition (IAU, [9,12,7] km/s in galactic coordinates).
431
+ LSRK -- LSR as a kinematical (radio) definition.
432
+ -- 20.0 km/s in direction ra,dec = [270,+30] deg (B1900.0).
433
+ BARY -- Barycentric (J2000).
434
+ GEO --- Geocentric.
435
+ TOPO -- Topocentric.
436
+ GALACTO -- Galacto centric (with rotation of 220 km/s in direction l,b = [90,0] deg.
437
+ LGROUP -- Local group velocity -- 308km/s towards l,b = [105,-7] deg (F. Ghigo).
438
+ CMB -- CMB velocity -- 369.5km/s towards l,b = [264.4, 48.4] deg (F. Ghigo).
439
+ DEFAULT = LSRK.
440
+ veltype Velocity type (radio, z, ratio, beta, gamma, optical)
441
+ For 'start' and/or 'width' specified in velocity, specifies the velocity definition
442
+ Options: 'radio','optical','z','beta','gamma','optical'
443
+ NOTE: the viewer always defaults to displaying the 'radio' frame,
444
+ but that can be changed in the position tracking pull down.
445
+
446
+ The different types (with F = f/f0, the frequency ratio), are:
447
+
448
+ Z = (-1 + 1/F).
449
+ RATIO = (F) \*.
450
+ RADIO = (1 - F).
451
+ OPTICAL == Z.
452
+ BETA = ((1 - F^2)/(1 + F^2)).
453
+ GAMMA = ((1 + F^2)/2F) \*.
454
+ RELATIVISTIC == BETA (== v/c).
455
+ DEFAULT == RADIO.
456
+ Note that the ones with an '\*' have no real interpretation
457
+ (although the calculation will proceed) if given as a velocity.
458
+ restfreq List of rest frequencies or a rest frequency in a string.
459
+ Specify rest frequency to use for output image.
460
+
461
+ Currently it uses the first rest frequency in the list for translation of
462
+ velocities. The list will be stored in the output images.
463
+ Default: []; look for the rest frequency stored in the MS, if not available,
464
+ use center frequency of the selected channels.
465
+ examples: restfreq=['1.42GHz'].
466
+ restfreq='1.42GHz'.
467
+ interpolation Spectral interpolation (nearest,linear,cubic)
468
+
469
+ Interpolation rules to use when binning data channels onto image channels
470
+ and evaluating visibility values at the centers of image channels.
471
+
472
+ Note : 'linear' and 'cubic' interpolation requires data points on both sides of
473
+ each image frequency. Errors are therefore possible at edge channels, or near
474
+ flagged data channels. When image channel width is much larger than the data
475
+ channel width there is nothing much to be gained using linear or cubic thus
476
+ not worth the extra computation involved.
477
+ perchanweightdensity When calculating weight density for Briggs
478
+ style weighting in a cube, this parameter
479
+ determines whether to calculate the weight
480
+ density for each channel independently
481
+ (the default, True)
482
+ or a common weight density for all of the selected
483
+ data. This parameter has no
484
+ meaning for continuum (specmode='mfs') imaging
485
+ or for natural and radial weighting schemes.
486
+ For cube imaging
487
+ perchanweightdensity=True is a recommended
488
+ option that provides more uniform
489
+ sensitivity per channel for cubes, but with
490
+ generally larger psfs than the
491
+ perchanweightdensity=False (prior behavior)
492
+ option. When using Briggs style weight with
493
+ perchanweightdensity=True, the imaging weight
494
+ density calculations use only the weights of
495
+ data that contribute specifically to that
496
+ channel. On the other hand, when
497
+ perchanweightdensity=False, the imaging
498
+ weight density calculations sum all of the
499
+ weights from all of the data channels
500
+ selected whose (u,v) falls in a given uv cell
501
+ on the weight density grid. Since the
502
+ aggregated weights, in any given uv cell,
503
+ will change depending on the number of
504
+ channels included when imaging, the psf
505
+ calculated for a given frequency channel will
506
+ also necessarily change, resulting in
507
+ variability in the psf for a given frequency
508
+ channel when perchanweightdensity=False. In
509
+ general, perchanweightdensity=False results
510
+ in smaller psfs for the same value of
511
+ robustness compared to
512
+ perchanweightdensity=True, but the rms noise
513
+ as a function of channel varies and increases
514
+ toward the edge channels;
515
+ perchanweightdensity=True provides more
516
+ uniform sensitivity per channel for
517
+ cubes. This may make it harder to find
518
+ estimates of continuum when
519
+ perchanweightdensity=False. If you intend to
520
+ image a large cube in many smaller subcubes
521
+ and subsequently concatenate, it is advisable
522
+ to use perchanweightdensity=True to avoid
523
+ surprisingly varying sensitivity and psfs
524
+ across the concatenated cube.
525
+ gridder Gridding options (standard, wproject, widefield, mosaic, awproject, awp2, awphpg)
526
+
527
+
528
+ The following options choose different gridding convolution
529
+ functions for the process of convolutional resampling of the measured
530
+ visibilities onto a regular uv-grid prior to an inverse FFT.
531
+ Model prediction (degridding) also uses these same functions.
532
+ Several wide-field effects can be accounted for via careful choices of
533
+ convolution functions. Gridding (degridding) runtime will rise in
534
+ proportion to the support size of these convolution functions (in uv-pixels).
535
+
536
+ standard : Prolate Spheroid with 7x7 uv pixel support size.
537
+
538
+ [ This mode can also be invoked using 'ft' or 'gridft' ]
539
+
540
+ wproject : W-Projection algorithm to correct for the widefield
541
+ non-coplanar baseline effect. [Cornwell et.al 2008]
542
+
543
+ wprojplanes is the number of distinct w-values at
544
+ which to compute and use different gridding convolution
545
+ functions (see help for wprojplanes).
546
+ Convolution function support size can range
547
+ from 5x5 to few 100 x few 100.
548
+
549
+ [ This mode can also be invoked using 'wprojectft' ]
550
+
551
+ widefield : Facetted imaging with or without W-Projection per facet.
552
+
553
+ A set of facets x facets subregions of the specified image
554
+ are gridded separately using their respective phase centers
555
+ (to minimize max W). Deconvolution is done on the joint
556
+ full size image, using a PSF from the first subregion.
557
+
558
+ wprojplanes=1 : standard prolate spheroid gridder per facet.
559
+ wprojplanes > 1 : W-Projection gridder per facet.
560
+ nfacets=1, wprojplanes > 1 : Pure W-Projection and no facetting.
561
+ nfacets=1, wprojplanes=1 : Same as standard,ft,gridft.
562
+
563
+ A combination of facetting and W-Projection is relevant only for
564
+ very large fields of view. (In our current version of tclean, this
565
+ combination runs only with parallel=False.
566
+
567
+ mosaic : A-Projection with azimuthally symmetric beams without
568
+ sidelobes, beam rotation or squint correction.
569
+ Gridding convolution functions per visibility are computed
570
+ from FTs of PB models per antenna.
571
+ This gridder can be run on single fields as well as mosaics.
572
+
573
+ VLA : PB polynomial fit model (Napier and Rots, 1982).
574
+ EVLA : PB polynomial fit model (Perley, 2015).
575
+ ALMA : Airy disks for a 10.7m dish (for 12m dishes) and
576
+ 6.25m dish (for 7m dishes) each with 0.75m
577
+ blockages (Hunter/Brogan 2011). Joint mosaic
578
+ imaging supports heterogeneous arrays for ALMA.
579
+
580
+ Typical gridding convolution function support sizes are
581
+ between 7 and 50 depending on the desired
582
+ accuracy (given by the uv cell size or image field of view).
583
+
584
+ [ This mode can also be invoked using 'mosaicft' or 'ftmosaic' ]
585
+
586
+ awproject : A-Projection with azimuthally asymmetric beams and
587
+ including beam rotation, squint correction,
588
+ conjugate frequency beams and W-projection.
589
+ [Bhatnagar et.al, 2008]
590
+
591
+ Gridding convolution functions are computed from
592
+ aperture illumination models per antenna and optionally
593
+ combined with W-Projection kernels and a prolate spheroid.
594
+ This gridder can be run on single fields as well as mosaics.
595
+
596
+ VLA : Uses ray traced model (VLA and EVLA) including feed
597
+ leg and subreflector shadows, off-axis feed location
598
+ (for beam squint and other polarization effects), and
599
+ a Gaussian fit for the feed beams (Brisken 2009)
600
+ ALMA : Similar ray-traced model as above (but the correctness
601
+ of its polarization properties remains un-verified).
602
+
603
+ Typical gridding convolution function support sizes are
604
+ between 7 and 50 depending on the desired
605
+ accuracy (given by the uv cell size or image field of view).
606
+ When combined with W-Projection they can be significantly larger.
607
+
608
+ [ This mode can also be invoked using 'awprojectft' ]
609
+
610
+
611
+ awp2 : A-Projection with azimuthally asymmetric beams and
612
+ including beam rotation, squint correction and W-projection.
613
+ [Bhatnagar et.al, 2008]
614
+
615
+ Gridding convolution functions are computed from
616
+ aperture illumination models (assuming similar antennas) and optionally
617
+ combined with W-Projection kernels.
618
+ This gridder can be run on single fields as well as mosaics.
619
+ The other sub-parameters that are of significance when using this gridder
620
+ are wprojplanes, computepastep, mosweight, usepointing, pblimit and normtype.
621
+
622
+ Only supports VLA : Uses ray traced model (VLA and EVLA) including feed
623
+ leg and subreflector shadows, off-axis feed location
624
+ (for beam squint and other polarization effects), and
625
+ a Gaussian fit for the feed beams (Ref: Brisken 2009)
626
+
627
+ For squint correction the value passed in computepastep has to be smaller than 180.
628
+ Anything larger awp2 will use an average of LL and RR beams. If computepastep=5, for
629
+ e.g., PB every 5 degrees, over the range of parallactic angle covered by the data, will be calculated
630
+ and the nearest beam to every integration will be used to correct for the squint between the L and R beams.
631
+
632
+ NOTE : For mtmfs with nterms >1 and using awp2 gridder, for accurate results always use specmode="mvc"
633
+ as awp2 with specmode="mfs" does not use conjugate beams to remove the spectral
634
+ index of the primary beam.
635
+
636
+ awphpg : Implementation of the high performance gridder (HPG; Pokorny, ngVLA Computing Memo #5).
637
+ For CASA 6.7.0 this mode is only available on the internal VLASS release of CASA.
638
+ It will be made available for general use in a future CASA release.
639
+
640
+
641
+ imagemosaic : (untested implementation).
642
+
643
+ Grid and iFT each pointing separately and combine the
644
+ images as a linear mosaic (weighted by a PB model) in
645
+ the image domain before a joint minor cycle.
646
+
647
+ VLA/ALMA PB models are same as for gridder='mosaicft'.
648
+
649
+ ------ Notes on PB models :
650
+
651
+ (1) Several different sources of PB models are used in the modes
652
+ listed above. This is partly for reasons of algorithmic flexibility
653
+ and partly due to the current lack of a common beam model
654
+ repository or consensus on what beam models are most appropriate.
655
+
656
+ (2) For ALMA and gridder='mosaic', ray-traced (TICRA) beams
657
+ are also available via the vpmanager tool.
658
+ For example, call the following before the tclean run.
659
+ vp.setpbimage(telescope="ALMA",
660
+ compleximage='/home/casa/data/trunk/alma/responses/ALMA_0_DV__0_0_360_0_45_90_348.5_373_373_GHz_ticra2007_VP.im',
661
+ antnames=['DV'+'%02d'%k for k in range(25)])
662
+ vp.saveastable('mypb.tab')
663
+ Then, supply vptable='mypb.tab' to tclean.
664
+ ( Currently this will work only for non-parallel runs )
665
+
666
+
667
+ ------ Note on PB masks :
668
+
669
+ In tclean, A-Projection gridders (mosaic, awproject, and awp2) produce a
670
+ .pb image and use the 'pblimit' subparameter to decide normalization
671
+ cutoffs and construct an internal T/F mask in the .pb and .image images.
672
+ However, this T/F mask cannot directly be used during deconvolution
673
+ (which needs a 1/0 mask). There are two options for making a pb based
674
+ deconvolution mask.
675
+ -- Run tclean with niter=0 to produce the .pb, construct a 1/0 image
676
+ with the desired threshold (using ia.open('newmask.im');
677
+ ia.calc('iif("xxx.pb">0.3,1.0,0.0)');ia.close() for example),
678
+ and supply it via the 'mask' parameter in a subsequent run
679
+ (with calcres=F and calcpsf=F to restart directly from the minor cycle).
680
+ -- Run tclean with usemask='pb' for it to automatically construct
681
+ a 1/0 mask from the internal T/F mask from .pb at a fixed 0.2 threshold.
682
+
683
+
684
+ ----- Making PBs for gridders other than mosaic, awproject, awp2
685
+
686
+ After the PSF generation, a PB is constructed using the same
687
+ models used in gridder='mosaic' but just evaluated in the image
688
+ domain without consideration to weights.
689
+ facets Number of facets on a side
690
+
691
+ A set of (facets x facets) subregions of the specified image
692
+ are gridded separately using their respective phase centers
693
+ (to minimize max W). Deconvolution is done on the joint
694
+ full size image, using a PSF from the first subregion/facet.
695
+
696
+ In our current version of tclean, facets>1 may be used only
697
+ with parallel=False.
698
+ psfphasecenter For mosaic use psf centered on this
699
+ optional direction. You may need to use
700
+ this if for example the mosaic does not
701
+ have any pointing in the center of the
702
+ image. Another reason; as the psf is
703
+ approximate for a mosaic, this may help
704
+ to deconvolve a non central bright source
705
+ well and quickly.
706
+
707
+ example:
708
+
709
+ psfphasecenter='6' #center psf on field 6.
710
+ psfphasecenter='J2000 19h30m00 -40d00m00'.
711
+ psfphasecenter='J2000 292.5deg -40.0deg'.
712
+ psfphasecenter='J2000 5.105rad -0.698rad'.
713
+ psfphasecenter='ICRS 13:05:27.2780 -049.28.04.458'.
714
+ wprojplanes Number of distinct w-values at which to compute and use different
715
+ gridding convolution functions for W-Projection
716
+
717
+ An appropriate value of wprojplanes depends on the presence/absence
718
+ of a bright source far from the phase center, the desired dynamic
719
+ range of an image in the presence of a bright far out source,
720
+ the maximum w-value in the measurements, and the desired trade off
721
+ between accuracy and computing cost.
722
+
723
+ As a (rough) guide, VLA L-Band D-config may require a
724
+ value of 128 for a source 30arcmin away from the phase
725
+ center. A-config may require 1024 or more. To converge to an
726
+ appropriate value, try starting with 128 and then increasing
727
+ it if artifacts persist. W-term artifacts (for the VLA) typically look
728
+ like arc-shaped smears in a synthesis image or a shift in source
729
+ position between images made at different times. These artifacts
730
+ are more pronounced the further the source is from the phase center.
731
+
732
+ There is no harm in simply always choosing a large value (say, 1024)
733
+ but there will be a significant performance cost to doing so, especially
734
+ for gridder='awproject' where it is combined with A-Projection.
735
+
736
+ wprojplanes=-1 is an option for gridder='widefield' or 'wproject'
737
+ in which the number of planes is automatically computed.
738
+ vptable vpmanager
739
+
740
+ vptable="" : Choose default beams for different telescopes.
741
+ ALMA : Airy disks.
742
+ EVLA : old VLA models.
743
+
744
+ Other primary beam models can be chosen via the vpmanager tool.
745
+
746
+ Step 1 : Set up the vpmanager tool and save its state in a table.
747
+
748
+ vp.setpbpoly(telescope='EVLA', coeff=[1.0, -1.529e-3, 8.69e-7, -1.88e-10])
749
+ vp.saveastable('myvp.tab')
750
+
751
+ Step 2 : Supply the name of that table in tclean.
752
+
753
+ tclean(....., vptable='myvp.tab',....)
754
+
755
+ Please see the documentation for the vpmanager for more details on how to
756
+ choose different beam models. Work is in progress to update the defaults
757
+ for EVLA and ALMA.
758
+
759
+ Note : AWProjection currently does not use this mechanism to choose
760
+ beam models. It instead uses ray-traced beams computed from
761
+ parameterized aperture illumination functions, which are not
762
+ available via the vpmanager. So, gridder='awproject' does not allow
763
+ the user to set this parameter.
764
+ 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.
765
+ aterm Use aperture illumination functions during gridding.
766
+
767
+ This parameter turns on the A-term of the AW-Projection gridder.
768
+ Gridding convolution functions are constructed from aperture illumination
769
+ function models of each antenna.
770
+ psterm Include the Prolate Spheroidal (PS) funtion as the anti-aliasing
771
+ operator in the gridding convolution functions used for gridding.
772
+
773
+ Setting this parameter to true is necessary when aterm is set to
774
+ false. It can be set to false when aterm is set to true, though
775
+ with this setting effects of aliasing may be there in the image,
776
+ particularly near the edges.
777
+
778
+ When set to true, the .pb images will contain the fourier transform
779
+ of the of the PS funtion.
780
+
781
+ For more information on the functional
782
+ effects of the psterm, aterm and wprojplanes settings, see the
783
+ 'Wide-field Imaging' pages in CASA Docs (https://casadocs.readthedocs.io).
784
+ wbawp Use frequency dependent A-terms.
785
+ Scale aperture illumination functions appropriately with frequency
786
+ when gridding and combining data from multiple channels.
787
+ conjbeams Use conjugate frequency for wideband A-terms.
788
+
789
+ While gridding data from one frequency channel, choose a convolution
790
+ function from a 'conjugate' frequency such that the resulting baseline
791
+ primary beam is approximately constant across frequency. For a system in
792
+ which the primary beam scales with frequency, this step will eliminate
793
+ instrumental spectral structure from the measured data and leave only the
794
+ sky spectrum for the minor cycle to model and reconstruct [Bhatnagar et al., ApJ, 2013].
795
+
796
+ As a rough guideline for when this is relevant, a source at the half power
797
+ point of the PB at the center frequency will see an artificial spectral
798
+ index of -1.4 due to the frequency dependence of the PB [Sault and Wieringa, 1994].
799
+ If left uncorrected during gridding, this spectral structure must be modeled
800
+ in the minor cycle (using the mtmfs algorithm) to avoid dynamic range limits
801
+ (of a few hundred for a 2:1 bandwidth).
802
+ This works for specmode='mfs' and its value is ignored for cubes.
803
+ cfcache Convolution function cache directory name.
804
+
805
+ Name of a directory in which to store gridding convolution functions.
806
+ This cache is filled at the beginning of an imaging run. This step can be time
807
+ consuming but the cache can be reused across multiple imaging runs that
808
+ use the same image parameters (cell size, image size , spectral data
809
+ selections, wprojplanes, wbawp, psterm, aterm). The effect of the wbawp,
810
+ psterm and aterm settings is frozen-in in the cfcache. Using an existing cfcache
811
+ made with a different setting of these parameters will not reflect the current
812
+ settings.
813
+
814
+ In a parallel execution, the construction of the cfcache is also parallelized
815
+ and the time to compute scales close to linearly with the number of compute
816
+ cores used. With the re-computation of Convolution Functions (CF) due to PA
817
+ rotation turned-off (the computepastep parameter), the total number of in the
818
+ cfcache can be computed as [No. of wprojplanes x No. of selected spectral windows x 4]
819
+
820
+ By default, cfcache = imagename + '.cf'
821
+ usepointing The usepointing flag informs the gridder that it should utilize the pointing table
822
+ to use the correct direction in which the antenna is pointing with respect to the pointing phasecenter.
823
+ computepastep Parallactic angle interval after the AIFs are recomputed (deg).
824
+
825
+ This parameter controls the accuracy of the aperture illumination function
826
+ used with AProjection for alt-az mount dishes where the AIF rotates on the
827
+ sky as the synthesis image is built up. Once the PA in the data changes by
828
+ the given interval, AIFs are re-computed at the new PA.
829
+
830
+ A value of 360.0 deg (the default) implies no re-computation due to PA rotation.
831
+ AIFs are computed for the PA value of the first valid data received and used for
832
+ all of the data.
833
+
834
+ For gridder=awp2 a value of 180.0 deg or larger implies no squint correction will be
835
+ attempted i.e an average beam of the left hand and right hand polarization will be calculated
836
+ rotatepastep Parallactic angle interval after which the nearest AIF is rotated (deg)
837
+
838
+ Instead of recomputing the AIF for every timestep's parallactic angle,
839
+ the nearest existing AIF is used and rotated
840
+ after the PA changed by rotatepastep value.
841
+
842
+ A value of 360.0 deg (the default) disables rotation of the AIF.
843
+
844
+ For example, computepastep=360.0 and rotatepastep=5.0 will compute
845
+ the AIFs at only the starting parallactic angle and all other timesteps will
846
+ use a rotated version of that AIF at the nearest 5.0 degree point.
847
+ pointingoffsetsigdev Corrections for heterogenous and time-dependent pointing
848
+ offsets via AWProjection are controlled by this parameter.
849
+ It is a vector of 2 ints or doubles each of which is interpreted
850
+ in units of arcsec. Based on the first threshold, a clustering
851
+ algorithm is applied to entries from the POINTING subtable
852
+ of the MS to determine how distinct antenna groups for which
853
+ the pointing offset must be computed separately. The second
854
+ number controls how much a pointing change across time can
855
+ be ignored and after which an antenna rebinning is required.
856
+
857
+
858
+ Note : The default value of this parameter is [], due a programmatic constraint.
859
+ If run with this value, it will internally pick [600,600] and exercise the
860
+ option of using large tolerances (10arcmin) on both axes. Please choose
861
+ a setting explicitly for runs that need to use this parameter.
862
+
863
+ Note : This option is available only for gridder='awproject' and usepointing=True and
864
+ and has been validated primarily with VLASS on-the-fly mosaic data
865
+ where POINTING subtables have been modified after the data are recorded.
866
+
867
+
868
+ Examples of parameter usage :
869
+
870
+ [100.0,100.0] : Pointing offsets of 100 arcsec or less are considered
871
+ small enough to be ignored. Using large values for both
872
+ indicates a homogeneous array.
873
+
874
+
875
+ [10.0, 100.0] : Based on entries in the POINTING subtable, antennas
876
+ are grouped into clusters based on a 10arcsec bin size.
877
+ All antennas in a bin are given a pointing offset calculated
878
+ as the average of the offsets of all antennas in the bin.
879
+ On the time axis, offset changes upto 100 arcsec will be ignored.
880
+
881
+ [10.0,10.0] : Calculate separate pointing offsets for each antenna group
882
+ (with a 10 arcsec bin size). As a function of time, recalculate
883
+ the antenna binning if the POINTING table entries change by
884
+ more than 10 arcsec w.r.to the previously computed binning.
885
+
886
+ [1.0, 1.0] : Tight tolerances will imply a fully heterogenous situation where
887
+ each antenna gets its own pointing offset. Also, time-dependent
888
+ offset changes greater than 1 arcsec will trigger recomputes of
889
+ the phase gradients. This is the most general situation and is also
890
+ the most expensive option as it constructs and uses separate
891
+ phase gradients for all baselines and timesteps.
892
+
893
+ For VLASS 1.1 data with two kinds of pointing offsets, the recommended
894
+ setting is [ 30.0, 30.0 ].
895
+
896
+ For VLASS 1.2 data with only the time-dependent pointing offsets, the
897
+ recommended setting is [ 300.0, 30.0 ] to turn off the antenna grouping
898
+ but to retain the time dependent corrections required from one timestep
899
+ to the next.
900
+ pblimit PB gain level at which to cut off normalizations.
901
+
902
+ Divisions by .pb during normalizations have a cut off at a .pb gain
903
+ level given by pblimit. Outside this limit, image values are set to zero.
904
+ Additionally, by default, an internal T/F mask is applied to the .pb, .image and
905
+ .residual images to mask out (T) all invalid pixels outside the pblimit area.
906
+
907
+ Note : This internal T/F mask cannot be used as a deconvolution mask.
908
+ To do so, please follow the steps listed above in the Notes for the
909
+ 'gridder' parameter.
910
+
911
+ Note : To prevent the internal T/F mask from appearing in anything other
912
+ than the .pb and .image.pbcor images, 'pblimit' can be set to a
913
+ negative number.
914
+ The absolute value will still be used as a valid 'pblimit' for normalization
915
+ purposes. So, for example, pick pblimit=-0.1 (and not pblimit=-1).
916
+ A tclean restart using existing output images on disk that already
917
+ have this T/F mask in the .residual and .image but only pblimit set
918
+ to a negative value, will remove this mask after the next major cycle.
919
+
920
+ Note : An existing internal T/F mask may be removed from an image as
921
+ follows (without needing to re-run tclean itself).
922
+ ia.open('test.image');
923
+ ia.maskhandler(op='set', name='');
924
+ ia.done()
925
+ normtype Normalization type (flatnoise, flatsky, pbsquare).
926
+
927
+ Gridded (and FT'd) images represent the PB-weighted sky image.
928
+ Qualitatively it can be approximated as two instances of the PB
929
+ applied to the sky image (one naturally present in the data
930
+ and one introduced during gridding via the convolution functions).
931
+
932
+ xxx.weight : Weight image approximately equal to sum ( square ( pb ) )
933
+ xxx.pb : Primary beam calculated as sqrt ( xxx.weight )
934
+
935
+ normtype='flatnoise' : Divide the raw image by sqrt(.weight) so that
936
+ the input to the minor cycle represents the
937
+ product of the sky and PB. The noise is 'flat'
938
+ across the region covered by each PB.
939
+
940
+ normtype='flatsky' : Divide the raw image by .weight so that the input
941
+ to the minor cycle represents only the sky.
942
+ The noise is higher in the outer regions of the
943
+ primary beam where the sensitivity is low.
944
+
945
+ normtype='pbsquare' : No normalization after gridding and FFT.
946
+ The minor cycle sees the sky times pb square
947
+ deconvolver Name of minor cycle algorithm (hogbom,clark,multiscale,mtmfs,mem,clarkstokes,asp)
948
+
949
+ Each of the following algorithms operate on residual images and PSFs
950
+ from the gridder and produce output model and restored images.
951
+ Minor cycles stop and a major cycle is triggered when cyclethreshold
952
+ or cycleniter are reached. For all methods, components are picked from
953
+ the entire extent of the image or (if specified) within a mask.
954
+
955
+ hogbom : An adapted version of Hogbom Clean [Hogbom, 1974].
956
+ - Find the location of the peak residual.
957
+ - Add this delta function component to the model image.
958
+ - Subtract a scaled and shifted PSF of the same size as the image
959
+ from regions of the residual image where the two overlap.
960
+ - Repeat.
961
+
962
+ clark : An adapted version of Clark Clean [Clark, 1980].
963
+ - Find the location of max(I^2+Q^2+U^2+V^2).
964
+ - Add delta functions to each stokes plane of the model image.
965
+ - Subtract a scaled and shifted PSF within a small patch size
966
+ from regions of the residual image where the two overlap.
967
+ - After several iterations trigger a Clark major cycle to subtract
968
+ components from the visibility domain, but without de-gridding.
969
+ - Repeat.
970
+
971
+ ( Note : 'clark' maps to imagermode='' in the old clean task.
972
+ 'clark_exp' is another implementation that maps to
973
+ imagermode='mosaic' or 'csclean' in the old clean task
974
+ but the behavior is not identical. For now, please
975
+ use deconvolver='hogbom' if you encounter problems. )
976
+
977
+ clarkstokes : Clark Clean operating separately per Stokes plane.
978
+
979
+ (Note : 'clarkstokes_exp' is an alternate version. See above.)
980
+
981
+ multiscale : MultiScale Clean [Cornwell, 2008].
982
+ - Smooth the residual image to multiple scale sizes.
983
+ - Find the location and scale at which the peak occurs.
984
+ - Add this multiscale component to the model image.
985
+ - Subtract a scaled,smoothed,shifted PSF (within a small
986
+ patch size per scale) from all residual images.
987
+ - Repeat from step 2.
988
+
989
+ mtmfs : Multi-term (Multi Scale) Multi-Frequency Synthesis [Rau and Cornwell, 2011].
990
+ - Smooth each Taylor residual image to multiple scale sizes.
991
+ - Solve a NTxNT system of equations per scale size to compute
992
+ Taylor coefficients for components at all locations.
993
+ - Compute gradient chi-square and pick the Taylor coefficients
994
+ and scale size at the location with maximum reduction in
995
+ chi-square.
996
+ - Add multi-scale components to each Taylor-coefficient
997
+ model image.
998
+ - Subtract scaled,smoothed,shifted PSF (within a small patch size
999
+ per scale) from all smoothed Taylor residual images.
1000
+ - Repeat from step 2.
1001
+
1002
+
1003
+ mem : Maximum Entropy Method [Cornwell and Evans, 1985].
1004
+ - Iteratively solve for values at all individual pixels via the
1005
+ MEM method. It minimizes an objective function of
1006
+ chi-square plus entropy (here, a measure of difference
1007
+ between the current model and a flat prior model).
1008
+
1009
+ (Note : This MEM implementation is not very robust.
1010
+ Improvements will be made in the future.)
1011
+
1012
+ asp : Adaptive Scale Pixel algorithm [Bhatnagar and Cornwell, 2004].
1013
+ - Define a set of initial scales defined as 0, W, 2W 4W and 8W.
1014
+ where W is a 2D Gaussian fitting width to the PSF.
1015
+ - Smooth the residual image by a Gaussian beam at initial scales.
1016
+ - Search for the global peak (F) among these smoothed residual images.
1017
+ - form an active Aspen set: amplitude(F), amplitude location(x,y).
1018
+ - Optimize the Aspen set by minimizing the objective function RI-Aspen*PSF,
1019
+ where RI is the residual image and * is the convulition operation.
1020
+ - Compute the model image and update the residual image
1021
+ - Repeat from step 2
1022
+ scales List of scale sizes (in pixels) for multi-scale and mtmfs algorithms.
1023
+ --> scales=[0,6,20]
1024
+ This set of scale sizes should represent the sizes
1025
+ (diameters in units of number of pixels)
1026
+ of dominant features in the image being reconstructed.
1027
+
1028
+ The smallest scale size is recommended to be 0 (point source),
1029
+ the second being the size of the synthesized beam and the third being 3-5
1030
+ times the synthesized beam, etc. For example, if the synthesized
1031
+ beam is 10" FWHM and cell=2",try scales = [0,5,15].
1032
+
1033
+ For numerical stability, the largest scale must be
1034
+ smaller than the image (or mask) size and smaller than or
1035
+ comparable to the scale corresponding to the lowest measured
1036
+ spatial frequency (as a scale size much larger than what the
1037
+ instrument is sensitive to is unconstrained by the data making
1038
+ it harder to recover from errors during the minor cycle).
1039
+ nterms Number of Taylor coefficients in the spectral model.
1040
+
1041
+ - nterms=1 : Assume flat spectrum source.
1042
+ - nterms=2 : Spectrum is a straight line with a slope.
1043
+ - nterms=N : A polynomial of order N-1.
1044
+
1045
+ From a Taylor expansion of the expression of a power law, the
1046
+ spectral index is derived as alpha = taylorcoeff_1 / taylorcoeff_0.
1047
+
1048
+ Spectral curvature is similarly derived when possible.
1049
+
1050
+ The optimal number of Taylor terms depends on the available
1051
+ signal to noise ratio, bandwidth ratio, and spectral shape of the
1052
+ source as seen by the telescope (sky spectrum x PB spectrum).
1053
+
1054
+ nterms=2 is a good starting point for wideband EVLA imaging
1055
+ and the lower frequency bands of ALMA (when fractional bandwidth
1056
+ is greater than 10%) and if there is at least one bright source for
1057
+ which a dynamic range of greater than few 100 is desired.
1058
+
1059
+ Spectral artifacts for the VLA often look like spokes radiating out from
1060
+ a bright source (i.e. in the image made with standard mfs imaging).
1061
+ If increasing the number of terms does not eliminate these artifacts,
1062
+ check the data for inadequate bandpass calibration. If the source is away
1063
+ from the pointing center, consider including wide-field corrections too.
1064
+
1065
+ (Note : In addition to output Taylor coefficient images .tt0,.tt1,etc
1066
+ images of spectral index (.alpha), an estimate of error on
1067
+ spectral index (.alpha.error) and spectral curvature (.beta,
1068
+ if nterms is greater than 2) are produced.
1069
+ - These alpha, alpha.error and beta images contain
1070
+ internal T/F masks based on a threshold computed
1071
+ as peakresidual/10. Additional masking based on
1072
+ .alpha/.alpha.error may be desirable.
1073
+ - .alpha.error is a purely empirical estimate derived
1074
+ from the propagation of error during the division of
1075
+ two noisy numbers (alpha = xx.tt1/xx.tt0) where the
1076
+ 'error' on tt1 and tt0 are simply the values picked from
1077
+ the corresponding residual images. The absolute value
1078
+ of the error is not always accurate and it is best to interpret
1079
+ the errors across the image only in a relative sense.
1080
+ smallscalebias A numerical control to bias the scales when using multi-scale or mtmfs algorithms.
1081
+ The peak from each scale's smoothed residual is
1082
+ multiplied by ( 1 - smallscalebias \* scale/maxscale )
1083
+ to increase or decrease the amplitude relative to other scales,
1084
+ before the scale with the largest peak is chosen.
1085
+ Smallscalebias can be varied between -1.0 and 1.0.
1086
+ A score of 0.0 gives all scales equal weight (default).
1087
+ A score larger than 0.0 will bias the solution towards smaller scales.
1088
+ A score smaller than 0.0 will bias the solution towards larger scales.
1089
+ The effect of smallscalebias is more pronounced when using multi-scale relative to mtmfs.
1090
+ fusedthreshold ring Hogbom Clean (number in units of Jy).
1091
+
1092
+ fusedthreshold = 0.0001 : 0.1 mJy.
1093
+
1094
+ This is a subparameter of the Asp Clean deconvolver. When peak residual
1095
+ is lower than the threshold, Asp Clean is "switched to Hogbom Clean" (i.e. only use the 0 scale for cleaning) for
1096
+ the following number of iterations until it switches back to Asp Clean.
1097
+
1098
+ NumberIterationsInHogbom = 50 + 2 * (exp(0.05 * NthHogbom) - 1)
1099
+
1100
+ , where NthHogbom is the number of times Hogbom Clean has been triggered.
1101
+
1102
+ 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.
1103
+
1104
+ NumberIterationsInHogbom = 500 + 2 * (exp(0.05 * NthHogbom) - 1)
1105
+
1106
+ Set 'fusedthreshold = -1' to make the Asp Clean deconvolver never "switch" to Hogbom Clean.
1107
+ largestscale xels) allowed for the initial guess for the Asp Clean deconvolver.
1108
+
1109
+ largestscale = 100
1110
+
1111
+ The default initial scale sizes used by Asp Clean is [0, w, 2w, 4w, 8w],
1112
+ where `w` is the PSF width. The default `largestscale` is -1 which indicates
1113
+ users accept these initial scales. If `largestscale` is set, the initial scales
1114
+ would be [0, w, ... up to the `largestscale`]. This is only an initial guess,
1115
+ and actual fitted scale sizes may evolve from these initial values.
1116
+
1117
+ It is recommended not to set `largestscale` unless Asp Clean picks a large
1118
+ scale that has no constraints from the data (the UV hole issue).
1119
+ restoration e.
1120
+
1121
+ Construct a restored image : imagename.image by convolving the model
1122
+ image with a clean beam and adding the residual image to the result.
1123
+ If a restoringbeam is specified, the residual image is also
1124
+ smoothed to that target resolution before adding it in.
1125
+
1126
+ If a .model does not exist, it will make an empty one and create
1127
+ the restored image from the residuals ( with additional smoothing if needed ).
1128
+ With algorithm='mtmfs', this will construct Taylor coefficient maps from
1129
+ the residuals and compute .alpha and .alpha.error.
1130
+ restoringbeam ize to use.
1131
+
1132
+ - restoringbeam='' or [''].
1133
+ A Gaussian fitted to the PSF main lobe (separately per image plane).
1134
+
1135
+ - restoringbeam='10.0arcsec'.
1136
+ Use a circular Gaussian of this width for all planes.
1137
+
1138
+ - restoringbeam=['8.0arcsec','10.0arcsec','45deg'].
1139
+ Use this elliptical Gaussian for all planes.
1140
+
1141
+ - restoringbeam='common'.
1142
+ Automatically estimate a common beam shape/size appropriate for
1143
+ all planes. This option can be used when the beam shape is different as a function of frequency, and will smooth all planes to a single beam, defined by the largest beam in the cube.
1144
+
1145
+ Note : For any restoring beam different from the native resolution
1146
+ the model image is convolved with the beam and added to
1147
+ residuals that have been convolved to the same target resolution.
1148
+ pbcor the output restored image.
1149
+
1150
+ A new image with extension .image.pbcor will be created from
1151
+ the evaluation of .image / .pb for all pixels above the specified pblimit.
1152
+
1153
+ Note : Stand-alone PB-correction can be triggered by re-running
1154
+ tclean with the appropriate imagename and with
1155
+ niter=0, calcpsf=False, calcres=False, pbcor=True, vptable='vp.tab'
1156
+ ( where vp.tab is the name of the vpmanager file;
1157
+ see the inline help for the 'vptable' parameter ). Alternatively, task impbcor can be used for primary beam correction using the .image and .pb files.
1158
+
1159
+ Note : For deconvolver='mtmfs', pbcor will divide each Taylor term image by the .tt0 average PB.
1160
+ For all gridders, this calculation is accurate for small fractional bandwidths.
1161
+
1162
+ For large fractional bandwidths, please use one of the following options.
1163
+
1164
+ (a) For single pointings, run the tclean task with specmode='mfs', deconvolver='mtmfs',
1165
+ and gridder='standard' with pbcor=True or False.
1166
+ If a PB-corrected spectral index is required,
1167
+ please use the widebandpbcor task to apply multi-tern PB-correction.
1168
+
1169
+ (b) For mosaics, run tclean task with specmode='mfs', deconvolver='mtmfs',
1170
+ and gridder='awproject' , wbawp=True, conjbeams=True, with pbcor=True.
1171
+ This option applies wideband PB correction as part of the gridding step and
1172
+ pbcor=True will be accurate because the spectral index map will already
1173
+ be PB-corrected.
1174
+
1175
+ (c) For mosaics, run tclean with specmode='mvc', deconvolver='mtmfs',
1176
+ and gridder='mosaic' or 'awp2' with pbcor=True.
1177
+ This option applies wideband PB-correction to channelized residual images
1178
+ prior to the minor cycle and pbcor=True will be accurate because the spectral
1179
+ index map will already be PB-corrected.
1180
+
1181
+ Note : Frequency-dependent PB corrections are typically required for full-band imaging with the VLA.
1182
+ Wideband PB corrections are required when the amplitude of the
1183
+ brightest source is known accurately enough to be sensitive
1184
+ to the difference in the PB gain between the upper and lower
1185
+ end of the band at its location. As a guideline, the artificial spectral
1186
+ index due to the PB is -1.4 at the 0.5 gain level and less than -0.2
1187
+ at the 0.9 gain level at the middle frequency )
1188
+ outlierfile Name of outlier-field image definitions.
1189
+
1190
+ A text file containing sets of parameter=value pairs,
1191
+ one set per outlier field.
1192
+
1193
+ Example : outlierfile='outs.txt'
1194
+
1195
+ Contents of outs.txt :
1196
+
1197
+ imagename=tst1
1198
+ nchan=1
1199
+ imsize=[80,80]
1200
+ cell=[8.0arcsec,8.0arcsec]
1201
+ phasecenter=J2000 19:58:40.895 +40.55.58.543
1202
+ mask=circle[[40pix,40pix],10pix]
1203
+
1204
+ imagename=tst2
1205
+ nchan=1
1206
+ imsize=[100,100]
1207
+ cell=[8.0arcsec,8.0arcsec]
1208
+ phasecenter=J2000 19:58:40.895 +40.56.00.000
1209
+ mask=circle[[60pix,60pix],20pix]
1210
+
1211
+ The following parameters are currently allowed to be different between
1212
+ the main field and the outlier fields (i.e. they will be recognized if found
1213
+ in the outlier text file). If a parameter is not listed, the value is picked from
1214
+ what is defined in the main task input.
1215
+
1216
+ imagename, imsize, cell, phasecenter, startmodel, mask
1217
+ specmode, nchan, start, width, nterms, reffreq,
1218
+ gridder, deconvolver, wprojplanes.
1219
+
1220
+ Note : 'specmode' is an option, so combinations of mfs and cube
1221
+ for different image fields, for example, are supported.
1222
+ 'deconvolver' and 'gridder' are also options that allow different
1223
+ imaging or deconvolution algorithm per image field.
1224
+
1225
+ For example, multiscale with wprojection and 16 w-term planes
1226
+ on the main field and mtmfs with nterms=3 and wprojection
1227
+ with 64 planes on a bright outlier source for which the frequency
1228
+ dependence of the primary beam produces a strong effect that
1229
+ must be modeled. The traditional alternative to this approach is
1230
+ to first image the outlier, subtract it out of the data (uvsub) and
1231
+ then image the main field.
1232
+ weighting Weighting scheme (natural,uniform,briggs,superuniform,radial, briggsabs, briggsbwtaper).
1233
+
1234
+ During gridding of the dirty or residual image, each visibility value is
1235
+ multiplied by a weight before it is accumulated on the uv-grid.
1236
+ The PSF's uv-grid is generated by gridding only the weights (weightgrid).
1237
+
1238
+ weighting='natural' : Gridding weights are identical to the data weights
1239
+ from the MS. For visibilities with similar data weights,
1240
+ the weightgrid will follow the sample density
1241
+ pattern on the uv-plane. This weighting scheme
1242
+ provides the maximum imaging sensitivity at the
1243
+ expense of a PSF with possibly wider main lobes and high sidelobes.
1244
+ It is most appropriate for detection experiments
1245
+ where sensitivity is most important.
1246
+
1247
+ weighting='uniform' : Gridding weights per visibility data point are the
1248
+ original data weights divided by the total weight of
1249
+ all data points that map to the same uv grid cell :
1250
+ ' data_weight / total_wt_per_cell '.
1251
+
1252
+ The weightgrid is as close to flat as possible resulting
1253
+ in a PSF with a narrow main lobe and suppressed
1254
+ sidelobes. However, since heavily sampled areas of
1255
+ the uv-plane get down-weighted, the imaging
1256
+ sensitivity is not as high as with natural weighting.
1257
+ It is most appropriate for imaging experiments where
1258
+ a well behaved PSF can help the reconstruction.
1259
+
1260
+ weighting='briggs' : Gridding weights per visibility data point are given by
1261
+ 'data_weight / ( A \* total_wt_per_cell + B ) ' where
1262
+ A and B vary according to the 'robust' parameter.
1263
+
1264
+ robust = -2.0 maps to A=1,B=0 or uniform weighting.
1265
+ robust = +2.0 maps to natural weighting.
1266
+ (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.)
1267
+
1268
+ Robust/Briggs weighting generates a PSF that can
1269
+ vary smoothly between 'natural' and 'uniform' and
1270
+ allow customized trade-offs between PSF shape and
1271
+ imaging sensitivity.
1272
+ weighting='briggsabs' : Experimental option.
1273
+ Same as Briggs except the formula is different A=
1274
+ robust\*robust and B is dependent on the
1275
+ noise per visibility estimated. Giving noise='0Jy'
1276
+ is a not a reasonable option.
1277
+ In this mode (or formula) robust values
1278
+ from -2.0 to 0.0 only make sense (2.0 and
1279
+ -2.0 will get the same weighting)
1280
+
1281
+ weighting='superuniform' : This is similar to uniform weighting except that
1282
+ the total_wt_per_cell is replaced by the
1283
+ total_wt_within_NxN_cells around the uv cell of
1284
+ interest. N=7 is the default (when the
1285
+ parameter 'npixels' is set to 0 with 'superuniform')
1286
+
1287
+ This method tends to give a PSF with inner
1288
+ sidelobes that are suppressed as in uniform
1289
+ weighting but with far-out sidelobes closer to
1290
+ natural weighting. The peak sensitivity is also
1291
+ closer to natural weighting.
1292
+
1293
+ weighting='radial' : Gridding weights are given by ' data_weight \* uvdistance '
1294
+ This method approximately minimizes rms sidelobes
1295
+ for an east-west synthesis array.
1296
+
1297
+ weighting='briggsbwtaper' : A modified version of Briggs weighting for cubes where an inverse uv taper,
1298
+ which is proportional to the fractional bandwidth of the entire cube,
1299
+ is applied per channel. The objective is to modify cube (perchanweightdensity = True)
1300
+ imaging weights to have a similar density to that of the continuum imaging weights.
1301
+ This is currently an experimental weighting scheme being developed for ALMA.
1302
+
1303
+ For more details on weighting please see Chapter3
1304
+ of Dan Briggs' thesis (http://www.aoc.nrao.edu/dissertations/dbriggs)
1305
+ robust Robustness parameter for Briggs weighting.
1306
+
1307
+ robust = -2.0 maps to uniform weighting.
1308
+ robust = +2.0 maps to natural weighting.
1309
+ (robust=0.5 is equivalent to robust=0.0 in AIPS IMAGR.)
1310
+ noise noise parameter for briggs abs mode weighting
1311
+ npixels Number of pixels to determine uv-cell size for super-uniform weighting
1312
+ (0 defaults to -/+ 3 pixels).
1313
+
1314
+ npixels -- uv-box used for weight calculation
1315
+ a box going from -npixel/2 to +npixel/2 on each side
1316
+ around a point is used to calculate weight density.
1317
+
1318
+ npixels=2 goes from -1 to +1 and covers 3 pixels on a side.
1319
+
1320
+ npixels=0 implies a single pixel, which does not make sense for
1321
+ superuniform weighting. Therefore, for 'superuniform'
1322
+ weighting, if npixels=0 it will be forced to 6 (or a box
1323
+ of -3pixels to +3pixels) to cover 7 pixels on a side.
1324
+ uvtaper uv-taper on outer baselines in uv-plane.
1325
+
1326
+ Apply a Gaussian taper in addition to the weighting scheme specified
1327
+ via the 'weighting' parameter. Higher spatial frequencies are weighted
1328
+ down relative to lower spatial frequencies to suppress artifacts
1329
+ arising from poorly sampled areas of the uv-plane. It is equivalent to
1330
+ smoothing the PSF obtained by other weighting schemes and can be
1331
+ specified either as the HWHM of a Gaussian in uv-space (eg. units of lambda)
1332
+ or as the FWHM of a Gaussian in the image domain (eg. angular units like arcsec).
1333
+
1334
+ uvtaper = [bmaj, bmin, bpa].
1335
+
1336
+ Note : FWHM_uv_lambda = (4 log2) / ( pi * FWHM_lm_radians ).
1337
+
1338
+ A FWHM_lm of 100.000 arcsec maps to a HWHM_uv of 910.18 lambda.
1339
+ A FWHM_lm of 1 arcsec maps to a HWHM_uv of 91 klambda.
1340
+
1341
+ default: uvtaper=[]; no Gaussian taper applied.
1342
+ example: uvtaper=['5klambda'] circular taper of HWHM=5 kilo-lambda.
1343
+ uvtaper=['5klambda','3klambda','45.0deg'] uv-domain HWHM.
1344
+ uvtaper=['50arcsec','30arcsec','30.0deg'] : image domain FWHM.
1345
+ uvtaper=['10arcsec'] : image domain FWHM.
1346
+ uvtaper=['300.0'] default units are lambda in aperture plane.
1347
+ niter Maximum number of iterations.
1348
+
1349
+ A stopping criterion based on total iteration count.
1350
+ Currently the parameter type is defined as an integer therefore the integer value
1351
+ larger than 2147483647 will not be set properly as it causes an overflow.
1352
+
1353
+ Iterations are typically defined as the selecting one flux component
1354
+ and partially subtracting it out from the residual image.
1355
+
1356
+ niter=0 : Do only the initial major cycle (make dirty image, psf, pb, etc).
1357
+
1358
+ niter larger than zero : Run major and minor cycles.
1359
+
1360
+ Note : Global stopping criteria vs major-cycle triggers.
1361
+
1362
+ In addition to global stopping criteria, the following rules are
1363
+ used to determine when to terminate a set of minor cycle iterations
1364
+ and trigger major cycles [derived from Cotton-Schwab Clean, 1984].
1365
+
1366
+ 'cycleniter' : controls the maximum number of iterations per image
1367
+ plane before triggering a major cycle.
1368
+ 'cyclethreshold' : Automatically computed threshold related to the
1369
+ max sidelobe level of the PSF and peak residual.
1370
+ Divergence, detected as an increase of 10% in peak residual from the
1371
+ minimum so far (during minor cycle iterations).
1372
+
1373
+ The first criterion to be satisfied takes precedence.
1374
+
1375
+ Note : Iteration counts for cubes or multi-field images :
1376
+ For images with multiple planes (or image fields) on which the
1377
+ deconvolver operates in sequence, iterations are counted across
1378
+ all planes (or image fields). The iteration count is compared with
1379
+ 'niter' only after all channels/planes/fields have completed their
1380
+ minor cycles and exited either due to 'cycleniter' or 'cyclethreshold'.
1381
+ Therefore, the actual number of iterations reported in the logger
1382
+ can sometimes be larger than the user specified value in 'niter'.
1383
+ For example, with niter=100, cycleniter=20,nchan=10,threshold=0,
1384
+ a total of 200 iterations will be done in the first set of minor cycles
1385
+ before the total is compared with niter=100 and it exits.
1386
+
1387
+ Note : Additional global stopping criteria include:
1388
+ - no change in peak residual across two major cycles.
1389
+ - a 50% or more increase in peak residual across one major cycle.
1390
+ gain Loop gain.
1391
+
1392
+ Fraction of the source flux to subtract out of the residual image
1393
+ for the CLEAN algorithm and its variants.
1394
+
1395
+ A low value (0.2 or less) is recommended when the sky brightness
1396
+ distribution is not well represented by the basis functions used by
1397
+ the chosen deconvolution algorithm. A higher value can be tried when
1398
+ there is a good match between the true sky brightness structure and
1399
+ the basis function shapes. For example, for extended emission,
1400
+ multiscale clean with an appropriate set of scale sizes will tolerate
1401
+ a higher loop gain than Clark clean.
1402
+ threshold Stopping threshold (number in units of Jy, or string).
1403
+
1404
+ A global stopping threshold that the peak residual (within clean mask)
1405
+ across all image planes is compared to.
1406
+
1407
+ threshold = 0.005 : 5mJy
1408
+ threshold = '5.0mJy'
1409
+
1410
+ Note : A 'cyclethreshold' is internally computed and used as a major cycle
1411
+ trigger. It is related to what fraction of the PSF can be reliably
1412
+ used during minor cycle updates of the residual image. By default
1413
+ the minor cycle iterations terminate once the peak residual reaches
1414
+ the first sidelobe level of the brightest source.
1415
+
1416
+ 'cyclethreshold' is computed as follows using the settings in
1417
+ parameters 'cyclefactor','minpsffraction','maxpsffraction','threshold' :
1418
+
1419
+ psf_fraction = max_psf_sidelobe_level \* 'cyclefactor'
1420
+ psf_fraction = max(psf_fraction, 'minpsffraction');
1421
+ psf_fraction = min(psf_fraction, 'maxpsffraction');
1422
+ cyclethreshold = peak_residual \* psf_fraction
1423
+ cyclethreshold = max( cyclethreshold, 'threshold' )
1424
+
1425
+ If nsigma is set (>0.0), the N-sigma threshold is calculated (see
1426
+ the description under nsigma), then cyclethreshold is further modified as,
1427
+
1428
+ cyclethreshold = max( cyclethreshold, nsgima_threshold ).
1429
+
1430
+
1431
+ 'cyclethreshold' is made visible and editable only in the
1432
+ interactive GUI when tclean is run with interactive=True.
1433
+ nsigma Multiplicative factor for rms-based threshold stopping.
1434
+
1435
+ N-sigma threshold is calculated as nsigma \* rms value per image plane determined
1436
+ from a robust statistics. For nsigma > 0.0, in a minor cycle, a maximum of the two values,
1437
+ the N-sigma threshold and cyclethreshold, is used to trigger a major cycle
1438
+ (see also the descreption under 'threshold').
1439
+ Set nsigma=0.0 to preserve the previous tclean behavior without this feature.
1440
+ The top level parameter, fastnoise is relevant for the rms noise calculation which is used
1441
+ to determine the threshold.
1442
+
1443
+ The parameter 'nsigma' may be an int, float, or a double.
1444
+ cycleniter Maximum number of minor-cycle iterations (per plane) before triggering
1445
+ a major cycle.
1446
+
1447
+ For example, for a single plane image, if niter=100 and cycleniter=20,
1448
+ there will be 5 major cycles after the initial one (assuming there is no
1449
+ threshold based stopping criterion). At each major cycle boundary, if
1450
+ the number of iterations left over (to reach niter) is less than cycleniter,
1451
+ it is set to the difference.
1452
+
1453
+ Note : cycleniter applies per image plane, even if cycleniter x nplanes
1454
+ gives a total number of iterations greater than 'niter'. This is to
1455
+ preserve consistency across image planes within one set of minor
1456
+ cycle iterations.
1457
+ cyclefactor Scaling on PSF sidelobe level to compute the minor-cycle stopping threshold.
1458
+
1459
+ Please refer to the Note under the documentation for 'threshold' that
1460
+ discussed the calculation of 'cyclethreshold'.
1461
+
1462
+ cyclefactor=1.0 results in a cyclethreshold at the first sidelobe level of
1463
+ the brightest source in the residual image before the minor cycle starts.
1464
+
1465
+ cyclefactor=0.5 allows the minor cycle to go deeper.
1466
+ cyclefactor=2.0 triggers a major cycle sooner.
1467
+ minpsffraction PSF fraction that marks the max depth of cleaning in the minor cycle.
1468
+
1469
+ Please refer to the Note under the documentation for 'threshold' that
1470
+ discussed the calculation of 'cyclethreshold'.
1471
+
1472
+ For example, minpsffraction=0.5 will stop cleaning at half the height of
1473
+ the peak residual and trigger a major cycle earlier.
1474
+ maxpsffraction PSF fraction that marks the minimum depth of cleaning in the minor cycle.
1475
+
1476
+ Please refer to the Note under the documentation for 'threshold' that
1477
+ discussed the calculation of 'cyclethreshold'.
1478
+
1479
+ For example, maxpsffraction=0.8 will ensure that at least the top 20
1480
+ percent of the source will be subtracted out in the minor cycle even if
1481
+ the first PSF sidelobe is at the 0.9 level (an extreme example), or if the
1482
+ cyclefactor is set too high for anything to get cleaned.
1483
+ nmajor The nmajor parameter limits the number of minor and major cycle sets
1484
+ that tclean executes. It is defined as the number of major cycles after the
1485
+ initial set of minor cycle iterations. In other words, the count of nmajor does
1486
+ not include the initial residual calculation that occurs when calcres=True.
1487
+
1488
+ A setting of nmajor=-1 implies no limit (default -1).
1489
+ A setting of nmajor=0 implies nothing other than the initial residual calculation
1490
+ A setting of nmajor>0 imples that nmajor sets of minor and major cycles will
1491
+ be done in addition to the initial residual calculation.
1492
+
1493
+ If the major cycle limit is reached, stopcode 9 will be returned. Other stopping
1494
+ criteria (such as threshold) could cause tclean to stop in fewer than this
1495
+ number of major cycles. If tclean reaches another stopping criteria, first
1496
+ or at the same time as nmajor, then that stopcode will be returned instead.
1497
+
1498
+ Note however that major cycle ids in the log messages as well as in the return
1499
+ dictionary do begin with 1 for the initial residual calculation, when it exists.
1500
+
1501
+ Example 1 : A tclean run with 'nmajor=5' and 'calcres=True' will iterate for
1502
+ 5 major cycles (not counting the initial residual calculation). But, the return
1503
+ dictionary will show 'nmajordone:6'. If 'calcres=False', then the return
1504
+ dictionary will show 'nmajordone:5'.
1505
+
1506
+ Example 2 : For both the following cases, there will be a printout in the logs
1507
+ "Running Major Cycle 1" and the return value will include "nmajordone: 1",
1508
+ however there is a difference in the purpose of the major cycle and the
1509
+ number of minor cycles executed:
1510
+ Case 1; nmajor=0, calcres=True: The major cycle done is for the creation
1511
+ of the residual, and no minor cycles are executed.
1512
+ Case 2; nmajor=1, calcres=False: The major cycle is done as part of the
1513
+ major/minor cycle loop, and 1 minor cycle will be executed.
1514
+ usemask Type of mask(s) to be used for deconvolution.
1515
+
1516
+ user: (default) mask image(s) or user specified region file(s) or string CRTF expression(s).
1517
+ subparameters: mask, pbmask.
1518
+ pb: primary beam mask.
1519
+ subparameter: pbmask.
1520
+
1521
+ Example: usemask="pb", pbmask=0.2.
1522
+ Construct a mask at the 0.2 pb gain level.
1523
+ (Currently, this option will work only with
1524
+
1525
+ gridders that produce .pb (i.e. mosaic, awp2 and awproject)
1526
+ or if an externally produced .pb image exists on disk)
1527
+
1528
+
1529
+ auto-multithresh : auto-masking by multiple thresholds for deconvolution.
1530
+ subparameters : sidelobethreshold, noisethreshold, lownoisethreshold, negativethrehsold, smoothfactor,
1531
+ minbeamfrac, cutthreshold, pbmask, growiterations, dogrowprune, minpercentchange, verbose.
1532
+ Additional top level parameter relevant to auto-multithresh: fastnoise.
1533
+
1534
+ if pbmask is >0.0, the region outside the specified pb gain level is excluded from
1535
+ image statistics in determination of the threshold.
1536
+
1537
+
1538
+
1539
+
1540
+ Note: By default the intermediate mask generated by automask at each deconvolution cycle
1541
+ is over-written in the next cycle but one can save them by setting
1542
+ the environment variable, SAVE_ALL_AUTOMASKS="true".
1543
+ (e.g. in the CASA prompt, os.environ['SAVE_ALL_AUTOMASKS']="true" )
1544
+ The saved CASA mask image name will be imagename.mask.autothresh#, where
1545
+ # is the iteration cycle number.
1546
+ mask Mask (a list of image name(s) or region file(s) or region string(s).
1547
+
1548
+
1549
+ The name of a CASA image or region file or region string that specifies
1550
+ a 1/0 mask to be used for deconvolution. Only locations with value 1 will
1551
+ be considered for the centers of flux components in the minor cycle.
1552
+ If regions specified fall completely outside of the image, tclean will throw an error.
1553
+
1554
+ Manual mask options/examples :
1555
+
1556
+ mask='xxx.mask' : Use this CASA image named xxx.mask and containing
1557
+ ones and zeros as the mask.
1558
+ If the mask is only different in spatial coordinates from what is being made
1559
+ it will be resampled to the target coordinate system before being used.
1560
+ The mask has to have the same shape in velocity and Stokes planes
1561
+ as the output image. Exceptions are single velocity and/or single
1562
+ Stokes plane masks. They will be expanded to cover all velocity and/or
1563
+ Stokes planes of the output cube.
1564
+
1565
+ [ Note : If an error occurs during image resampling or
1566
+ if the expected mask does not appear, please try
1567
+ using tasks 'imregrid' or 'makemask' to resample
1568
+ the mask image onto a CASA image with the target
1569
+ shape and coordinates and supply it via the 'mask'
1570
+ parameter. ]
1571
+
1572
+
1573
+ mask='xxx.crtf' : A text file with region strings and the following on the first line
1574
+ ( #CRTFv0 CASA Region Text Format version 0 )
1575
+ This is the format of a file created via the viewer's region
1576
+ tool when saved in CASA region file format.
1577
+
1578
+ mask='circle[[40pix,40pix],10pix]' : A CASA region string.
1579
+
1580
+ mask=['xxx.mask','xxx.crtf', 'circle[[40pix,40pix],10pix]'] : a list of masks.
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+ Note : Mask images for deconvolution must contain 1 or 0 in each pixel.
1587
+ Such a mask is different from an internal T/F mask that can be
1588
+ held within each CASA image. These two types of masks are not
1589
+ automatically interchangeable, so please use the makemask task
1590
+ to copy between them if you need to construct a 1/0 based mask
1591
+ from a T/F one.
1592
+
1593
+ Note : Work is in progress to generate more flexible masking options and
1594
+ enable more controls.
1595
+ pbmask Sub-parameter for usemask: primary beam mask.
1596
+
1597
+ Examples : pbmask=0.0 (default, no pb mask).
1598
+ pbmask=0.2 (construct a mask at the 0.2 pb gain level).
1599
+ sidelobethreshold Sub-parameter for "auto-multithresh": mask threshold based on sidelobe levels: sidelobethreshold \* max_sidelobe_level \* peak residual.
1600
+ noisethreshold Sub-parameter for "auto-multithresh": mask threshold based on the noise level: noisethreshold \* rms + location (=median).
1601
+
1602
+ The rms is calculated from the median absolute deviation (MAD), with rms = 1.4826\*MAD.
1603
+ lownoisethreshold Sub-parameter for "auto-multithresh": mask threshold to grow previously masked regions via binary dilation: lownoisethreshold \* rms in residual image + location (=median).
1604
+
1605
+ The rms is calculated from the median absolute deviation (MAD), with rms = 1.4826\*MAD.
1606
+ negativethreshold Sub-parameter for "auto-multithresh": mask threshold for negative features: -1.0* negativethreshold \* rms + location(=median).
1607
+
1608
+ The rms is calculated from the median absolute deviation (MAD), with rms = 1.4826\*MAD.
1609
+ smoothfactor Sub-parameter for "auto-multithresh": smoothing factor in a unit of the beam.
1610
+ minbeamfrac Sub-parameter for "auto-multithresh": minimum beam fraction in size to prune masks smaller than mimbeamfrac \* beam
1611
+ <=0.0 : No pruning
1612
+ cutthreshold Sub-parameter for "auto-multithresh": threshold to cut the smoothed mask to create a final mask: cutthreshold \* peak of the smoothed mask.
1613
+ growiterations Sub-parameter for "auto-multithresh": Maximum number of iterations to perform using binary dilation for growing the mask.
1614
+ dogrowprune Experimental sub-parameter for "auto-multithresh": Do pruning on the grow mask.
1615
+ 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.
1616
+ verbose he summary of automasking at the end of each automasking process
1617
+ is printed in the logger. Following information per channel will be listed in the summary.
1618
+
1619
+ chan: channel number.
1620
+ masking?: F - stop updating automask for the subsequent iteration cycles.
1621
+ RMS: robust rms noise.
1622
+ peak: peak in residual image.
1623
+ thresh_type: type of threshold used (noise or sidelobe).
1624
+ thresh_value: the value of threshold used.
1625
+ N_reg: number of the automask regions.
1626
+ N_pruned: number of the automask regions removed by pruning.
1627
+ N_grow: number of the grow mask regions.
1628
+ N_grow_pruned: number of the grow mask regions removed by pruning.
1629
+ N_neg_pix: number of pixels for negative mask regions.
1630
+
1631
+ Note that for a large cube, extra logging may slow down the process.
1632
+ 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.
1633
+ In this case, the threshold values are determined based on classic statistics (using all
1634
+ unmasked pixels for the calculations).
1635
+
1636
+ If it is set to False, the new noise calculation
1637
+ method is used based on pre-existing mask.
1638
+
1639
+ Case 1: no exiting mask.
1640
+ Calculate image statistics using Chauvenet algorithm.
1641
+
1642
+ Case 2: there is an existing mask.
1643
+ Calculate image statistics by classical method on the region
1644
+ outside the mask and inside the primary beam mask.
1645
+
1646
+ In all cases above RMS noise is calculated from the median absolute deviation (MAD).
1647
+ restart images (and start from an existing model image)
1648
+ or automatically increment the image name and make a new image set.
1649
+
1650
+ True : Re-use existing images. If imagename.model exists the subsequent
1651
+ run will start from this model (i.e. predicting it using current gridder
1652
+ settings and starting from the residual image). Care must be taken
1653
+ when combining this option with startmodel. Currently, only one or
1654
+ the other can be used.
1655
+
1656
+ startmodel='', imagename.model exists :
1657
+ - Start from imagename.model.
1658
+ startmodel='xxx', imagename.model does not exist :
1659
+ - Start from startmodel.
1660
+ startmodel='xxx', imagename.model exists :
1661
+ - Exit with an error message requesting the user to pick
1662
+ only one model. This situation can arise when doing one
1663
+ run with startmodel='xxx' to produce an output
1664
+ imagename.model that includes the content of startmodel,
1665
+ and wanting to restart a second run to continue deconvolution.
1666
+ Startmodel should be set to '' before continuing.
1667
+
1668
+ If any change in the shape or coordinate system of the image is
1669
+ desired during the restart, please change the image name and
1670
+ use the startmodel (and mask) parameter(s) so that the old model
1671
+ (and mask) can be regridded to the new coordinate system before starting.
1672
+
1673
+ False : A convenience feature to increment imagename with '_1', '_2',
1674
+ etc as suffixes so that all runs of tclean are fresh starts (without
1675
+ having to change the imagename parameter or delete images).
1676
+
1677
+ This mode will search the current directory for all existing
1678
+ imagename extensions, pick the maximum, and adds 1.
1679
+ For imagename='try' it will make try.psf, try_2.psf, try_3.psf, etc.
1680
+
1681
+ This also works if you specify a directory name in the path :
1682
+ imagename='outdir/try'. If './outdir' does not exist, it will create it.
1683
+ Then it will search for existing filenames inside that directory.
1684
+
1685
+ If outlier fields are specified, the incrementing happens for each
1686
+ of them (since each has its own 'imagename'). The counters are
1687
+ synchronized across imagefields, to make it easier to match up sets
1688
+ of output images. It adds 1 to the 'max id' from all outlier names
1689
+ on disk. So, if you do two runs with only the main field
1690
+ (imagename='try'), and in the third run you add an outlier with
1691
+ imagename='outtry', you will get the following image names
1692
+ for the third run : 'try_3' and 'outtry_3' even though
1693
+ 'outry' and 'outtry_2' have not been used.
1694
+ savemodel Options to save model visibilities (none, virtual, modelcolumn).
1695
+
1696
+ Often, model visibilities must be created and saved in the MS
1697
+ to be later used for self-calibration (or to just plot and view them).
1698
+
1699
+ none : Do not save any model visibilities in the MS. The MS is opened
1700
+ in readonly mode.
1701
+
1702
+ Model visibilities can be predicted in a separate step by
1703
+ restarting tclean with niter=0,savemodel=virtual or modelcolumn
1704
+ and not changing any image names so that it finds the .model on
1705
+ disk (or by changing imagename and setting startmodel to the
1706
+ original imagename).
1707
+
1708
+ virtual : In the last major cycle, save the image model and state of the
1709
+ gridder used during imaging within the SOURCE subtable of the
1710
+ MS. Images required for de-gridding will also be stored internally.
1711
+ All future references to model visibilities will activate the
1712
+ (de)gridder to compute them on-the-fly. This mode is useful
1713
+ when the dataset is large enough that an additional model data
1714
+ column on disk may be too much extra disk I/O, when the
1715
+ gridder is simple enough that on-the-fly recomputing of the
1716
+ model visibilities is quicker than disk I/O.
1717
+ For e.g. that gridder='awproject' and 'awp2' does not support virtual model.
1718
+
1719
+ modelcolumn : In the last major cycle, save predicted model visibilities
1720
+ in the MODEL_DATA column of the MS. This mode is useful when
1721
+ the de-gridding cost to produce the model visibilities is higher
1722
+ than the I/O required to read the model visibilities from disk.
1723
+ This mode is currently required for gridder='awproject' and 'awp2'.
1724
+ This mode is also required for the ability to later pull out
1725
+ model visibilities from the MS into a python array for custom
1726
+ processing.
1727
+
1728
+ Note 1 : The imagename.model image on disk will always be constructed
1729
+ if the minor cycle runs. This savemodel parameter applies only to
1730
+ model visibilities created by de-gridding the model image.
1731
+
1732
+ Note 2 : It is possible for an MS to have both a virtual model
1733
+ as well as a model_data column, but under normal operation,
1734
+ the last used mode will get triggered. Use the delmod task to
1735
+ clear out existing models from an MS if confusion arises.
1736
+ Note 3: when parallel=True, use savemodel='none'; Other options are not yet ready
1737
+ for use in parallel. If model visibilities need to be saved (virtual or modelcolumn):
1738
+ please run tclean in serial mode with niter=0; after the parallel run
1739
+ calcres Calculate initial residual image.
1740
+
1741
+ This parameter controls what the first major cycle does.
1742
+
1743
+ calcres=False with niter greater than 0 will assume that
1744
+ a .residual image already exists and that the minor cycle can
1745
+ begin without recomputing it.
1746
+
1747
+ calcres=False with niter=0 implies that only the PSF will be made
1748
+ and no data will be gridded.
1749
+
1750
+ calcres=True requires that calcpsf=True or that the .psf and .sumwt
1751
+ images already exist on disk (for normalization purposes).
1752
+
1753
+ Usage example : For large runs (or a pipeline scripts) it may be
1754
+ useful to first run tclean with niter=0 to create
1755
+ an initial .residual to look at and perhaps make
1756
+ a custom mask for. Imaging can be resumed
1757
+ without recomputing it.
1758
+ calcpsf Calculate PSF
1759
+
1760
+ This parameter controls what the first major cycle does.
1761
+
1762
+ calcpsf=False will assume that a .psf image already exists
1763
+ and that the minor cycle can begin without recomputing it.
1764
+ psfcutoff When the .psf image is created a 2 dimensional Gaussian is fit to the main lobe of the PSF.
1765
+ Which pixels in the PSF are fitted is determined by psfcutoff.
1766
+ The default value of psfcutoff is 0.35 and can varied from 0.01 to 0.99.
1767
+ Fitting algorithm:
1768
+ - A region of 41 x 41 pixels around the peak of the PSF is compared against the psfcutoff.
1769
+ Sidelobes are ignored by radially searching from the PSF peak.
1770
+ - Calculate the bottom left corner (blc) and top right corner (trc) from the points. Expand blc and trc with a number of pixels (5).
1771
+ - Create a new sub-matrix from blc and trc.
1772
+ - Interpolate matrix to a target number of points (3001) using CUBIC spline.
1773
+ - All the non-sidelobe points, in the interpolated matrix, that are above the psfcutoff are used to fit a Gaussian.
1774
+ A Levenberg-Marquardt algorithm is used.
1775
+ - If the fitting fails the algorithm is repeated with the psfcutoff decreased (psfcutoff=psfcutoff/1.5).
1776
+ A message in the log will apear if the fitting fails along with the new value of psfcutoff.
1777
+ This will be done up to 50 times if fitting fails.
1778
+ This Gaussian beam is defined by a major axis, minor axis, and position angle.
1779
+ During the restoration process, this Gaussian beam is used as the Clean beam.
1780
+ Varying psfcutoff might be useful for producing a better fit for highly non-Gaussian PSFs, however, the resulting fits should be carefully checked.
1781
+ This parameter should rarely be changed.
1782
+
1783
+ (This is not the support size for clark clean.)
1784
+ parallel Run major cycles in parallel.
1785
+
1786
+ Parallel tclean will run only if casa has already been started using mpirun.
1787
+ Please refer to external resources on high performance computing for details on how to start this on your system.
1788
+
1789
+ Example : mpirun -n 3 -xterm 0 `which casa`
1790
+
1791
+ Continuum Imaging :
1792
+ - Data are partitioned (in time) into NProc pieces.
1793
+ - Gridding/iFT is done separately per partition.
1794
+ - Images (and weights) are gathered and then normalized.
1795
+ - One non-parallel minor cycle is run.
1796
+ - Model image is scattered to all processes.
1797
+ - Major cycle is done in parallel per partition.
1798
+
1799
+ Cube Imaging :
1800
+ - Data and Image coordinates are partitioned (in freq) into NProc pieces.
1801
+ - Each partition is processed independently (major and minor cycles).
1802
+ - All processes are synchronized at major cycle boundaries for convergence checks.
1803
+ - At the end, cubes from all partitions are concatenated along the spectral axis.
1804
+
1805
+ Note 1 : Iteration control for cube imaging is independent per partition.
1806
+ - There is currently no communication between them to synchronize
1807
+ information such as peak residual and cyclethreshold. Therefore,
1808
+ different chunks may trigger major cycles at different levels.
1809
+ (Proper synchronization of iteration control is work in progress.)
1810
+ RETURNS void
1811
+
1812
+ --------- examples -----------------------------------------------------------
1813
+
1814
+
1815
+
1816
+ For more information, see the task pages of tclean in CASA Docs:
1817
+
1818
+ https://casadocs.readthedocs.io
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+ """
1825
+
1826
+ _info_group_ = """imaging"""
1827
+ _info_desc_ = """Radio Interferometric Image Reconstruction w/ interactive masking"""
1828
+
1829
+ __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', 'awphpg', 'imagemosaic', 'standard', 'awproject', 'wprojectft', 'mosaicft', 'ft', 'ftmosaic', 'mosaic', 'awprojectft', 'gridft', 'awp2' ]}, '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}, 'nmajor': {'type': 'cInt'}, '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'}, }
1830
+
1831
+ def __init__(self):
1832
+ self.__stdout = None
1833
+ self.__stderr = None
1834
+ self.__root_frame_ = None
1835
+
1836
+ def __globals_(self):
1837
+ if self.__root_frame_ is None:
1838
+ self.__root_frame_ = _find_frame( )
1839
+ assert self.__root_frame_ is not None, "could not find CASAshell global frame"
1840
+ return self.__root_frame_
1841
+
1842
+ def __to_string_(self,value):
1843
+ if type(value) is str:
1844
+ return "'%s'" % value
1845
+ else:
1846
+ return str(value)
1847
+
1848
+ def __validate_(self,doc,schema):
1849
+ return _pc.validate(doc,schema)
1850
+
1851
+ def __do_inp_output(self,param_prefix,description_str,formatting_chars):
1852
+ out = self.__stdout or sys.stdout
1853
+ description = description_str.split( )
1854
+ prefix_width = 23 + 23 + 4
1855
+ output = [ ]
1856
+ addon = ''
1857
+ first_addon = True
1858
+ if len(description) == 0:
1859
+ out.write(param_prefix + " #\n")
1860
+ return
1861
+ while len(description) > 0:
1862
+ ## starting a new line.....................................................................
1863
+ if len(output) == 0:
1864
+ ## for first line add parameter information............................................
1865
+ if len(param_prefix)-formatting_chars > prefix_width - 1:
1866
+ output.append(param_prefix)
1867
+ continue
1868
+ addon = param_prefix + ' #'
1869
+ first_addon = True
1870
+ addon_formatting = formatting_chars
1871
+ else:
1872
+ ## for subsequent lines space over prefix width........................................
1873
+ addon = (' ' * prefix_width) + '#'
1874
+ first_addon = False
1875
+ addon_formatting = 0
1876
+ ## if first word of description puts us over the screen width, bail........................
1877
+ if len(addon + description[0]) - addon_formatting + 1 > self.term_width:
1878
+ ## if we're doing the first line make sure it's output.................................
1879
+ if first_addon: output.append(addon)
1880
+ break
1881
+ while len(description) > 0:
1882
+ ## if the next description word puts us over break for the next line...................
1883
+ if len(addon + description[0]) - addon_formatting + 1 > self.term_width: break
1884
+ addon = addon + ' ' + description[0]
1885
+ description.pop(0)
1886
+ output.append(addon)
1887
+ out.write('\n'.join(output) + '\n')
1888
+
1889
+ #--------- go functions -----------------------------------------------------------
1890
+ def __vis_dflt( self, glb ):
1891
+ return ''
1892
+
1893
+ def __vis( self, glb ):
1894
+ if 'vis' in glb: return glb['vis']
1895
+ return ''
1896
+
1897
+ def __vis_inp(self):
1898
+ def xml_default( ):
1899
+ ## play the crazy subparameter shell game
1900
+ dflt = self.__vis_dflt( self.__globals_( ) )
1901
+ if dflt is not None: return dflt
1902
+ return ''
1903
+ description = 'Name of input visibility file(s)'
1904
+ value = self.__vis( self.__globals_( ) )
1905
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'vis': value},{'vis': self.__schema['vis']}) else ('\x1B[91m','\x1B[0m')
1906
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('vis',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
1907
+
1908
+ def __selectdata_dflt( self, glb ):
1909
+ return True
1910
+
1911
+ def __selectdata( self, glb ):
1912
+ if 'selectdata' in glb: return glb['selectdata']
1913
+ return True
1914
+
1915
+ def __selectdata_inp(self):
1916
+ def xml_default( ):
1917
+ ## play the crazy subparameter shell game
1918
+ dflt = self.__selectdata_dflt( self.__globals_( ) )
1919
+ if dflt is not None: return dflt
1920
+ return True
1921
+ description = 'Enable data selection parameters'
1922
+ value = self.__selectdata( self.__globals_( ) )
1923
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'selectdata': value},{'selectdata': self.__schema['selectdata']}) else ('\x1B[91m','\x1B[0m')
1924
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('selectdata',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
1925
+
1926
+ def __field_dflt( self, glb ):
1927
+ if self.__selectdata( glb ) == bool(True): return ""
1928
+ return None
1929
+
1930
+ def __field( self, glb ):
1931
+ if 'field' in glb: return glb['field']
1932
+ dflt = self.__field_dflt( glb )
1933
+ if dflt is not None: return dflt
1934
+ return ''
1935
+
1936
+ def __field_inp(self):
1937
+ def xml_default( ):
1938
+ ## play the crazy subparameter shell game
1939
+ dflt = self.__field_dflt( self.__globals_( ) )
1940
+ if dflt is not None: return dflt
1941
+ return ''
1942
+ if self.__field_dflt( self.__globals_( ) ) is not None:
1943
+ description = 'field(s) to select'
1944
+ value = self.__field( self.__globals_( ) )
1945
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'field': value},{'field': self.__schema['field']}) else ('\x1B[91m','\x1B[0m')
1946
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('field',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
1947
+
1948
+ def __spw_dflt( self, glb ):
1949
+ if self.__selectdata( glb ) == bool(True): return ""
1950
+ return None
1951
+
1952
+ def __spw( self, glb ):
1953
+ if 'spw' in glb: return glb['spw']
1954
+ dflt = self.__spw_dflt( glb )
1955
+ if dflt is not None: return dflt
1956
+ return ''
1957
+
1958
+ def __spw_inp(self):
1959
+ def xml_default( ):
1960
+ ## play the crazy subparameter shell game
1961
+ dflt = self.__spw_dflt( self.__globals_( ) )
1962
+ if dflt is not None: return dflt
1963
+ return ''
1964
+ if self.__spw_dflt( self.__globals_( ) ) is not None:
1965
+ description = 'spw(s)/channels to select'
1966
+ value = self.__spw( self.__globals_( ) )
1967
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'spw': value},{'spw': self.__schema['spw']}) else ('\x1B[91m','\x1B[0m')
1968
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('spw',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
1969
+
1970
+ def __timerange_dflt( self, glb ):
1971
+ if self.__selectdata( glb ) == bool(True): return ""
1972
+ return None
1973
+
1974
+ def __timerange( self, glb ):
1975
+ if 'timerange' in glb: return glb['timerange']
1976
+ dflt = self.__timerange_dflt( glb )
1977
+ if dflt is not None: return dflt
1978
+ return ''
1979
+
1980
+ def __timerange_inp(self):
1981
+ def xml_default( ):
1982
+ ## play the crazy subparameter shell game
1983
+ dflt = self.__timerange_dflt( self.__globals_( ) )
1984
+ if dflt is not None: return dflt
1985
+ return ''
1986
+ if self.__timerange_dflt( self.__globals_( ) ) is not None:
1987
+ description = 'Range of time to select from data'
1988
+ value = self.__timerange( self.__globals_( ) )
1989
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'timerange': value},{'timerange': self.__schema['timerange']}) else ('\x1B[91m','\x1B[0m')
1990
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('timerange',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
1991
+
1992
+ def __uvrange_dflt( self, glb ):
1993
+ if self.__selectdata( glb ) == bool(True): return ""
1994
+ return None
1995
+
1996
+ def __uvrange( self, glb ):
1997
+ if 'uvrange' in glb: return glb['uvrange']
1998
+ dflt = self.__uvrange_dflt( glb )
1999
+ if dflt is not None: return dflt
2000
+ return ''
2001
+
2002
+ def __uvrange_inp(self):
2003
+ def xml_default( ):
2004
+ ## play the crazy subparameter shell game
2005
+ dflt = self.__uvrange_dflt( self.__globals_( ) )
2006
+ if dflt is not None: return dflt
2007
+ return ''
2008
+ if self.__uvrange_dflt( self.__globals_( ) ) is not None:
2009
+ description = 'Select data within uvrange'
2010
+ value = self.__uvrange( self.__globals_( ) )
2011
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'uvrange': value},{'uvrange': self.__schema['uvrange']}) else ('\x1B[91m','\x1B[0m')
2012
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('uvrange',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2013
+
2014
+ def __antenna_dflt( self, glb ):
2015
+ if self.__selectdata( glb ) == bool(True): return ""
2016
+ return None
2017
+
2018
+ def __antenna( self, glb ):
2019
+ if 'antenna' in glb: return glb['antenna']
2020
+ dflt = self.__antenna_dflt( glb )
2021
+ if dflt is not None: return dflt
2022
+ return ''
2023
+
2024
+ def __antenna_inp(self):
2025
+ def xml_default( ):
2026
+ ## play the crazy subparameter shell game
2027
+ dflt = self.__antenna_dflt( self.__globals_( ) )
2028
+ if dflt is not None: return dflt
2029
+ return ''
2030
+ if self.__antenna_dflt( self.__globals_( ) ) is not None:
2031
+ description = 'Select data based on antenna/baseline'
2032
+ value = self.__antenna( self.__globals_( ) )
2033
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'antenna': value},{'antenna': self.__schema['antenna']}) else ('\x1B[91m','\x1B[0m')
2034
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('antenna',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2035
+
2036
+ def __scan_dflt( self, glb ):
2037
+ if self.__selectdata( glb ) == bool(True): return ""
2038
+ return None
2039
+
2040
+ def __scan( self, glb ):
2041
+ if 'scan' in glb: return glb['scan']
2042
+ dflt = self.__scan_dflt( glb )
2043
+ if dflt is not None: return dflt
2044
+ return ''
2045
+
2046
+ def __scan_inp(self):
2047
+ def xml_default( ):
2048
+ ## play the crazy subparameter shell game
2049
+ dflt = self.__scan_dflt( self.__globals_( ) )
2050
+ if dflt is not None: return dflt
2051
+ return ''
2052
+ if self.__scan_dflt( self.__globals_( ) ) is not None:
2053
+ description = 'Scan number range'
2054
+ value = self.__scan( self.__globals_( ) )
2055
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'scan': value},{'scan': self.__schema['scan']}) else ('\x1B[91m','\x1B[0m')
2056
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('scan',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2057
+
2058
+ def __observation_dflt( self, glb ):
2059
+ if self.__selectdata( glb ) == bool(True): return ""
2060
+ return None
2061
+
2062
+ def __observation( self, glb ):
2063
+ if 'observation' in glb: return glb['observation']
2064
+ dflt = self.__observation_dflt( glb )
2065
+ if dflt is not None: return dflt
2066
+ return ''
2067
+
2068
+ def __observation_inp(self):
2069
+ def xml_default( ):
2070
+ ## play the crazy subparameter shell game
2071
+ dflt = self.__observation_dflt( self.__globals_( ) )
2072
+ if dflt is not None: return dflt
2073
+ return ''
2074
+ if self.__observation_dflt( self.__globals_( ) ) is not None:
2075
+ description = 'Observation ID range'
2076
+ value = self.__observation( self.__globals_( ) )
2077
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'observation': value},{'observation': self.__schema['observation']}) else ('\x1B[91m','\x1B[0m')
2078
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('observation',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2079
+
2080
+ def __intent_dflt( self, glb ):
2081
+ if self.__selectdata( glb ) == bool(True): return ""
2082
+ return None
2083
+
2084
+ def __intent( self, glb ):
2085
+ if 'intent' in glb: return glb['intent']
2086
+ dflt = self.__intent_dflt( glb )
2087
+ if dflt is not None: return dflt
2088
+ return ''
2089
+
2090
+ def __intent_inp(self):
2091
+ def xml_default( ):
2092
+ ## play the crazy subparameter shell game
2093
+ dflt = self.__intent_dflt( self.__globals_( ) )
2094
+ if dflt is not None: return dflt
2095
+ return ''
2096
+ if self.__intent_dflt( self.__globals_( ) ) is not None:
2097
+ description = 'Scan Intent(s)'
2098
+ value = self.__intent( self.__globals_( ) )
2099
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'intent': value},{'intent': self.__schema['intent']}) else ('\x1B[91m','\x1B[0m')
2100
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('intent',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2101
+
2102
+ def __datacolumn_dflt( self, glb ):
2103
+ return 'corrected'
2104
+
2105
+ def __datacolumn( self, glb ):
2106
+ if 'datacolumn' in glb: return glb['datacolumn']
2107
+ return 'corrected'
2108
+
2109
+ def __datacolumn_inp(self):
2110
+ def xml_default( ):
2111
+ ## play the crazy subparameter shell game
2112
+ dflt = self.__datacolumn_dflt( self.__globals_( ) )
2113
+ if dflt is not None: return dflt
2114
+ return 'corrected'
2115
+ description = 'Data column to image(data,corrected)'
2116
+ value = self.__datacolumn( self.__globals_( ) )
2117
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'datacolumn': value},{'datacolumn': self.__schema['datacolumn']}) else ('\x1B[91m','\x1B[0m')
2118
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('datacolumn',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2119
+
2120
+ def __imagename_dflt( self, glb ):
2121
+ return ''
2122
+
2123
+ def __imagename( self, glb ):
2124
+ if 'imagename' in glb: return glb['imagename']
2125
+ return ''
2126
+
2127
+ def __imagename_inp(self):
2128
+ def xml_default( ):
2129
+ ## play the crazy subparameter shell game
2130
+ dflt = self.__imagename_dflt( self.__globals_( ) )
2131
+ if dflt is not None: return dflt
2132
+ return ''
2133
+ description = 'Pre-name of output images'
2134
+ value = self.__imagename( self.__globals_( ) )
2135
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'imagename': value},{'imagename': self.__schema['imagename']}) else ('\x1B[91m','\x1B[0m')
2136
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('imagename',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2137
+
2138
+ def __imsize_dflt( self, glb ):
2139
+ return [ int(100) ]
2140
+
2141
+ def __imsize( self, glb ):
2142
+ if 'imsize' in glb: return glb['imsize']
2143
+ return [ int(100) ]
2144
+
2145
+ def __imsize_inp(self):
2146
+ def xml_default( ):
2147
+ ## play the crazy subparameter shell game
2148
+ dflt = self.__imsize_dflt( self.__globals_( ) )
2149
+ if dflt is not None: return dflt
2150
+ return [ int(100) ]
2151
+ description = 'Number of pixels'
2152
+ value = self.__imsize( self.__globals_( ) )
2153
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'imsize': value},{'imsize': self.__schema['imsize']}) else ('\x1B[91m','\x1B[0m')
2154
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('imsize',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2155
+
2156
+ def __cell_dflt( self, glb ):
2157
+ return [ ]
2158
+
2159
+ def __cell( self, glb ):
2160
+ if 'cell' in glb: return glb['cell']
2161
+ return [ ]
2162
+
2163
+ def __cell_inp(self):
2164
+ def xml_default( ):
2165
+ ## play the crazy subparameter shell game
2166
+ dflt = self.__cell_dflt( self.__globals_( ) )
2167
+ if dflt is not None: return dflt
2168
+ return [ ]
2169
+ description = 'Cell size'
2170
+ value = self.__cell( self.__globals_( ) )
2171
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'cell': value},{'cell': self.__schema['cell']}) else ('\x1B[91m','\x1B[0m')
2172
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('cell',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2173
+
2174
+ def __phasecenter_dflt( self, glb ):
2175
+ return ''
2176
+
2177
+ def __phasecenter( self, glb ):
2178
+ if 'phasecenter' in glb: return glb['phasecenter']
2179
+ return ''
2180
+
2181
+ def __phasecenter_inp(self):
2182
+ def xml_default( ):
2183
+ ## play the crazy subparameter shell game
2184
+ dflt = self.__phasecenter_dflt( self.__globals_( ) )
2185
+ if dflt is not None: return dflt
2186
+ return ''
2187
+ description = 'Phase center of the image'
2188
+ value = self.__phasecenter( self.__globals_( ) )
2189
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'phasecenter': value},{'phasecenter': self.__schema['phasecenter']}) else ('\x1B[91m','\x1B[0m')
2190
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('phasecenter',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2191
+
2192
+ def __stokes_dflt( self, glb ):
2193
+ return 'I'
2194
+
2195
+ def __stokes( self, glb ):
2196
+ if 'stokes' in glb: return glb['stokes']
2197
+ return 'I'
2198
+
2199
+ def __stokes_inp(self):
2200
+ def xml_default( ):
2201
+ ## play the crazy subparameter shell game
2202
+ dflt = self.__stokes_dflt( self.__globals_( ) )
2203
+ if dflt is not None: return dflt
2204
+ return 'I'
2205
+ description = 'Stokes Planes to make'
2206
+ value = self.__stokes( self.__globals_( ) )
2207
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'stokes': value},{'stokes': self.__schema['stokes']}) else ('\x1B[91m','\x1B[0m')
2208
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('stokes',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2209
+
2210
+ def __projection_dflt( self, glb ):
2211
+ return 'SIN'
2212
+
2213
+ def __projection( self, glb ):
2214
+ if 'projection' in glb: return glb['projection']
2215
+ return 'SIN'
2216
+
2217
+ def __projection_inp(self):
2218
+ def xml_default( ):
2219
+ ## play the crazy subparameter shell game
2220
+ dflt = self.__projection_dflt( self.__globals_( ) )
2221
+ if dflt is not None: return dflt
2222
+ return 'SIN'
2223
+ description = 'Coordinate projection'
2224
+ value = self.__projection( self.__globals_( ) )
2225
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'projection': value},{'projection': self.__schema['projection']}) else ('\x1B[91m','\x1B[0m')
2226
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('projection',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2227
+
2228
+ def __startmodel_dflt( self, glb ):
2229
+ return ''
2230
+
2231
+ def __startmodel( self, glb ):
2232
+ if 'startmodel' in glb: return glb['startmodel']
2233
+ return ''
2234
+
2235
+ def __startmodel_inp(self):
2236
+ def xml_default( ):
2237
+ ## play the crazy subparameter shell game
2238
+ dflt = self.__startmodel_dflt( self.__globals_( ) )
2239
+ if dflt is not None: return dflt
2240
+ return ''
2241
+ description = 'Name of starting model image'
2242
+ value = self.__startmodel( self.__globals_( ) )
2243
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'startmodel': value},{'startmodel': self.__schema['startmodel']}) else ('\x1B[91m','\x1B[0m')
2244
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('startmodel',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2245
+
2246
+ def __specmode_dflt( self, glb ):
2247
+ return 'mfs'
2248
+
2249
+ def __specmode( self, glb ):
2250
+ if 'specmode' in glb: return glb['specmode']
2251
+ return 'mfs'
2252
+
2253
+ def __specmode_inp(self):
2254
+ def xml_default( ):
2255
+ ## play the crazy subparameter shell game
2256
+ dflt = self.__specmode_dflt( self.__globals_( ) )
2257
+ if dflt is not None: return dflt
2258
+ return 'mfs'
2259
+ description = 'Spectral definition mode (mfs,cube,cubedata, cubesource,mvc)'
2260
+ value = self.__specmode( self.__globals_( ) )
2261
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'specmode': value},{'specmode': self.__schema['specmode']}) else ('\x1B[91m','\x1B[0m')
2262
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('specmode',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
2263
+
2264
+ def __reffreq_dflt( self, glb ):
2265
+ if self.__specmode( glb ) == "mfs": return ""
2266
+ if self.__specmode( glb ) == "mvc": return ""
2267
+ return None
2268
+
2269
+ def __reffreq( self, glb ):
2270
+ if 'reffreq' in glb: return glb['reffreq']
2271
+ dflt = self.__reffreq_dflt( glb )
2272
+ if dflt is not None: return dflt
2273
+ return ''
2274
+
2275
+ def __reffreq_inp(self):
2276
+ def xml_default( ):
2277
+ ## play the crazy subparameter shell game
2278
+ dflt = self.__reffreq_dflt( self.__globals_( ) )
2279
+ if dflt is not None: return dflt
2280
+ return ''
2281
+ if self.__reffreq_dflt( self.__globals_( ) ) is not None:
2282
+ description = 'Reference frequency'
2283
+ value = self.__reffreq( self.__globals_( ) )
2284
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'reffreq': value},{'reffreq': self.__schema['reffreq']}) else ('\x1B[91m','\x1B[0m')
2285
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('reffreq',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2286
+
2287
+ def __nchan_dflt( self, glb ):
2288
+ if self.__specmode( glb ) == "mvc": return int(-1)
2289
+ if self.__specmode( glb ) == "cube": return int(-1)
2290
+ if self.__specmode( glb ) == "cubesource": return int(-1)
2291
+ if self.__specmode( glb ) == "cubedata": return int(-1)
2292
+ return None
2293
+
2294
+ def __nchan( self, glb ):
2295
+ if 'nchan' in glb: return glb['nchan']
2296
+ dflt = self.__nchan_dflt( glb )
2297
+ if dflt is not None: return dflt
2298
+ return int(-1)
2299
+
2300
+ def __nchan_inp(self):
2301
+ def xml_default( ):
2302
+ ## play the crazy subparameter shell game
2303
+ dflt = self.__nchan_dflt( self.__globals_( ) )
2304
+ if dflt is not None: return dflt
2305
+ return int(-1)
2306
+ if self.__nchan_dflt( self.__globals_( ) ) is not None:
2307
+ description = 'Number of channels in the output image'
2308
+ value = self.__nchan( self.__globals_( ) )
2309
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'nchan': value},{'nchan': self.__schema['nchan']}) else ('\x1B[91m','\x1B[0m')
2310
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('nchan',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2311
+
2312
+ def __start_dflt( self, glb ):
2313
+ if self.__specmode( glb ) == "cube": return ""
2314
+ if self.__specmode( glb ) == "cubesource": return ""
2315
+ if self.__specmode( glb ) == "cubedata": return ""
2316
+ return None
2317
+
2318
+ def __start( self, glb ):
2319
+ if 'start' in glb: return glb['start']
2320
+ dflt = self.__start_dflt( glb )
2321
+ if dflt is not None: return dflt
2322
+ return ''
2323
+
2324
+ def __start_inp(self):
2325
+ def xml_default( ):
2326
+ ## play the crazy subparameter shell game
2327
+ dflt = self.__start_dflt( self.__globals_( ) )
2328
+ if dflt is not None: return dflt
2329
+ return ''
2330
+ if self.__start_dflt( self.__globals_( ) ) is not None:
2331
+ description = 'First channel (e.g. start=3,start=\'1.1GHz\',start=\'15343km/s\')'
2332
+ value = self.__start( self.__globals_( ) )
2333
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'start': value},{'start': self.__schema['start']}) else ('\x1B[91m','\x1B[0m')
2334
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('start',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2335
+
2336
+ def __width_dflt( self, glb ):
2337
+ if self.__specmode( glb ) == "cube": return ""
2338
+ if self.__specmode( glb ) == "cubesource": return ""
2339
+ if self.__specmode( glb ) == "cubedata": return ""
2340
+ return None
2341
+
2342
+ def __width( self, glb ):
2343
+ if 'width' in glb: return glb['width']
2344
+ dflt = self.__width_dflt( glb )
2345
+ if dflt is not None: return dflt
2346
+ return ''
2347
+
2348
+ def __width_inp(self):
2349
+ def xml_default( ):
2350
+ ## play the crazy subparameter shell game
2351
+ dflt = self.__width_dflt( self.__globals_( ) )
2352
+ if dflt is not None: return dflt
2353
+ return ''
2354
+ if self.__width_dflt( self.__globals_( ) ) is not None:
2355
+ description = 'Channel width (e.g. width=2,width=\'0.1MHz\',width=\'10km/s\')'
2356
+ value = self.__width( self.__globals_( ) )
2357
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'width': value},{'width': self.__schema['width']}) else ('\x1B[91m','\x1B[0m')
2358
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('width',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2359
+
2360
+ def __outframe_dflt( self, glb ):
2361
+ if self.__specmode( glb ) == "cube": return ""
2362
+ if self.__specmode( glb ) == "cubesource": return "REST"
2363
+ return None
2364
+
2365
+ def __outframe( self, glb ):
2366
+ if 'outframe' in glb: return glb['outframe']
2367
+ dflt = self.__outframe_dflt( glb )
2368
+ if dflt is not None: return dflt
2369
+ return 'LSRK'
2370
+
2371
+ def __outframe_inp(self):
2372
+ def xml_default( ):
2373
+ ## play the crazy subparameter shell game
2374
+ dflt = self.__outframe_dflt( self.__globals_( ) )
2375
+ if dflt is not None: return dflt
2376
+ return 'LSRK'
2377
+ if self.__outframe_dflt( self.__globals_( ) ) is not None:
2378
+ description = 'Spectral reference frame in which to interpret \'start\' and \'width\''
2379
+ value = self.__outframe( self.__globals_( ) )
2380
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'outframe': value},{'outframe': self.__schema['outframe']}) else ('\x1B[91m','\x1B[0m')
2381
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('outframe',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2382
+
2383
+ def __veltype_dflt( self, glb ):
2384
+ if self.__specmode( glb ) == "cube": return "radio"
2385
+ if self.__specmode( glb ) == "cubesource": return "radio"
2386
+ if self.__specmode( glb ) == "cubedata": return "radio"
2387
+ return None
2388
+
2389
+ def __veltype( self, glb ):
2390
+ if 'veltype' in glb: return glb['veltype']
2391
+ dflt = self.__veltype_dflt( glb )
2392
+ if dflt is not None: return dflt
2393
+ return 'radio'
2394
+
2395
+ def __veltype_inp(self):
2396
+ def xml_default( ):
2397
+ ## play the crazy subparameter shell game
2398
+ dflt = self.__veltype_dflt( self.__globals_( ) )
2399
+ if dflt is not None: return dflt
2400
+ return 'radio'
2401
+ if self.__veltype_dflt( self.__globals_( ) ) is not None:
2402
+ description = 'Velocity type (radio, z, ratio, beta, gamma, optical)'
2403
+ value = self.__veltype( self.__globals_( ) )
2404
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'veltype': value},{'veltype': self.__schema['veltype']}) else ('\x1B[91m','\x1B[0m')
2405
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('veltype',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2406
+
2407
+ def __restfreq_dflt( self, glb ):
2408
+ if self.__specmode( glb ) == "cube": return []
2409
+ if self.__specmode( glb ) == "cubesource": return []
2410
+ if self.__specmode( glb ) == "cubedata": return []
2411
+ return None
2412
+
2413
+ def __restfreq( self, glb ):
2414
+ if 'restfreq' in glb: return glb['restfreq']
2415
+ dflt = self.__restfreq_dflt( glb )
2416
+ if dflt is not None: return dflt
2417
+ return [ ]
2418
+
2419
+ def __restfreq_inp(self):
2420
+ def xml_default( ):
2421
+ ## play the crazy subparameter shell game
2422
+ dflt = self.__restfreq_dflt( self.__globals_( ) )
2423
+ if dflt is not None: return dflt
2424
+ return [ ]
2425
+ if self.__restfreq_dflt( self.__globals_( ) ) is not None:
2426
+ description = 'List of rest frequencies'
2427
+ value = self.__restfreq( self.__globals_( ) )
2428
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'restfreq': value},{'restfreq': self.__schema['restfreq']}) else ('\x1B[91m','\x1B[0m')
2429
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('restfreq',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2430
+
2431
+ def __interpolation_dflt( self, glb ):
2432
+ if self.__specmode( glb ) == "cube": return "linear"
2433
+ if self.__specmode( glb ) == "cubesource": return "linear"
2434
+ if self.__specmode( glb ) == "cubedata": return "linear"
2435
+ return None
2436
+
2437
+ def __interpolation( self, glb ):
2438
+ if 'interpolation' in glb: return glb['interpolation']
2439
+ dflt = self.__interpolation_dflt( glb )
2440
+ if dflt is not None: return dflt
2441
+ return 'linear'
2442
+
2443
+ def __interpolation_inp(self):
2444
+ def xml_default( ):
2445
+ ## play the crazy subparameter shell game
2446
+ dflt = self.__interpolation_dflt( self.__globals_( ) )
2447
+ if dflt is not None: return dflt
2448
+ return 'linear'
2449
+ if self.__interpolation_dflt( self.__globals_( ) ) is not None:
2450
+ description = 'Spectral interpolation (nearest,linear,cubic)'
2451
+ value = self.__interpolation( self.__globals_( ) )
2452
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'interpolation': value},{'interpolation': self.__schema['interpolation']}) else ('\x1B[91m','\x1B[0m')
2453
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('interpolation',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2454
+
2455
+ def __perchanweightdensity_dflt( self, glb ):
2456
+ if self.__specmode( glb ) == "cube": return bool(True)
2457
+ if self.__specmode( glb ) == "cubesource": return bool(True)
2458
+ if self.__specmode( glb ) == "cubedata": return bool(False)
2459
+ return None
2460
+
2461
+ def __perchanweightdensity( self, glb ):
2462
+ if 'perchanweightdensity' in glb: return glb['perchanweightdensity']
2463
+ dflt = self.__perchanweightdensity_dflt( glb )
2464
+ if dflt is not None: return dflt
2465
+ return True
2466
+
2467
+ def __perchanweightdensity_inp(self):
2468
+ def xml_default( ):
2469
+ ## play the crazy subparameter shell game
2470
+ dflt = self.__perchanweightdensity_dflt( self.__globals_( ) )
2471
+ if dflt is not None: return dflt
2472
+ return True
2473
+ if self.__perchanweightdensity_dflt( self.__globals_( ) ) is not None:
2474
+ description = 'whether to calculate weight density per channel in Briggs style weighting or not'
2475
+ value = self.__perchanweightdensity( self.__globals_( ) )
2476
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'perchanweightdensity': value},{'perchanweightdensity': self.__schema['perchanweightdensity']}) else ('\x1B[91m','\x1B[0m')
2477
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('perchanweightdensity',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2478
+
2479
+ def __gridder_dflt( self, glb ):
2480
+ return 'standard'
2481
+
2482
+ def __gridder( self, glb ):
2483
+ if 'gridder' in glb: return glb['gridder']
2484
+ return 'standard'
2485
+
2486
+ def __gridder_inp(self):
2487
+ def xml_default( ):
2488
+ ## play the crazy subparameter shell game
2489
+ dflt = self.__gridder_dflt( self.__globals_( ) )
2490
+ if dflt is not None: return dflt
2491
+ return 'standard'
2492
+ description = 'Gridding options (standard, wproject, widefield, mosaic, awproject, awp2)'
2493
+ value = self.__gridder( self.__globals_( ) )
2494
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'gridder': value},{'gridder': self.__schema['gridder']}) else ('\x1B[91m','\x1B[0m')
2495
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('gridder',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
2496
+
2497
+ def __facets_dflt( self, glb ):
2498
+ if self.__gridder( glb ) == "widefield": return int(1)
2499
+ return None
2500
+
2501
+ def __facets( self, glb ):
2502
+ if 'facets' in glb: return glb['facets']
2503
+ dflt = self.__facets_dflt( glb )
2504
+ if dflt is not None: return dflt
2505
+ return int(1)
2506
+
2507
+ def __facets_inp(self):
2508
+ def xml_default( ):
2509
+ ## play the crazy subparameter shell game
2510
+ dflt = self.__facets_dflt( self.__globals_( ) )
2511
+ if dflt is not None: return dflt
2512
+ return int(1)
2513
+ if self.__facets_dflt( self.__globals_( ) ) is not None:
2514
+ description = 'Number of facets on a side'
2515
+ value = self.__facets( self.__globals_( ) )
2516
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'facets': value},{'facets': self.__schema['facets']}) else ('\x1B[91m','\x1B[0m')
2517
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('facets',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2518
+
2519
+ def __psfphasecenter_dflt( self, glb ):
2520
+ if self.__gridder( glb ) == "mosaic": return ""
2521
+ if self.__gridder( glb ) == "mosaicft": return ""
2522
+ return None
2523
+
2524
+ def __psfphasecenter( self, glb ):
2525
+ if 'psfphasecenter' in glb: return glb['psfphasecenter']
2526
+ dflt = self.__psfphasecenter_dflt( glb )
2527
+ if dflt is not None: return dflt
2528
+ return ''
2529
+
2530
+ def __psfphasecenter_inp(self):
2531
+ def xml_default( ):
2532
+ ## play the crazy subparameter shell game
2533
+ dflt = self.__psfphasecenter_dflt( self.__globals_( ) )
2534
+ if dflt is not None: return dflt
2535
+ return ''
2536
+ if self.__psfphasecenter_dflt( self.__globals_( ) ) is not None:
2537
+ description = 'optional direction to calculate psf for mosaic (default is image phasecenter)'
2538
+ value = self.__psfphasecenter( self.__globals_( ) )
2539
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'psfphasecenter': value},{'psfphasecenter': self.__schema['psfphasecenter']}) else ('\x1B[91m','\x1B[0m')
2540
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('psfphasecenter',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2541
+
2542
+ def __wprojplanes_dflt( self, glb ):
2543
+ if self.__gridder( glb ) == "widefield": return int(1)
2544
+ if self.__gridder( glb ) == "wproject": return int(1)
2545
+ if self.__gridder( glb ) == "wprojectft": return int(1)
2546
+ if self.__gridder( glb ) == "imagemosaic": return int(1)
2547
+ if self.__gridder( glb ) == "awproject": return int(1)
2548
+ if self.__gridder( glb ) == "awphpg": return int(1)
2549
+ if self.__gridder( glb ) == "awprojectft": return int(1)
2550
+ if self.__gridder( glb ) == "awp2": return int(1)
2551
+ return None
2552
+
2553
+ def __wprojplanes( self, glb ):
2554
+ if 'wprojplanes' in glb: return glb['wprojplanes']
2555
+ dflt = self.__wprojplanes_dflt( glb )
2556
+ if dflt is not None: return dflt
2557
+ return int(1)
2558
+
2559
+ def __wprojplanes_inp(self):
2560
+ def xml_default( ):
2561
+ ## play the crazy subparameter shell game
2562
+ dflt = self.__wprojplanes_dflt( self.__globals_( ) )
2563
+ if dflt is not None: return dflt
2564
+ return int(1)
2565
+ if self.__wprojplanes_dflt( self.__globals_( ) ) is not None:
2566
+ description = 'Number of distinct w-values for convolution functions'
2567
+ value = self.__wprojplanes( self.__globals_( ) )
2568
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'wprojplanes': value},{'wprojplanes': self.__schema['wprojplanes']}) else ('\x1B[91m','\x1B[0m')
2569
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('wprojplanes',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2570
+
2571
+ def __vptable_dflt( self, glb ):
2572
+ if self.__gridder( glb ) == "standard": return ""
2573
+ if self.__gridder( glb ) == "widefield": return ""
2574
+ if self.__gridder( glb ) == "wproject": return ""
2575
+ if self.__gridder( glb ) == "wprojectft": return ""
2576
+ if self.__gridder( glb ) == "mosaic": return ""
2577
+ if self.__gridder( glb ) == "mosaicft": return ""
2578
+ if self.__gridder( glb ) == "ftmosaic": return ""
2579
+ if self.__gridder( glb ) == "imagemosaic": return ""
2580
+ return None
2581
+
2582
+ def __vptable( self, glb ):
2583
+ if 'vptable' in glb: return glb['vptable']
2584
+ dflt = self.__vptable_dflt( glb )
2585
+ if dflt is not None: return dflt
2586
+ return ''
2587
+
2588
+ def __vptable_inp(self):
2589
+ def xml_default( ):
2590
+ ## play the crazy subparameter shell game
2591
+ dflt = self.__vptable_dflt( self.__globals_( ) )
2592
+ if dflt is not None: return dflt
2593
+ return ''
2594
+ if self.__vptable_dflt( self.__globals_( ) ) is not None:
2595
+ description = 'Name of Voltage Pattern table'
2596
+ value = self.__vptable( self.__globals_( ) )
2597
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'vptable': value},{'vptable': self.__schema['vptable']}) else ('\x1B[91m','\x1B[0m')
2598
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('vptable',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2599
+
2600
+ def __mosweight_dflt( self, glb ):
2601
+ if self.__gridder( glb ) == "mosaic": return bool(True)
2602
+ if self.__gridder( glb ) == "ftmosaic": return bool(True)
2603
+ if self.__gridder( glb ) == "awproject": return bool(False)
2604
+ if self.__gridder( glb ) == "awphpg": return bool(False)
2605
+ if self.__gridder( glb ) == "awprojectft": return bool(False)
2606
+ if self.__gridder( glb ) == "awp2": return bool(False)
2607
+ return None
2608
+
2609
+ def __mosweight( self, glb ):
2610
+ if 'mosweight' in glb: return glb['mosweight']
2611
+ dflt = self.__mosweight_dflt( glb )
2612
+ if dflt is not None: return dflt
2613
+ return True
2614
+
2615
+ def __mosweight_inp(self):
2616
+ def xml_default( ):
2617
+ ## play the crazy subparameter shell game
2618
+ dflt = self.__mosweight_dflt( self.__globals_( ) )
2619
+ if dflt is not None: return dflt
2620
+ return True
2621
+ if self.__mosweight_dflt( self.__globals_( ) ) is not None:
2622
+ description = 'Independently weight each field in a mosaic'
2623
+ value = self.__mosweight( self.__globals_( ) )
2624
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'mosweight': value},{'mosweight': self.__schema['mosweight']}) else ('\x1B[91m','\x1B[0m')
2625
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('mosweight',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2626
+
2627
+ def __aterm_dflt( self, glb ):
2628
+ if self.__gridder( glb ) == "awproject": return bool(True)
2629
+ if self.__gridder( glb ) == "awprojectft": return bool(True)
2630
+ return None
2631
+
2632
+ def __aterm( self, glb ):
2633
+ if 'aterm' in glb: return glb['aterm']
2634
+ dflt = self.__aterm_dflt( glb )
2635
+ if dflt is not None: return dflt
2636
+ return True
2637
+
2638
+ def __aterm_inp(self):
2639
+ def xml_default( ):
2640
+ ## play the crazy subparameter shell game
2641
+ dflt = self.__aterm_dflt( self.__globals_( ) )
2642
+ if dflt is not None: return dflt
2643
+ return True
2644
+ if self.__aterm_dflt( self.__globals_( ) ) is not None:
2645
+ description = 'Use aperture illumination functions during gridding'
2646
+ value = self.__aterm( self.__globals_( ) )
2647
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'aterm': value},{'aterm': self.__schema['aterm']}) else ('\x1B[91m','\x1B[0m')
2648
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('aterm',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2649
+
2650
+ def __psterm_dflt( self, glb ):
2651
+ if self.__gridder( glb ) == "awproject": return bool(False)
2652
+ if self.__gridder( glb ) == "awprojectft": return bool(False)
2653
+ return None
2654
+
2655
+ def __psterm( self, glb ):
2656
+ if 'psterm' in glb: return glb['psterm']
2657
+ dflt = self.__psterm_dflt( glb )
2658
+ if dflt is not None: return dflt
2659
+ return False
2660
+
2661
+ def __psterm_inp(self):
2662
+ def xml_default( ):
2663
+ ## play the crazy subparameter shell game
2664
+ dflt = self.__psterm_dflt( self.__globals_( ) )
2665
+ if dflt is not None: return dflt
2666
+ return False
2667
+ if self.__psterm_dflt( self.__globals_( ) ) is not None:
2668
+ description = 'Use prolate spheroidal during gridding'
2669
+ value = self.__psterm( self.__globals_( ) )
2670
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'psterm': value},{'psterm': self.__schema['psterm']}) else ('\x1B[91m','\x1B[0m')
2671
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('psterm',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2672
+
2673
+ def __wbawp_dflt( self, glb ):
2674
+ if self.__gridder( glb ) == "awproject": return bool(True)
2675
+ if self.__gridder( glb ) == "awprojectft": return bool(True)
2676
+ return None
2677
+
2678
+ def __wbawp( self, glb ):
2679
+ if 'wbawp' in glb: return glb['wbawp']
2680
+ dflt = self.__wbawp_dflt( glb )
2681
+ if dflt is not None: return dflt
2682
+ return True
2683
+
2684
+ def __wbawp_inp(self):
2685
+ def xml_default( ):
2686
+ ## play the crazy subparameter shell game
2687
+ dflt = self.__wbawp_dflt( self.__globals_( ) )
2688
+ if dflt is not None: return dflt
2689
+ return True
2690
+ if self.__wbawp_dflt( self.__globals_( ) ) is not None:
2691
+ description = 'Use wideband A-terms'
2692
+ value = self.__wbawp( self.__globals_( ) )
2693
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'wbawp': value},{'wbawp': self.__schema['wbawp']}) else ('\x1B[91m','\x1B[0m')
2694
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('wbawp',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2695
+
2696
+ def __conjbeams_dflt( self, glb ):
2697
+ if self.__gridder( glb ) == "mosaic": return bool(False)
2698
+ if self.__gridder( glb ) == "mosaicft": return bool(False)
2699
+ if self.__gridder( glb ) == "awproject": return bool(False)
2700
+ if self.__gridder( glb ) == "awprojectft": return bool(False)
2701
+ return None
2702
+
2703
+ def __conjbeams( self, glb ):
2704
+ if 'conjbeams' in glb: return glb['conjbeams']
2705
+ dflt = self.__conjbeams_dflt( glb )
2706
+ if dflt is not None: return dflt
2707
+ return False
2708
+
2709
+ def __conjbeams_inp(self):
2710
+ def xml_default( ):
2711
+ ## play the crazy subparameter shell game
2712
+ dflt = self.__conjbeams_dflt( self.__globals_( ) )
2713
+ if dflt is not None: return dflt
2714
+ return False
2715
+ if self.__conjbeams_dflt( self.__globals_( ) ) is not None:
2716
+ description = 'Use conjugate frequency for wideband A-terms'
2717
+ value = self.__conjbeams( self.__globals_( ) )
2718
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'conjbeams': value},{'conjbeams': self.__schema['conjbeams']}) else ('\x1B[91m','\x1B[0m')
2719
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('conjbeams',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2720
+
2721
+ def __cfcache_dflt( self, glb ):
2722
+ if self.__gridder( glb ) == "awproject": return ""
2723
+ if self.__gridder( glb ) == "awprojectft": return ""
2724
+ return None
2725
+
2726
+ def __cfcache( self, glb ):
2727
+ if 'cfcache' in glb: return glb['cfcache']
2728
+ dflt = self.__cfcache_dflt( glb )
2729
+ if dflt is not None: return dflt
2730
+ return ''
2731
+
2732
+ def __cfcache_inp(self):
2733
+ def xml_default( ):
2734
+ ## play the crazy subparameter shell game
2735
+ dflt = self.__cfcache_dflt( self.__globals_( ) )
2736
+ if dflt is not None: return dflt
2737
+ return ''
2738
+ if self.__cfcache_dflt( self.__globals_( ) ) is not None:
2739
+ description = 'Convolution function cache directory name'
2740
+ value = self.__cfcache( self.__globals_( ) )
2741
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'cfcache': value},{'cfcache': self.__schema['cfcache']}) else ('\x1B[91m','\x1B[0m')
2742
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('cfcache',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2743
+
2744
+ def __usepointing_dflt( self, glb ):
2745
+ if self.__gridder( glb ) == "mosaic": return bool(False)
2746
+ if self.__gridder( glb ) == "mosaicft": return bool(False)
2747
+ if self.__gridder( glb ) == "ftmosaic": return bool(False)
2748
+ if self.__gridder( glb ) == "awproject": return bool(False)
2749
+ if self.__gridder( glb ) == "awphpg": return bool(False)
2750
+ if self.__gridder( glb ) == "awprojectft": return bool(False)
2751
+ if self.__gridder( glb ) == "awp2": return bool(False)
2752
+ return None
2753
+
2754
+ def __usepointing( self, glb ):
2755
+ if 'usepointing' in glb: return glb['usepointing']
2756
+ dflt = self.__usepointing_dflt( glb )
2757
+ if dflt is not None: return dflt
2758
+ return False
2759
+
2760
+ def __usepointing_inp(self):
2761
+ def xml_default( ):
2762
+ ## play the crazy subparameter shell game
2763
+ dflt = self.__usepointing_dflt( self.__globals_( ) )
2764
+ if dflt is not None: return dflt
2765
+ return False
2766
+ if self.__usepointing_dflt( self.__globals_( ) ) is not None:
2767
+ description = 'The parameter makes the gridder utilize the pointing table phase directions while computing the residual image.'
2768
+ value = self.__usepointing( self.__globals_( ) )
2769
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'usepointing': value},{'usepointing': self.__schema['usepointing']}) else ('\x1B[91m','\x1B[0m')
2770
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('usepointing',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2771
+
2772
+ def __computepastep_dflt( self, glb ):
2773
+ if self.__gridder( glb ) == "awproject": return float(360.0)
2774
+ if self.__gridder( glb ) == "awprojectft": return float(360.0)
2775
+ if self.__gridder( glb ) == "awp2": return float(360.0)
2776
+ return None
2777
+
2778
+ def __computepastep( self, glb ):
2779
+ if 'computepastep' in glb: return glb['computepastep']
2780
+ dflt = self.__computepastep_dflt( glb )
2781
+ if dflt is not None: return dflt
2782
+ return float(360.0)
2783
+
2784
+ def __computepastep_inp(self):
2785
+ def xml_default( ):
2786
+ ## play the crazy subparameter shell game
2787
+ dflt = self.__computepastep_dflt( self.__globals_( ) )
2788
+ if dflt is not None: return dflt
2789
+ return float(360.0)
2790
+ if self.__computepastep_dflt( self.__globals_( ) ) is not None:
2791
+ description = 'Parallactic angle interval after the AIFs are recomputed (deg)'
2792
+ value = self.__computepastep( self.__globals_( ) )
2793
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'computepastep': value},{'computepastep': self.__schema['computepastep']}) else ('\x1B[91m','\x1B[0m')
2794
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('computepastep',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2795
+
2796
+ def __rotatepastep_dflt( self, glb ):
2797
+ if self.__gridder( glb ) == "awproject": return float(360.0)
2798
+ if self.__gridder( glb ) == "awprojectft": return float(360.0)
2799
+ return None
2800
+
2801
+ def __rotatepastep( self, glb ):
2802
+ if 'rotatepastep' in glb: return glb['rotatepastep']
2803
+ dflt = self.__rotatepastep_dflt( glb )
2804
+ if dflt is not None: return dflt
2805
+ return float(360.0)
2806
+
2807
+ def __rotatepastep_inp(self):
2808
+ def xml_default( ):
2809
+ ## play the crazy subparameter shell game
2810
+ dflt = self.__rotatepastep_dflt( self.__globals_( ) )
2811
+ if dflt is not None: return dflt
2812
+ return float(360.0)
2813
+ if self.__rotatepastep_dflt( self.__globals_( ) ) is not None:
2814
+ description = 'Parallactic angle interval after which the nearest AIF is rotated (deg)'
2815
+ value = self.__rotatepastep( self.__globals_( ) )
2816
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'rotatepastep': value},{'rotatepastep': self.__schema['rotatepastep']}) else ('\x1B[91m','\x1B[0m')
2817
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('rotatepastep',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2818
+
2819
+ def __pointingoffsetsigdev_dflt( self, glb ):
2820
+ if self.__gridder( glb ) == "awproject": return []
2821
+ if self.__gridder( glb ) == "awprojectft": return []
2822
+ return None
2823
+
2824
+ def __pointingoffsetsigdev( self, glb ):
2825
+ if 'pointingoffsetsigdev' in glb: return glb['pointingoffsetsigdev']
2826
+ dflt = self.__pointingoffsetsigdev_dflt( glb )
2827
+ if dflt is not None: return dflt
2828
+ return [ ]
2829
+
2830
+ def __pointingoffsetsigdev_inp(self):
2831
+ def xml_default( ):
2832
+ ## play the crazy subparameter shell game
2833
+ dflt = self.__pointingoffsetsigdev_dflt( self.__globals_( ) )
2834
+ if dflt is not None: return dflt
2835
+ return [ ]
2836
+ if self.__pointingoffsetsigdev_dflt( self.__globals_( ) ) is not None:
2837
+ description = 'Pointing offset threshold to determine heterogeneity of pointing corrections for the AWProject gridder'
2838
+ value = self.__pointingoffsetsigdev( self.__globals_( ) )
2839
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'pointingoffsetsigdev': value},{'pointingoffsetsigdev': self.__schema['pointingoffsetsigdev']}) else ('\x1B[91m','\x1B[0m')
2840
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('pointingoffsetsigdev',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2841
+
2842
+ def __pblimit_dflt( self, glb ):
2843
+ if self.__gridder( glb ) == "awphpg": return float(0.2)
2844
+ return None
2845
+
2846
+ def __pblimit( self, glb ):
2847
+ if 'pblimit' in glb: return glb['pblimit']
2848
+ return float(0.2)
2849
+
2850
+ def __pblimit_inp(self):
2851
+ def xml_default( ):
2852
+ ## play the crazy subparameter shell game
2853
+ dflt = self.__pblimit_dflt( self.__globals_( ) )
2854
+ if dflt is not None: return dflt
2855
+ return float(0.2)
2856
+ description = 'PB gain level at which to cut off normalizations'
2857
+ value = self.__pblimit( self.__globals_( ) )
2858
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'pblimit': value},{'pblimit': self.__schema['pblimit']}) else ('\x1B[91m','\x1B[0m')
2859
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('pblimit',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
2860
+
2861
+ def __normtype_dflt( self, glb ):
2862
+ if self.__gridder( glb ) == "mosaic": return "flatnoise"
2863
+ if self.__gridder( glb ) == "mosaicft": return "flatnoise"
2864
+ if self.__gridder( glb ) == "ftmosaic": return "flatnoise"
2865
+ if self.__gridder( glb ) == "imagemosaic": return "flatnoise"
2866
+ if self.__gridder( glb ) == "awproject": return "flatnoise"
2867
+ if self.__gridder( glb ) == "awphpg": return "flatnoise"
2868
+ if self.__gridder( glb ) == "awprojectft": return "flatnoise"
2869
+ if self.__gridder( glb ) == "awp2": return "flatnoise"
2870
+ return None
2871
+
2872
+ def __normtype( self, glb ):
2873
+ if 'normtype' in glb: return glb['normtype']
2874
+ dflt = self.__normtype_dflt( glb )
2875
+ if dflt is not None: return dflt
2876
+ return 'flatnoise'
2877
+
2878
+ def __normtype_inp(self):
2879
+ def xml_default( ):
2880
+ ## play the crazy subparameter shell game
2881
+ dflt = self.__normtype_dflt( self.__globals_( ) )
2882
+ if dflt is not None: return dflt
2883
+ return 'flatnoise'
2884
+ if self.__normtype_dflt( self.__globals_( ) ) is not None:
2885
+ description = 'Normalization type (flatnoise, flatsky,pbsquare)'
2886
+ value = self.__normtype( self.__globals_( ) )
2887
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'normtype': value},{'normtype': self.__schema['normtype']}) else ('\x1B[91m','\x1B[0m')
2888
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('normtype',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2889
+
2890
+ def __deconvolver_dflt( self, glb ):
2891
+ return 'hogbom'
2892
+
2893
+ def __deconvolver( self, glb ):
2894
+ if 'deconvolver' in glb: return glb['deconvolver']
2895
+ return 'hogbom'
2896
+
2897
+ def __deconvolver_inp(self):
2898
+ def xml_default( ):
2899
+ ## play the crazy subparameter shell game
2900
+ dflt = self.__deconvolver_dflt( self.__globals_( ) )
2901
+ if dflt is not None: return dflt
2902
+ return 'hogbom'
2903
+ description = 'Minor cycle algorithm (hogbom,clark,multiscale,mtmfs,mem,clarkstokes,asp)'
2904
+ value = self.__deconvolver( self.__globals_( ) )
2905
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'deconvolver': value},{'deconvolver': self.__schema['deconvolver']}) else ('\x1B[91m','\x1B[0m')
2906
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('deconvolver',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
2907
+
2908
+ def __scales_dflt( self, glb ):
2909
+ if self.__deconvolver( glb ) == "multiscale": return []
2910
+ if self.__deconvolver( glb ) == "mtmfs": return []
2911
+ return None
2912
+
2913
+ def __scales( self, glb ):
2914
+ if 'scales' in glb: return glb['scales']
2915
+ dflt = self.__scales_dflt( glb )
2916
+ if dflt is not None: return dflt
2917
+ return [ ]
2918
+
2919
+ def __scales_inp(self):
2920
+ def xml_default( ):
2921
+ ## play the crazy subparameter shell game
2922
+ dflt = self.__scales_dflt( self.__globals_( ) )
2923
+ if dflt is not None: return dflt
2924
+ return [ ]
2925
+ if self.__scales_dflt( self.__globals_( ) ) is not None:
2926
+ description = 'List of scale sizes (in pixels) for multi-scale algorithms'
2927
+ value = self.__scales( self.__globals_( ) )
2928
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'scales': value},{'scales': self.__schema['scales']}) else ('\x1B[91m','\x1B[0m')
2929
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('scales',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2930
+
2931
+ def __nterms_dflt( self, glb ):
2932
+ if self.__deconvolver( glb ) == "mtmfs": return int(2)
2933
+ return None
2934
+
2935
+ def __nterms( self, glb ):
2936
+ if 'nterms' in glb: return glb['nterms']
2937
+ dflt = self.__nterms_dflt( glb )
2938
+ if dflt is not None: return dflt
2939
+ return int(2)
2940
+
2941
+ def __nterms_inp(self):
2942
+ def xml_default( ):
2943
+ ## play the crazy subparameter shell game
2944
+ dflt = self.__nterms_dflt( self.__globals_( ) )
2945
+ if dflt is not None: return dflt
2946
+ return int(2)
2947
+ if self.__nterms_dflt( self.__globals_( ) ) is not None:
2948
+ description = 'Number of Taylor coefficients in the spectral model'
2949
+ value = self.__nterms( self.__globals_( ) )
2950
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'nterms': value},{'nterms': self.__schema['nterms']}) else ('\x1B[91m','\x1B[0m')
2951
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('nterms',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2952
+
2953
+ def __smallscalebias_dflt( self, glb ):
2954
+ if self.__deconvolver( glb ) == "multiscale": return float(0.0)
2955
+ if self.__deconvolver( glb ) == "mtmfs": return float(0.0)
2956
+ return None
2957
+
2958
+ def __smallscalebias( self, glb ):
2959
+ if 'smallscalebias' in glb: return glb['smallscalebias']
2960
+ dflt = self.__smallscalebias_dflt( glb )
2961
+ if dflt is not None: return dflt
2962
+ return float(0.0)
2963
+
2964
+ def __smallscalebias_inp(self):
2965
+ def xml_default( ):
2966
+ ## play the crazy subparameter shell game
2967
+ dflt = self.__smallscalebias_dflt( self.__globals_( ) )
2968
+ if dflt is not None: return dflt
2969
+ return float(0.0)
2970
+ if self.__smallscalebias_dflt( self.__globals_( ) ) is not None:
2971
+ description = 'Biases the scale selection when using multi-scale or mtmfs deconvolvers'
2972
+ value = self.__smallscalebias( self.__globals_( ) )
2973
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'smallscalebias': value},{'smallscalebias': self.__schema['smallscalebias']}) else ('\x1B[91m','\x1B[0m')
2974
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('smallscalebias',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2975
+
2976
+ def __fusedthreshold_dflt( self, glb ):
2977
+ if self.__deconvolver( glb ) == "asp": return float(0.0)
2978
+ return None
2979
+
2980
+ def __fusedthreshold( self, glb ):
2981
+ if 'fusedthreshold' in glb: return glb['fusedthreshold']
2982
+ dflt = self.__fusedthreshold_dflt( glb )
2983
+ if dflt is not None: return dflt
2984
+ return float(0.0)
2985
+
2986
+ def __fusedthreshold_inp(self):
2987
+ def xml_default( ):
2988
+ ## play the crazy subparameter shell game
2989
+ dflt = self.__fusedthreshold_dflt( self.__globals_( ) )
2990
+ if dflt is not None: return dflt
2991
+ return float(0.0)
2992
+ if self.__fusedthreshold_dflt( self.__globals_( ) ) is not None:
2993
+ description = 'Threshold for triggering Hogbom Clean'
2994
+ value = self.__fusedthreshold( self.__globals_( ) )
2995
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'fusedthreshold': value},{'fusedthreshold': self.__schema['fusedthreshold']}) else ('\x1B[91m','\x1B[0m')
2996
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('fusedthreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
2997
+
2998
+ def __largestscale_dflt( self, glb ):
2999
+ if self.__deconvolver( glb ) == "asp": return int(-1)
3000
+ return None
3001
+
3002
+ def __largestscale( self, glb ):
3003
+ if 'largestscale' in glb: return glb['largestscale']
3004
+ dflt = self.__largestscale_dflt( glb )
3005
+ if dflt is not None: return dflt
3006
+ return int(-1)
3007
+
3008
+ def __largestscale_inp(self):
3009
+ def xml_default( ):
3010
+ ## play the crazy subparameter shell game
3011
+ dflt = self.__largestscale_dflt( self.__globals_( ) )
3012
+ if dflt is not None: return dflt
3013
+ return int(-1)
3014
+ if self.__largestscale_dflt( self.__globals_( ) ) is not None:
3015
+ description = 'Largest scale allowed for the Asp Clean deconvolver'
3016
+ value = self.__largestscale( self.__globals_( ) )
3017
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'largestscale': value},{'largestscale': self.__schema['largestscale']}) else ('\x1B[91m','\x1B[0m')
3018
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('largestscale',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3019
+
3020
+ def __restoration_dflt( self, glb ):
3021
+ return True
3022
+
3023
+ def __restoration( self, glb ):
3024
+ if 'restoration' in glb: return glb['restoration']
3025
+ return True
3026
+
3027
+ def __restoration_inp(self):
3028
+ def xml_default( ):
3029
+ ## play the crazy subparameter shell game
3030
+ dflt = self.__restoration_dflt( self.__globals_( ) )
3031
+ if dflt is not None: return dflt
3032
+ return True
3033
+ description = 'Do restoration steps (or not)'
3034
+ value = self.__restoration( self.__globals_( ) )
3035
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'restoration': value},{'restoration': self.__schema['restoration']}) else ('\x1B[91m','\x1B[0m')
3036
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('restoration',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
3037
+
3038
+ def __restoringbeam_dflt( self, glb ):
3039
+ if self.__restoration( glb ) == bool(True): return []
3040
+ return None
3041
+
3042
+ def __restoringbeam( self, glb ):
3043
+ if 'restoringbeam' in glb: return glb['restoringbeam']
3044
+ dflt = self.__restoringbeam_dflt( glb )
3045
+ if dflt is not None: return dflt
3046
+ return [ ]
3047
+
3048
+ def __restoringbeam_inp(self):
3049
+ def xml_default( ):
3050
+ ## play the crazy subparameter shell game
3051
+ dflt = self.__restoringbeam_dflt( self.__globals_( ) )
3052
+ if dflt is not None: return dflt
3053
+ return [ ]
3054
+ if self.__restoringbeam_dflt( self.__globals_( ) ) is not None:
3055
+ description = 'Restoring beam shape to use. Default is the PSF main lobe'
3056
+ value = self.__restoringbeam( self.__globals_( ) )
3057
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'restoringbeam': value},{'restoringbeam': self.__schema['restoringbeam']}) else ('\x1B[91m','\x1B[0m')
3058
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('restoringbeam',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3059
+
3060
+ def __pbcor_dflt( self, glb ):
3061
+ if self.__restoration( glb ) == bool(True): return bool(False)
3062
+ return None
3063
+
3064
+ def __pbcor( self, glb ):
3065
+ if 'pbcor' in glb: return glb['pbcor']
3066
+ dflt = self.__pbcor_dflt( glb )
3067
+ if dflt is not None: return dflt
3068
+ return False
3069
+
3070
+ def __pbcor_inp(self):
3071
+ def xml_default( ):
3072
+ ## play the crazy subparameter shell game
3073
+ dflt = self.__pbcor_dflt( self.__globals_( ) )
3074
+ if dflt is not None: return dflt
3075
+ return False
3076
+ if self.__pbcor_dflt( self.__globals_( ) ) is not None:
3077
+ description = 'Apply PB correction on the output restored image'
3078
+ value = self.__pbcor( self.__globals_( ) )
3079
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'pbcor': value},{'pbcor': self.__schema['pbcor']}) else ('\x1B[91m','\x1B[0m')
3080
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('pbcor',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3081
+
3082
+ def __outlierfile_dflt( self, glb ):
3083
+ return ''
3084
+
3085
+ def __outlierfile( self, glb ):
3086
+ if 'outlierfile' in glb: return glb['outlierfile']
3087
+ return ''
3088
+
3089
+ def __outlierfile_inp(self):
3090
+ def xml_default( ):
3091
+ ## play the crazy subparameter shell game
3092
+ dflt = self.__outlierfile_dflt( self.__globals_( ) )
3093
+ if dflt is not None: return dflt
3094
+ return ''
3095
+ description = 'Name of outlier-field image definitions'
3096
+ value = self.__outlierfile( self.__globals_( ) )
3097
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'outlierfile': value},{'outlierfile': self.__schema['outlierfile']}) else ('\x1B[91m','\x1B[0m')
3098
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('outlierfile',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3099
+
3100
+ def __weighting_dflt( self, glb ):
3101
+ return 'natural'
3102
+
3103
+ def __weighting( self, glb ):
3104
+ if 'weighting' in glb: return glb['weighting']
3105
+ return 'natural'
3106
+
3107
+ def __weighting_inp(self):
3108
+ def xml_default( ):
3109
+ ## play the crazy subparameter shell game
3110
+ dflt = self.__weighting_dflt( self.__globals_( ) )
3111
+ if dflt is not None: return dflt
3112
+ return 'natural'
3113
+ description = 'Weighting scheme (natural,uniform,briggs, superuniform, radial, briggsabs[experimental], briggsbwtaper[experimental])'
3114
+ value = self.__weighting( self.__globals_( ) )
3115
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'weighting': value},{'weighting': self.__schema['weighting']}) else ('\x1B[91m','\x1B[0m')
3116
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('weighting',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
3117
+
3118
+ def __robust_dflt( self, glb ):
3119
+ if self.__weighting( glb ) == "briggs": return float(0.5)
3120
+ if self.__weighting( glb ) == "briggsabs": return float(0.5)
3121
+ if self.__weighting( glb ) == "briggsbwtaper": return float(0.5)
3122
+ return None
3123
+
3124
+ def __robust( self, glb ):
3125
+ if 'robust' in glb: return glb['robust']
3126
+ dflt = self.__robust_dflt( glb )
3127
+ if dflt is not None: return dflt
3128
+ return float(0.5)
3129
+
3130
+ def __robust_inp(self):
3131
+ def xml_default( ):
3132
+ ## play the crazy subparameter shell game
3133
+ dflt = self.__robust_dflt( self.__globals_( ) )
3134
+ if dflt is not None: return dflt
3135
+ return float(0.5)
3136
+ if self.__robust_dflt( self.__globals_( ) ) is not None:
3137
+ description = 'Robustness parameter'
3138
+ value = self.__robust( self.__globals_( ) )
3139
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'robust': value},{'robust': self.__schema['robust']}) else ('\x1B[91m','\x1B[0m')
3140
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('robust',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3141
+
3142
+ def __noise_dflt( self, glb ):
3143
+ if self.__weighting( glb ) == "briggsabs": return "1.0Jy"
3144
+ return None
3145
+
3146
+ def __noise( self, glb ):
3147
+ if 'noise' in glb: return glb['noise']
3148
+ dflt = self.__noise_dflt( glb )
3149
+ if dflt is not None: return dflt
3150
+ return '1.0Jy'
3151
+
3152
+ def __noise_inp(self):
3153
+ def xml_default( ):
3154
+ ## play the crazy subparameter shell game
3155
+ dflt = self.__noise_dflt( self.__globals_( ) )
3156
+ if dflt is not None: return dflt
3157
+ return '1.0Jy'
3158
+ if self.__noise_dflt( self.__globals_( ) ) is not None:
3159
+ description = 'noise parameter for briggs abs mode weighting'
3160
+ value = self.__noise( self.__globals_( ) )
3161
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'noise': value},{'noise': self.__schema['noise']}) else ('\x1B[91m','\x1B[0m')
3162
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('noise',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3163
+
3164
+ def __npixels_dflt( self, glb ):
3165
+ if self.__weighting( glb ) == "briggs": return int(0)
3166
+ if self.__weighting( glb ) == "briggsabs": return int(0)
3167
+ return None
3168
+
3169
+ def __npixels( self, glb ):
3170
+ if 'npixels' in glb: return glb['npixels']
3171
+ dflt = self.__npixels_dflt( glb )
3172
+ if dflt is not None: return dflt
3173
+ return int(0)
3174
+
3175
+ def __npixels_inp(self):
3176
+ def xml_default( ):
3177
+ ## play the crazy subparameter shell game
3178
+ dflt = self.__npixels_dflt( self.__globals_( ) )
3179
+ if dflt is not None: return dflt
3180
+ return int(0)
3181
+ if self.__npixels_dflt( self.__globals_( ) ) is not None:
3182
+ description = 'Number of pixels to determine uv-cell size'
3183
+ value = self.__npixels( self.__globals_( ) )
3184
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'npixels': value},{'npixels': self.__schema['npixels']}) else ('\x1B[91m','\x1B[0m')
3185
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('npixels',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3186
+
3187
+ def __uvtaper_dflt( self, glb ):
3188
+ if self.__weighting( glb ) == "natural": return []
3189
+ if self.__weighting( glb ) == "uniform": return []
3190
+ if self.__weighting( glb ) == "superuniform": return []
3191
+ if self.__weighting( glb ) == "radial": return []
3192
+ if self.__weighting( glb ) == "briggs": return []
3193
+ if self.__weighting( glb ) == "briggsabs": return []
3194
+ if self.__weighting( glb ) == "briggsbwtaper": return []
3195
+ return None
3196
+
3197
+ def __uvtaper( self, glb ):
3198
+ if 'uvtaper' in glb: return glb['uvtaper']
3199
+ dflt = self.__uvtaper_dflt( glb )
3200
+ if dflt is not None: return dflt
3201
+ return [ '' ]
3202
+
3203
+ def __uvtaper_inp(self):
3204
+ def xml_default( ):
3205
+ ## play the crazy subparameter shell game
3206
+ dflt = self.__uvtaper_dflt( self.__globals_( ) )
3207
+ if dflt is not None: return dflt
3208
+ return [ '' ]
3209
+ if self.__uvtaper_dflt( self.__globals_( ) ) is not None:
3210
+ description = 'uv-taper on outer baselines in uv-plane'
3211
+ value = self.__uvtaper( self.__globals_( ) )
3212
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'uvtaper': value},{'uvtaper': self.__schema['uvtaper']}) else ('\x1B[91m','\x1B[0m')
3213
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('uvtaper',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3214
+
3215
+ def __niter_dflt( self, glb ):
3216
+ return int(0)
3217
+
3218
+ def __niter( self, glb ):
3219
+ if 'niter' in glb: return glb['niter']
3220
+ return int(0)
3221
+
3222
+ def __niter_inp(self):
3223
+ def xml_default( ):
3224
+ ## play the crazy subparameter shell game
3225
+ dflt = self.__niter_dflt( self.__globals_( ) )
3226
+ if dflt is not None: return dflt
3227
+ return int(0)
3228
+ description = 'Maximum number of iterations'
3229
+ value = self.__niter( self.__globals_( ) )
3230
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'niter': value},{'niter': self.__schema['niter']}) else ('\x1B[91m','\x1B[0m')
3231
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('niter',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
3232
+
3233
+ def __gain_dflt( self, glb ):
3234
+ if self.__niter( glb ) != int(0): return float(0.1)
3235
+ return None
3236
+
3237
+ def __gain( self, glb ):
3238
+ if 'gain' in glb: return glb['gain']
3239
+ dflt = self.__gain_dflt( glb )
3240
+ if dflt is not None: return dflt
3241
+ return float(0.1)
3242
+
3243
+ def __gain_inp(self):
3244
+ def xml_default( ):
3245
+ ## play the crazy subparameter shell game
3246
+ dflt = self.__gain_dflt( self.__globals_( ) )
3247
+ if dflt is not None: return dflt
3248
+ return float(0.1)
3249
+ if self.__gain_dflt( self.__globals_( ) ) is not None:
3250
+ description = 'Loop gain'
3251
+ value = self.__gain( self.__globals_( ) )
3252
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'gain': value},{'gain': self.__schema['gain']}) else ('\x1B[91m','\x1B[0m')
3253
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('gain',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3254
+
3255
+ def __threshold_dflt( self, glb ):
3256
+ if self.__niter( glb ) != int(0): return 0.0
3257
+ return None
3258
+
3259
+ def __threshold( self, glb ):
3260
+ if 'threshold' in glb: return glb['threshold']
3261
+ dflt = self.__threshold_dflt( glb )
3262
+ if dflt is not None: return dflt
3263
+ return float(0.0)
3264
+
3265
+ def __threshold_inp(self):
3266
+ def xml_default( ):
3267
+ ## play the crazy subparameter shell game
3268
+ dflt = self.__threshold_dflt( self.__globals_( ) )
3269
+ if dflt is not None: return dflt
3270
+ return float(0.0)
3271
+ if self.__threshold_dflt( self.__globals_( ) ) is not None:
3272
+ description = 'Stopping threshold'
3273
+ value = self.__threshold( self.__globals_( ) )
3274
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'threshold': value},{'threshold': self.__schema['threshold']}) else ('\x1B[91m','\x1B[0m')
3275
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('threshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3276
+
3277
+ def __nsigma_dflt( self, glb ):
3278
+ if self.__niter( glb ) != int(0): return float(0.0)
3279
+ return None
3280
+
3281
+ def __nsigma( self, glb ):
3282
+ if 'nsigma' in glb: return glb['nsigma']
3283
+ dflt = self.__nsigma_dflt( glb )
3284
+ if dflt is not None: return dflt
3285
+ return float(0.0)
3286
+
3287
+ def __nsigma_inp(self):
3288
+ def xml_default( ):
3289
+ ## play the crazy subparameter shell game
3290
+ dflt = self.__nsigma_dflt( self.__globals_( ) )
3291
+ if dflt is not None: return dflt
3292
+ return float(0.0)
3293
+ if self.__nsigma_dflt( self.__globals_( ) ) is not None:
3294
+ description = 'Multiplicative factor for rms-based threshold stopping'
3295
+ value = self.__nsigma( self.__globals_( ) )
3296
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'nsigma': value},{'nsigma': self.__schema['nsigma']}) else ('\x1B[91m','\x1B[0m')
3297
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('nsigma',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3298
+
3299
+ def __cycleniter_dflt( self, glb ):
3300
+ if self.__niter( glb ) != int(0): return int(-1)
3301
+ return None
3302
+
3303
+ def __cycleniter( self, glb ):
3304
+ if 'cycleniter' in glb: return glb['cycleniter']
3305
+ dflt = self.__cycleniter_dflt( glb )
3306
+ if dflt is not None: return dflt
3307
+ return int(-1)
3308
+
3309
+ def __cycleniter_inp(self):
3310
+ def xml_default( ):
3311
+ ## play the crazy subparameter shell game
3312
+ dflt = self.__cycleniter_dflt( self.__globals_( ) )
3313
+ if dflt is not None: return dflt
3314
+ return int(-1)
3315
+ if self.__cycleniter_dflt( self.__globals_( ) ) is not None:
3316
+ description = 'Maximum number of minor-cycle iterations'
3317
+ value = self.__cycleniter( self.__globals_( ) )
3318
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'cycleniter': value},{'cycleniter': self.__schema['cycleniter']}) else ('\x1B[91m','\x1B[0m')
3319
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('cycleniter',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3320
+
3321
+ def __cyclefactor_dflt( self, glb ):
3322
+ if self.__niter( glb ) != int(0): return float(1.0)
3323
+ return None
3324
+
3325
+ def __cyclefactor( self, glb ):
3326
+ if 'cyclefactor' in glb: return glb['cyclefactor']
3327
+ dflt = self.__cyclefactor_dflt( glb )
3328
+ if dflt is not None: return dflt
3329
+ return float(1.0)
3330
+
3331
+ def __cyclefactor_inp(self):
3332
+ def xml_default( ):
3333
+ ## play the crazy subparameter shell game
3334
+ dflt = self.__cyclefactor_dflt( self.__globals_( ) )
3335
+ if dflt is not None: return dflt
3336
+ return float(1.0)
3337
+ if self.__cyclefactor_dflt( self.__globals_( ) ) is not None:
3338
+ description = 'Scaling on PSF sidelobe level to compute the minor-cycle stopping threshold.'
3339
+ value = self.__cyclefactor( self.__globals_( ) )
3340
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'cyclefactor': value},{'cyclefactor': self.__schema['cyclefactor']}) else ('\x1B[91m','\x1B[0m')
3341
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('cyclefactor',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3342
+
3343
+ def __minpsffraction_dflt( self, glb ):
3344
+ if self.__niter( glb ) != int(0): return float(0.05)
3345
+ return None
3346
+
3347
+ def __minpsffraction( self, glb ):
3348
+ if 'minpsffraction' in glb: return glb['minpsffraction']
3349
+ dflt = self.__minpsffraction_dflt( glb )
3350
+ if dflt is not None: return dflt
3351
+ return float(0.05)
3352
+
3353
+ def __minpsffraction_inp(self):
3354
+ def xml_default( ):
3355
+ ## play the crazy subparameter shell game
3356
+ dflt = self.__minpsffraction_dflt( self.__globals_( ) )
3357
+ if dflt is not None: return dflt
3358
+ return float(0.05)
3359
+ if self.__minpsffraction_dflt( self.__globals_( ) ) is not None:
3360
+ description = 'PSF fraction that marks the max depth of cleaning in the minor cycle'
3361
+ value = self.__minpsffraction( self.__globals_( ) )
3362
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'minpsffraction': value},{'minpsffraction': self.__schema['minpsffraction']}) else ('\x1B[91m','\x1B[0m')
3363
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('minpsffraction',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3364
+
3365
+ def __maxpsffraction_dflt( self, glb ):
3366
+ if self.__niter( glb ) != int(0): return float(0.8)
3367
+ return None
3368
+
3369
+ def __maxpsffraction( self, glb ):
3370
+ if 'maxpsffraction' in glb: return glb['maxpsffraction']
3371
+ dflt = self.__maxpsffraction_dflt( glb )
3372
+ if dflt is not None: return dflt
3373
+ return float(0.8)
3374
+
3375
+ def __maxpsffraction_inp(self):
3376
+ def xml_default( ):
3377
+ ## play the crazy subparameter shell game
3378
+ dflt = self.__maxpsffraction_dflt( self.__globals_( ) )
3379
+ if dflt is not None: return dflt
3380
+ return float(0.8)
3381
+ if self.__maxpsffraction_dflt( self.__globals_( ) ) is not None:
3382
+ description = 'PSF fraction that marks the minimum depth of cleaning in the minor cycle'
3383
+ value = self.__maxpsffraction( self.__globals_( ) )
3384
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'maxpsffraction': value},{'maxpsffraction': self.__schema['maxpsffraction']}) else ('\x1B[91m','\x1B[0m')
3385
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('maxpsffraction',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3386
+
3387
+ def __nmajor_dflt( self, glb ):
3388
+ return int(-1)
3389
+
3390
+ def __nmajor( self, glb ):
3391
+ if 'nmajor' in glb: return glb['nmajor']
3392
+ return int(-1)
3393
+
3394
+ def __nmajor_inp(self):
3395
+ def xml_default( ):
3396
+ ## play the crazy subparameter shell game
3397
+ dflt = self.__nmajor_dflt( self.__globals_( ) )
3398
+ if dflt is not None: return dflt
3399
+ return int(-1)
3400
+ description = 'Maximum number of major cycles to evaluate'
3401
+ value = self.__nmajor( self.__globals_( ) )
3402
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'nmajor': value},{'nmajor': self.__schema['nmajor']}) else ('\x1B[91m','\x1B[0m')
3403
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('nmajor',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3404
+
3405
+ def __usemask_dflt( self, glb ):
3406
+ return 'user'
3407
+
3408
+ def __usemask( self, glb ):
3409
+ if 'usemask' in glb: return glb['usemask']
3410
+ return 'user'
3411
+
3412
+ def __usemask_inp(self):
3413
+ def xml_default( ):
3414
+ ## play the crazy subparameter shell game
3415
+ dflt = self.__usemask_dflt( self.__globals_( ) )
3416
+ if dflt is not None: return dflt
3417
+ return 'user'
3418
+ description = 'Type of mask(s) for deconvolution: user, pb, or auto-multithresh'
3419
+ value = self.__usemask( self.__globals_( ) )
3420
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'usemask': value},{'usemask': self.__schema['usemask']}) else ('\x1B[91m','\x1B[0m')
3421
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('usemask',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
3422
+
3423
+ def __mask_dflt( self, glb ):
3424
+ if self.__usemask( glb ) == "user": return ""
3425
+ return None
3426
+
3427
+ def __mask( self, glb ):
3428
+ if 'mask' in glb: return glb['mask']
3429
+ dflt = self.__mask_dflt( glb )
3430
+ if dflt is not None: return dflt
3431
+ return ''
3432
+
3433
+ def __mask_inp(self):
3434
+ def xml_default( ):
3435
+ ## play the crazy subparameter shell game
3436
+ dflt = self.__mask_dflt( self.__globals_( ) )
3437
+ if dflt is not None: return dflt
3438
+ return ''
3439
+ if self.__mask_dflt( self.__globals_( ) ) is not None:
3440
+ description = 'Mask (a list of image name(s) or region file(s) or region string(s) )'
3441
+ value = self.__mask( self.__globals_( ) )
3442
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'mask': value},{'mask': self.__schema['mask']}) else ('\x1B[91m','\x1B[0m')
3443
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('mask',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3444
+
3445
+ def __pbmask_dflt( self, glb ):
3446
+ if self.__usemask( glb ) == "user": return float(0.0)
3447
+ if self.__usemask( glb ) == "pb": return float(0.2)
3448
+ if self.__usemask( glb ) == "auto-multithresh": return float(0.2)
3449
+ return None
3450
+
3451
+ def __pbmask( self, glb ):
3452
+ if 'pbmask' in glb: return glb['pbmask']
3453
+ dflt = self.__pbmask_dflt( glb )
3454
+ if dflt is not None: return dflt
3455
+ return float(0.0)
3456
+
3457
+ def __pbmask_inp(self):
3458
+ def xml_default( ):
3459
+ ## play the crazy subparameter shell game
3460
+ dflt = self.__pbmask_dflt( self.__globals_( ) )
3461
+ if dflt is not None: return dflt
3462
+ return float(0.0)
3463
+ if self.__pbmask_dflt( self.__globals_( ) ) is not None:
3464
+ description = 'primary beam mask'
3465
+ value = self.__pbmask( self.__globals_( ) )
3466
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'pbmask': value},{'pbmask': self.__schema['pbmask']}) else ('\x1B[91m','\x1B[0m')
3467
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('pbmask',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3468
+
3469
+ def __sidelobethreshold_dflt( self, glb ):
3470
+ if self.__usemask( glb ) == "auto-multithresh": return float(3.0)
3471
+ return None
3472
+
3473
+ def __sidelobethreshold( self, glb ):
3474
+ if 'sidelobethreshold' in glb: return glb['sidelobethreshold']
3475
+ dflt = self.__sidelobethreshold_dflt( glb )
3476
+ if dflt is not None: return dflt
3477
+ return float(3.0)
3478
+
3479
+ def __sidelobethreshold_inp(self):
3480
+ def xml_default( ):
3481
+ ## play the crazy subparameter shell game
3482
+ dflt = self.__sidelobethreshold_dflt( self.__globals_( ) )
3483
+ if dflt is not None: return dflt
3484
+ return float(3.0)
3485
+ if self.__sidelobethreshold_dflt( self.__globals_( ) ) is not None:
3486
+ description = 'sidelobethreshold \* the max sidelobe level \* peak residual'
3487
+ value = self.__sidelobethreshold( self.__globals_( ) )
3488
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'sidelobethreshold': value},{'sidelobethreshold': self.__schema['sidelobethreshold']}) else ('\x1B[91m','\x1B[0m')
3489
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('sidelobethreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3490
+
3491
+ def __noisethreshold_dflt( self, glb ):
3492
+ if self.__usemask( glb ) == "auto-multithresh": return float(5.0)
3493
+ return None
3494
+
3495
+ def __noisethreshold( self, glb ):
3496
+ if 'noisethreshold' in glb: return glb['noisethreshold']
3497
+ dflt = self.__noisethreshold_dflt( glb )
3498
+ if dflt is not None: return dflt
3499
+ return float(5.0)
3500
+
3501
+ def __noisethreshold_inp(self):
3502
+ def xml_default( ):
3503
+ ## play the crazy subparameter shell game
3504
+ dflt = self.__noisethreshold_dflt( self.__globals_( ) )
3505
+ if dflt is not None: return dflt
3506
+ return float(5.0)
3507
+ if self.__noisethreshold_dflt( self.__globals_( ) ) is not None:
3508
+ description = 'noisethreshold \* rms in residual image + location(median)'
3509
+ value = self.__noisethreshold( self.__globals_( ) )
3510
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'noisethreshold': value},{'noisethreshold': self.__schema['noisethreshold']}) else ('\x1B[91m','\x1B[0m')
3511
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('noisethreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3512
+
3513
+ def __lownoisethreshold_dflt( self, glb ):
3514
+ if self.__usemask( glb ) == "auto-multithresh": return float(1.5)
3515
+ return None
3516
+
3517
+ def __lownoisethreshold( self, glb ):
3518
+ if 'lownoisethreshold' in glb: return glb['lownoisethreshold']
3519
+ dflt = self.__lownoisethreshold_dflt( glb )
3520
+ if dflt is not None: return dflt
3521
+ return float(1.5)
3522
+
3523
+ def __lownoisethreshold_inp(self):
3524
+ def xml_default( ):
3525
+ ## play the crazy subparameter shell game
3526
+ dflt = self.__lownoisethreshold_dflt( self.__globals_( ) )
3527
+ if dflt is not None: return dflt
3528
+ return float(1.5)
3529
+ if self.__lownoisethreshold_dflt( self.__globals_( ) ) is not None:
3530
+ description = 'lownoisethreshold \* rms in residual image + location(median)'
3531
+ value = self.__lownoisethreshold( self.__globals_( ) )
3532
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'lownoisethreshold': value},{'lownoisethreshold': self.__schema['lownoisethreshold']}) else ('\x1B[91m','\x1B[0m')
3533
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('lownoisethreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3534
+
3535
+ def __negativethreshold_dflt( self, glb ):
3536
+ if self.__usemask( glb ) == "auto-multithresh": return float(0.0)
3537
+ return None
3538
+
3539
+ def __negativethreshold( self, glb ):
3540
+ if 'negativethreshold' in glb: return glb['negativethreshold']
3541
+ dflt = self.__negativethreshold_dflt( glb )
3542
+ if dflt is not None: return dflt
3543
+ return float(0.0)
3544
+
3545
+ def __negativethreshold_inp(self):
3546
+ def xml_default( ):
3547
+ ## play the crazy subparameter shell game
3548
+ dflt = self.__negativethreshold_dflt( self.__globals_( ) )
3549
+ if dflt is not None: return dflt
3550
+ return float(0.0)
3551
+ if self.__negativethreshold_dflt( self.__globals_( ) ) is not None:
3552
+ description = 'negativethreshold \* rms in residual image + location(median)'
3553
+ value = self.__negativethreshold( self.__globals_( ) )
3554
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'negativethreshold': value},{'negativethreshold': self.__schema['negativethreshold']}) else ('\x1B[91m','\x1B[0m')
3555
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('negativethreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3556
+
3557
+ def __smoothfactor_dflt( self, glb ):
3558
+ if self.__usemask( glb ) == "auto-multithresh": return float(1.0)
3559
+ return None
3560
+
3561
+ def __smoothfactor( self, glb ):
3562
+ if 'smoothfactor' in glb: return glb['smoothfactor']
3563
+ dflt = self.__smoothfactor_dflt( glb )
3564
+ if dflt is not None: return dflt
3565
+ return float(1.0)
3566
+
3567
+ def __smoothfactor_inp(self):
3568
+ def xml_default( ):
3569
+ ## play the crazy subparameter shell game
3570
+ dflt = self.__smoothfactor_dflt( self.__globals_( ) )
3571
+ if dflt is not None: return dflt
3572
+ return float(1.0)
3573
+ if self.__smoothfactor_dflt( self.__globals_( ) ) is not None:
3574
+ description = 'smoothing factor in a unit of the beam'
3575
+ value = self.__smoothfactor( self.__globals_( ) )
3576
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'smoothfactor': value},{'smoothfactor': self.__schema['smoothfactor']}) else ('\x1B[91m','\x1B[0m')
3577
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('smoothfactor',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3578
+
3579
+ def __minbeamfrac_dflt( self, glb ):
3580
+ if self.__usemask( glb ) == "auto-multithresh": return float(0.3)
3581
+ return None
3582
+
3583
+ def __minbeamfrac( self, glb ):
3584
+ if 'minbeamfrac' in glb: return glb['minbeamfrac']
3585
+ dflt = self.__minbeamfrac_dflt( glb )
3586
+ if dflt is not None: return dflt
3587
+ return float(0.3)
3588
+
3589
+ def __minbeamfrac_inp(self):
3590
+ def xml_default( ):
3591
+ ## play the crazy subparameter shell game
3592
+ dflt = self.__minbeamfrac_dflt( self.__globals_( ) )
3593
+ if dflt is not None: return dflt
3594
+ return float(0.3)
3595
+ if self.__minbeamfrac_dflt( self.__globals_( ) ) is not None:
3596
+ description = 'minimum beam fraction for pruning'
3597
+ value = self.__minbeamfrac( self.__globals_( ) )
3598
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'minbeamfrac': value},{'minbeamfrac': self.__schema['minbeamfrac']}) else ('\x1B[91m','\x1B[0m')
3599
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('minbeamfrac',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3600
+
3601
+ def __cutthreshold_dflt( self, glb ):
3602
+ if self.__usemask( glb ) == "auto-multithresh": return float(0.01)
3603
+ return None
3604
+
3605
+ def __cutthreshold( self, glb ):
3606
+ if 'cutthreshold' in glb: return glb['cutthreshold']
3607
+ dflt = self.__cutthreshold_dflt( glb )
3608
+ if dflt is not None: return dflt
3609
+ return float(0.01)
3610
+
3611
+ def __cutthreshold_inp(self):
3612
+ def xml_default( ):
3613
+ ## play the crazy subparameter shell game
3614
+ dflt = self.__cutthreshold_dflt( self.__globals_( ) )
3615
+ if dflt is not None: return dflt
3616
+ return float(0.01)
3617
+ if self.__cutthreshold_dflt( self.__globals_( ) ) is not None:
3618
+ description = 'threshold to cut the smoothed mask to create a final mask'
3619
+ value = self.__cutthreshold( self.__globals_( ) )
3620
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'cutthreshold': value},{'cutthreshold': self.__schema['cutthreshold']}) else ('\x1B[91m','\x1B[0m')
3621
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('cutthreshold',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3622
+
3623
+ def __growiterations_dflt( self, glb ):
3624
+ if self.__usemask( glb ) == "auto-multithresh": return int(75)
3625
+ return None
3626
+
3627
+ def __growiterations( self, glb ):
3628
+ if 'growiterations' in glb: return glb['growiterations']
3629
+ dflt = self.__growiterations_dflt( glb )
3630
+ if dflt is not None: return dflt
3631
+ return int(75)
3632
+
3633
+ def __growiterations_inp(self):
3634
+ def xml_default( ):
3635
+ ## play the crazy subparameter shell game
3636
+ dflt = self.__growiterations_dflt( self.__globals_( ) )
3637
+ if dflt is not None: return dflt
3638
+ return int(75)
3639
+ if self.__growiterations_dflt( self.__globals_( ) ) is not None:
3640
+ description = 'number of binary dilation iterations for growing the mask'
3641
+ value = self.__growiterations( self.__globals_( ) )
3642
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'growiterations': value},{'growiterations': self.__schema['growiterations']}) else ('\x1B[91m','\x1B[0m')
3643
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('growiterations',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3644
+
3645
+ def __dogrowprune_dflt( self, glb ):
3646
+ if self.__usemask( glb ) == "auto-multithresh": return bool(True)
3647
+ return None
3648
+
3649
+ def __dogrowprune( self, glb ):
3650
+ if 'dogrowprune' in glb: return glb['dogrowprune']
3651
+ dflt = self.__dogrowprune_dflt( glb )
3652
+ if dflt is not None: return dflt
3653
+ return True
3654
+
3655
+ def __dogrowprune_inp(self):
3656
+ def xml_default( ):
3657
+ ## play the crazy subparameter shell game
3658
+ dflt = self.__dogrowprune_dflt( self.__globals_( ) )
3659
+ if dflt is not None: return dflt
3660
+ return True
3661
+ if self.__dogrowprune_dflt( self.__globals_( ) ) is not None:
3662
+ description = 'Do pruning on the grow mask'
3663
+ value = self.__dogrowprune( self.__globals_( ) )
3664
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'dogrowprune': value},{'dogrowprune': self.__schema['dogrowprune']}) else ('\x1B[91m','\x1B[0m')
3665
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('dogrowprune',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3666
+
3667
+ def __minpercentchange_dflt( self, glb ):
3668
+ if self.__usemask( glb ) == "auto-multithresh": return float(-1.0)
3669
+ return None
3670
+
3671
+ def __minpercentchange( self, glb ):
3672
+ if 'minpercentchange' in glb: return glb['minpercentchange']
3673
+ dflt = self.__minpercentchange_dflt( glb )
3674
+ if dflt is not None: return dflt
3675
+ return float(-1.0)
3676
+
3677
+ def __minpercentchange_inp(self):
3678
+ def xml_default( ):
3679
+ ## play the crazy subparameter shell game
3680
+ dflt = self.__minpercentchange_dflt( self.__globals_( ) )
3681
+ if dflt is not None: return dflt
3682
+ return float(-1.0)
3683
+ if self.__minpercentchange_dflt( self.__globals_( ) ) is not None:
3684
+ description = 'minimum percentage change in mask size (per channel plane) to trigger updating of mask by automask'
3685
+ value = self.__minpercentchange( self.__globals_( ) )
3686
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'minpercentchange': value},{'minpercentchange': self.__schema['minpercentchange']}) else ('\x1B[91m','\x1B[0m')
3687
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('minpercentchange',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3688
+
3689
+ def __verbose_dflt( self, glb ):
3690
+ if self.__usemask( glb ) == "auto-multithresh": return bool(False)
3691
+ return None
3692
+
3693
+ def __verbose( self, glb ):
3694
+ if 'verbose' in glb: return glb['verbose']
3695
+ dflt = self.__verbose_dflt( glb )
3696
+ if dflt is not None: return dflt
3697
+ return False
3698
+
3699
+ def __verbose_inp(self):
3700
+ def xml_default( ):
3701
+ ## play the crazy subparameter shell game
3702
+ dflt = self.__verbose_dflt( self.__globals_( ) )
3703
+ if dflt is not None: return dflt
3704
+ return False
3705
+ if self.__verbose_dflt( self.__globals_( ) ) is not None:
3706
+ description = 'True: print more automasking information in the logger'
3707
+ value = self.__verbose( self.__globals_( ) )
3708
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'verbose': value},{'verbose': self.__schema['verbose']}) else ('\x1B[91m','\x1B[0m')
3709
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('verbose',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3710
+
3711
+ def __fastnoise_dflt( self, glb ):
3712
+ return True
3713
+
3714
+ def __fastnoise( self, glb ):
3715
+ if 'fastnoise' in glb: return glb['fastnoise']
3716
+ return True
3717
+
3718
+ def __fastnoise_inp(self):
3719
+ def xml_default( ):
3720
+ ## play the crazy subparameter shell game
3721
+ dflt = self.__fastnoise_dflt( self.__globals_( ) )
3722
+ if dflt is not None: return dflt
3723
+ return True
3724
+ description = 'True: use the faster (old) noise calculation. False: use the new improved noise calculations'
3725
+ value = self.__fastnoise( self.__globals_( ) )
3726
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'fastnoise': value},{'fastnoise': self.__schema['fastnoise']}) else ('\x1B[91m','\x1B[0m')
3727
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('fastnoise',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3728
+
3729
+ def __restart_dflt( self, glb ):
3730
+ return True
3731
+
3732
+ def __restart( self, glb ):
3733
+ if 'restart' in glb: return glb['restart']
3734
+ return True
3735
+
3736
+ def __restart_inp(self):
3737
+ def xml_default( ):
3738
+ ## play the crazy subparameter shell game
3739
+ dflt = self.__restart_dflt( self.__globals_( ) )
3740
+ if dflt is not None: return dflt
3741
+ return True
3742
+ description = 'True : Re-use existing images. False : Increment imagename'
3743
+ value = self.__restart( self.__globals_( ) )
3744
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'restart': value},{'restart': self.__schema['restart']}) else ('\x1B[91m','\x1B[0m')
3745
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('restart',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3746
+
3747
+ def __savemodel_dflt( self, glb ):
3748
+ return 'none'
3749
+
3750
+ def __savemodel( self, glb ):
3751
+ if 'savemodel' in glb: return glb['savemodel']
3752
+ return 'none'
3753
+
3754
+ def __savemodel_inp(self):
3755
+ def xml_default( ):
3756
+ ## play the crazy subparameter shell game
3757
+ dflt = self.__savemodel_dflt( self.__globals_( ) )
3758
+ if dflt is not None: return dflt
3759
+ return 'none'
3760
+ description = 'Options to save model visibilities (none, virtual, modelcolumn)'
3761
+ value = self.__savemodel( self.__globals_( ) )
3762
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'savemodel': value},{'savemodel': self.__schema['savemodel']}) else ('\x1B[91m','\x1B[0m')
3763
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('savemodel',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3764
+
3765
+ def __calcres_dflt( self, glb ):
3766
+ return True
3767
+
3768
+ def __calcres( self, glb ):
3769
+ if 'calcres' in glb: return glb['calcres']
3770
+ return True
3771
+
3772
+ def __calcres_inp(self):
3773
+ def xml_default( ):
3774
+ ## play the crazy subparameter shell game
3775
+ dflt = self.__calcres_dflt( self.__globals_( ) )
3776
+ if dflt is not None: return dflt
3777
+ return True
3778
+ description = 'Calculate initial residual image'
3779
+ value = self.__calcres( self.__globals_( ) )
3780
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'calcres': value},{'calcres': self.__schema['calcres']}) else ('\x1B[91m','\x1B[0m')
3781
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('calcres',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3782
+
3783
+ def __calcpsf_dflt( self, glb ):
3784
+ return True
3785
+
3786
+ def __calcpsf( self, glb ):
3787
+ if 'calcpsf' in glb: return glb['calcpsf']
3788
+ return True
3789
+
3790
+ def __calcpsf_inp(self):
3791
+ def xml_default( ):
3792
+ ## play the crazy subparameter shell game
3793
+ dflt = self.__calcpsf_dflt( self.__globals_( ) )
3794
+ if dflt is not None: return dflt
3795
+ return True
3796
+ description = 'Calculate PSF'
3797
+ value = self.__calcpsf( self.__globals_( ) )
3798
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'calcpsf': value},{'calcpsf': self.__schema['calcpsf']}) else ('\x1B[91m','\x1B[0m')
3799
+ self.__do_inp_output('\x1B[1m\x1B[47m%-23.23s =\x1B[0m %s%-23s%s' % ('calcpsf',pre,self.__to_string_(value),post),description,13+len(pre)+len(post))
3800
+
3801
+ def __psfcutoff_dflt( self, glb ):
3802
+ if self.__calcpsf( glb ) == bool(True): return float(0.35)
3803
+ return None
3804
+
3805
+ def __psfcutoff( self, glb ):
3806
+ if 'psfcutoff' in glb: return glb['psfcutoff']
3807
+ dflt = self.__psfcutoff_dflt( glb )
3808
+ if dflt is not None: return dflt
3809
+ return float(0.35)
3810
+
3811
+ def __psfcutoff_inp(self):
3812
+ def xml_default( ):
3813
+ ## play the crazy subparameter shell game
3814
+ dflt = self.__psfcutoff_dflt( self.__globals_( ) )
3815
+ if dflt is not None: return dflt
3816
+ return float(0.35)
3817
+ if self.__psfcutoff_dflt( self.__globals_( ) ) is not None:
3818
+ description = 'All pixels in the main lobe of the PSF above psfcutoff are used to fit a Gaussian beam (the Clean beam).'
3819
+ value = self.__psfcutoff( self.__globals_( ) )
3820
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'psfcutoff': value},{'psfcutoff': self.__schema['psfcutoff']}) else ('\x1B[91m','\x1B[0m')
3821
+ self.__do_inp_output(' \x1B[92m%-20.20s =\x1B[0m %s%-23s%s' % ('psfcutoff',pre,self.__to_string_(value),post),description,9+len(pre)+len(post))
3822
+
3823
+ def __parallel_dflt( self, glb ):
3824
+ return False
3825
+
3826
+ def __parallel( self, glb ):
3827
+ if 'parallel' in glb: return glb['parallel']
3828
+ return False
3829
+
3830
+ def __parallel_inp(self):
3831
+ def xml_default( ):
3832
+ ## play the crazy subparameter shell game
3833
+ dflt = self.__parallel_dflt( self.__globals_( ) )
3834
+ if dflt is not None: return dflt
3835
+ return False
3836
+ description = 'Run major cycles in parallel'
3837
+ value = self.__parallel( self.__globals_( ) )
3838
+ (pre,post) = (('','') if value == xml_default( ) else ('\x1B[34m','\x1B[0m')) if self.__validate_({'parallel': value},{'parallel': self.__schema['parallel']}) else ('\x1B[91m','\x1B[0m')
3839
+ self.__do_inp_output('%-23.23s = %s%-23s%s' % ('parallel',pre,self.__to_string_(value),post),description,0+len(pre)+len(post))
3840
+
3841
+
3842
+ #--------- global default implementation-------------------------------------------
3843
+ @static_var('state', __sf__('casa_inp_go_state'))
3844
+ def set_global_defaults(self):
3845
+ self.set_global_defaults.state['last'] = self
3846
+ glb = self.__globals_( )
3847
+ if 'vis' in glb: del glb['vis']
3848
+ if 'selectdata' in glb: del glb['selectdata']
3849
+ if 'field' in glb: del glb['field']
3850
+ if 'spw' in glb: del glb['spw']
3851
+ if 'timerange' in glb: del glb['timerange']
3852
+ if 'uvrange' in glb: del glb['uvrange']
3853
+ if 'antenna' in glb: del glb['antenna']
3854
+ if 'scan' in glb: del glb['scan']
3855
+ if 'observation' in glb: del glb['observation']
3856
+ if 'intent' in glb: del glb['intent']
3857
+ if 'datacolumn' in glb: del glb['datacolumn']
3858
+ if 'imagename' in glb: del glb['imagename']
3859
+ if 'imsize' in glb: del glb['imsize']
3860
+ if 'cell' in glb: del glb['cell']
3861
+ if 'phasecenter' in glb: del glb['phasecenter']
3862
+ if 'stokes' in glb: del glb['stokes']
3863
+ if 'projection' in glb: del glb['projection']
3864
+ if 'startmodel' in glb: del glb['startmodel']
3865
+ if 'specmode' in glb: del glb['specmode']
3866
+ if 'reffreq' in glb: del glb['reffreq']
3867
+ if 'nchan' in glb: del glb['nchan']
3868
+ if 'start' in glb: del glb['start']
3869
+ if 'width' in glb: del glb['width']
3870
+ if 'outframe' in glb: del glb['outframe']
3871
+ if 'veltype' in glb: del glb['veltype']
3872
+ if 'restfreq' in glb: del glb['restfreq']
3873
+ if 'interpolation' in glb: del glb['interpolation']
3874
+ if 'perchanweightdensity' in glb: del glb['perchanweightdensity']
3875
+ if 'gridder' in glb: del glb['gridder']
3876
+ if 'facets' in glb: del glb['facets']
3877
+ if 'psfphasecenter' in glb: del glb['psfphasecenter']
3878
+ if 'wprojplanes' in glb: del glb['wprojplanes']
3879
+ if 'vptable' in glb: del glb['vptable']
3880
+ if 'mosweight' in glb: del glb['mosweight']
3881
+ if 'aterm' in glb: del glb['aterm']
3882
+ if 'psterm' in glb: del glb['psterm']
3883
+ if 'wbawp' in glb: del glb['wbawp']
3884
+ if 'conjbeams' in glb: del glb['conjbeams']
3885
+ if 'cfcache' in glb: del glb['cfcache']
3886
+ if 'usepointing' in glb: del glb['usepointing']
3887
+ if 'computepastep' in glb: del glb['computepastep']
3888
+ if 'rotatepastep' in glb: del glb['rotatepastep']
3889
+ if 'pointingoffsetsigdev' in glb: del glb['pointingoffsetsigdev']
3890
+ if 'pblimit' in glb: del glb['pblimit']
3891
+ if 'normtype' in glb: del glb['normtype']
3892
+ if 'deconvolver' in glb: del glb['deconvolver']
3893
+ if 'scales' in glb: del glb['scales']
3894
+ if 'nterms' in glb: del glb['nterms']
3895
+ if 'smallscalebias' in glb: del glb['smallscalebias']
3896
+ if 'fusedthreshold' in glb: del glb['fusedthreshold']
3897
+ if 'largestscale' in glb: del glb['largestscale']
3898
+ if 'restoration' in glb: del glb['restoration']
3899
+ if 'restoringbeam' in glb: del glb['restoringbeam']
3900
+ if 'pbcor' in glb: del glb['pbcor']
3901
+ if 'outlierfile' in glb: del glb['outlierfile']
3902
+ if 'weighting' in glb: del glb['weighting']
3903
+ if 'robust' in glb: del glb['robust']
3904
+ if 'noise' in glb: del glb['noise']
3905
+ if 'npixels' in glb: del glb['npixels']
3906
+ if 'uvtaper' in glb: del glb['uvtaper']
3907
+ if 'niter' in glb: del glb['niter']
3908
+ if 'gain' in glb: del glb['gain']
3909
+ if 'threshold' in glb: del glb['threshold']
3910
+ if 'nsigma' in glb: del glb['nsigma']
3911
+ if 'cycleniter' in glb: del glb['cycleniter']
3912
+ if 'cyclefactor' in glb: del glb['cyclefactor']
3913
+ if 'minpsffraction' in glb: del glb['minpsffraction']
3914
+ if 'maxpsffraction' in glb: del glb['maxpsffraction']
3915
+ if 'nmajor' in glb: del glb['nmajor']
3916
+ if 'usemask' in glb: del glb['usemask']
3917
+ if 'mask' in glb: del glb['mask']
3918
+ if 'pbmask' in glb: del glb['pbmask']
3919
+ if 'sidelobethreshold' in glb: del glb['sidelobethreshold']
3920
+ if 'noisethreshold' in glb: del glb['noisethreshold']
3921
+ if 'lownoisethreshold' in glb: del glb['lownoisethreshold']
3922
+ if 'negativethreshold' in glb: del glb['negativethreshold']
3923
+ if 'smoothfactor' in glb: del glb['smoothfactor']
3924
+ if 'minbeamfrac' in glb: del glb['minbeamfrac']
3925
+ if 'cutthreshold' in glb: del glb['cutthreshold']
3926
+ if 'growiterations' in glb: del glb['growiterations']
3927
+ if 'dogrowprune' in glb: del glb['dogrowprune']
3928
+ if 'minpercentchange' in glb: del glb['minpercentchange']
3929
+ if 'verbose' in glb: del glb['verbose']
3930
+ if 'fastnoise' in glb: del glb['fastnoise']
3931
+ if 'restart' in glb: del glb['restart']
3932
+ if 'savemodel' in glb: del glb['savemodel']
3933
+ if 'calcres' in glb: del glb['calcres']
3934
+ if 'calcpsf' in glb: del glb['calcpsf']
3935
+ if 'psfcutoff' in glb: del glb['psfcutoff']
3936
+ if 'parallel' in glb: del glb['parallel']
3937
+
3938
+ #--------- inp function -----------------------------------------------------------
3939
+ def inp(self):
3940
+ print("# iclean -- %s" % self._info_desc_)
3941
+ self.term_width, self.term_height = shutil.get_terminal_size(fallback=(80, 24))
3942
+ self.__vis_inp( )
3943
+ self.__selectdata_inp( )
3944
+ self.__field_inp( )
3945
+ self.__spw_inp( )
3946
+ self.__timerange_inp( )
3947
+ self.__uvrange_inp( )
3948
+ self.__antenna_inp( )
3949
+ self.__scan_inp( )
3950
+ self.__observation_inp( )
3951
+ self.__intent_inp( )
3952
+ self.__datacolumn_inp( )
3953
+ self.__imagename_inp( )
3954
+ self.__imsize_inp( )
3955
+ self.__cell_inp( )
3956
+ self.__phasecenter_inp( )
3957
+ self.__stokes_inp( )
3958
+ self.__projection_inp( )
3959
+ self.__startmodel_inp( )
3960
+ self.__specmode_inp( )
3961
+ self.__reffreq_inp( )
3962
+ self.__nchan_inp( )
3963
+ self.__start_inp( )
3964
+ self.__width_inp( )
3965
+ self.__outframe_inp( )
3966
+ self.__veltype_inp( )
3967
+ self.__restfreq_inp( )
3968
+ self.__interpolation_inp( )
3969
+ self.__perchanweightdensity_inp( )
3970
+ self.__gridder_inp( )
3971
+ self.__facets_inp( )
3972
+ self.__psfphasecenter_inp( )
3973
+ self.__wprojplanes_inp( )
3974
+ self.__vptable_inp( )
3975
+ self.__mosweight_inp( )
3976
+ self.__aterm_inp( )
3977
+ self.__psterm_inp( )
3978
+ self.__wbawp_inp( )
3979
+ self.__conjbeams_inp( )
3980
+ self.__cfcache_inp( )
3981
+ self.__usepointing_inp( )
3982
+ self.__computepastep_inp( )
3983
+ self.__rotatepastep_inp( )
3984
+ self.__pointingoffsetsigdev_inp( )
3985
+ self.__pblimit_inp( )
3986
+ self.__normtype_inp( )
3987
+ self.__deconvolver_inp( )
3988
+ self.__scales_inp( )
3989
+ self.__nterms_inp( )
3990
+ self.__smallscalebias_inp( )
3991
+ self.__fusedthreshold_inp( )
3992
+ self.__largestscale_inp( )
3993
+ self.__restoration_inp( )
3994
+ self.__restoringbeam_inp( )
3995
+ self.__pbcor_inp( )
3996
+ self.__outlierfile_inp( )
3997
+ self.__weighting_inp( )
3998
+ self.__robust_inp( )
3999
+ self.__noise_inp( )
4000
+ self.__npixels_inp( )
4001
+ self.__uvtaper_inp( )
4002
+ self.__niter_inp( )
4003
+ self.__gain_inp( )
4004
+ self.__threshold_inp( )
4005
+ self.__nsigma_inp( )
4006
+ self.__cycleniter_inp( )
4007
+ self.__cyclefactor_inp( )
4008
+ self.__minpsffraction_inp( )
4009
+ self.__maxpsffraction_inp( )
4010
+ self.__nmajor_inp( )
4011
+ self.__usemask_inp( )
4012
+ self.__mask_inp( )
4013
+ self.__pbmask_inp( )
4014
+ self.__sidelobethreshold_inp( )
4015
+ self.__noisethreshold_inp( )
4016
+ self.__lownoisethreshold_inp( )
4017
+ self.__negativethreshold_inp( )
4018
+ self.__smoothfactor_inp( )
4019
+ self.__minbeamfrac_inp( )
4020
+ self.__cutthreshold_inp( )
4021
+ self.__growiterations_inp( )
4022
+ self.__dogrowprune_inp( )
4023
+ self.__minpercentchange_inp( )
4024
+ self.__verbose_inp( )
4025
+ self.__fastnoise_inp( )
4026
+ self.__restart_inp( )
4027
+ self.__savemodel_inp( )
4028
+ self.__calcres_inp( )
4029
+ self.__calcpsf_inp( )
4030
+ self.__psfcutoff_inp( )
4031
+ self.__parallel_inp( )
4032
+
4033
+ #--------- tget function ----------------------------------------------------------
4034
+ @static_var('state', __sf__('casa_inp_go_state'))
4035
+ def tget(self,savefile=None):
4036
+ from runpy import run_path
4037
+ filename = savefile
4038
+ if filename is None:
4039
+ filename = "iclean.last" if os.path.isfile("iclean.last") else "iclean.saved"
4040
+ if os.path.isfile(filename):
4041
+ glob = _find_frame( )
4042
+ newglob = run_path( filename, init_globals={ } )
4043
+ for i in newglob:
4044
+ glob[i] = newglob[i]
4045
+ self.tget.state['last'] = self
4046
+ else:
4047
+ print("could not find last file: %s\nsetting defaults instead..." % filename)
4048
+ self.set_global_defaults( )
4049
+
4050
+ #--------- tput function ----------------------------------------------------------
4051
+ def tput(self,outfile=None):
4052
+ def noobj(s):
4053
+ if s.startswith('<') and s.endswith('>'):
4054
+ return "None"
4055
+ else:
4056
+ return s
4057
+
4058
+ _postfile = outfile if outfile is not None else os.path.realpath('iclean.last')
4059
+
4060
+ _invocation_parameters = OrderedDict( )
4061
+ _invocation_parameters['vis'] = self.__vis( self.__globals_( ) )
4062
+ _invocation_parameters['selectdata'] = self.__selectdata( self.__globals_( ) )
4063
+ _invocation_parameters['field'] = self.__field( self.__globals_( ) )
4064
+ _invocation_parameters['spw'] = self.__spw( self.__globals_( ) )
4065
+ _invocation_parameters['timerange'] = self.__timerange( self.__globals_( ) )
4066
+ _invocation_parameters['uvrange'] = self.__uvrange( self.__globals_( ) )
4067
+ _invocation_parameters['antenna'] = self.__antenna( self.__globals_( ) )
4068
+ _invocation_parameters['scan'] = self.__scan( self.__globals_( ) )
4069
+ _invocation_parameters['observation'] = self.__observation( self.__globals_( ) )
4070
+ _invocation_parameters['intent'] = self.__intent( self.__globals_( ) )
4071
+ _invocation_parameters['datacolumn'] = self.__datacolumn( self.__globals_( ) )
4072
+ _invocation_parameters['imagename'] = self.__imagename( self.__globals_( ) )
4073
+ _invocation_parameters['imsize'] = self.__imsize( self.__globals_( ) )
4074
+ _invocation_parameters['cell'] = self.__cell( self.__globals_( ) )
4075
+ _invocation_parameters['phasecenter'] = self.__phasecenter( self.__globals_( ) )
4076
+ _invocation_parameters['stokes'] = self.__stokes( self.__globals_( ) )
4077
+ _invocation_parameters['projection'] = self.__projection( self.__globals_( ) )
4078
+ _invocation_parameters['startmodel'] = self.__startmodel( self.__globals_( ) )
4079
+ _invocation_parameters['specmode'] = self.__specmode( self.__globals_( ) )
4080
+ _invocation_parameters['reffreq'] = self.__reffreq( self.__globals_( ) )
4081
+ _invocation_parameters['nchan'] = self.__nchan( self.__globals_( ) )
4082
+ _invocation_parameters['start'] = self.__start( self.__globals_( ) )
4083
+ _invocation_parameters['width'] = self.__width( self.__globals_( ) )
4084
+ _invocation_parameters['outframe'] = self.__outframe( self.__globals_( ) )
4085
+ _invocation_parameters['veltype'] = self.__veltype( self.__globals_( ) )
4086
+ _invocation_parameters['restfreq'] = self.__restfreq( self.__globals_( ) )
4087
+ _invocation_parameters['interpolation'] = self.__interpolation( self.__globals_( ) )
4088
+ _invocation_parameters['perchanweightdensity'] = self.__perchanweightdensity( self.__globals_( ) )
4089
+ _invocation_parameters['gridder'] = self.__gridder( self.__globals_( ) )
4090
+ _invocation_parameters['facets'] = self.__facets( self.__globals_( ) )
4091
+ _invocation_parameters['psfphasecenter'] = self.__psfphasecenter( self.__globals_( ) )
4092
+ _invocation_parameters['wprojplanes'] = self.__wprojplanes( self.__globals_( ) )
4093
+ _invocation_parameters['vptable'] = self.__vptable( self.__globals_( ) )
4094
+ _invocation_parameters['mosweight'] = self.__mosweight( self.__globals_( ) )
4095
+ _invocation_parameters['aterm'] = self.__aterm( self.__globals_( ) )
4096
+ _invocation_parameters['psterm'] = self.__psterm( self.__globals_( ) )
4097
+ _invocation_parameters['wbawp'] = self.__wbawp( self.__globals_( ) )
4098
+ _invocation_parameters['conjbeams'] = self.__conjbeams( self.__globals_( ) )
4099
+ _invocation_parameters['cfcache'] = self.__cfcache( self.__globals_( ) )
4100
+ _invocation_parameters['usepointing'] = self.__usepointing( self.__globals_( ) )
4101
+ _invocation_parameters['computepastep'] = self.__computepastep( self.__globals_( ) )
4102
+ _invocation_parameters['rotatepastep'] = self.__rotatepastep( self.__globals_( ) )
4103
+ _invocation_parameters['pointingoffsetsigdev'] = self.__pointingoffsetsigdev( self.__globals_( ) )
4104
+ _invocation_parameters['pblimit'] = self.__pblimit( self.__globals_( ) )
4105
+ _invocation_parameters['normtype'] = self.__normtype( self.__globals_( ) )
4106
+ _invocation_parameters['deconvolver'] = self.__deconvolver( self.__globals_( ) )
4107
+ _invocation_parameters['scales'] = self.__scales( self.__globals_( ) )
4108
+ _invocation_parameters['nterms'] = self.__nterms( self.__globals_( ) )
4109
+ _invocation_parameters['smallscalebias'] = self.__smallscalebias( self.__globals_( ) )
4110
+ _invocation_parameters['fusedthreshold'] = self.__fusedthreshold( self.__globals_( ) )
4111
+ _invocation_parameters['largestscale'] = self.__largestscale( self.__globals_( ) )
4112
+ _invocation_parameters['restoration'] = self.__restoration( self.__globals_( ) )
4113
+ _invocation_parameters['restoringbeam'] = self.__restoringbeam( self.__globals_( ) )
4114
+ _invocation_parameters['pbcor'] = self.__pbcor( self.__globals_( ) )
4115
+ _invocation_parameters['outlierfile'] = self.__outlierfile( self.__globals_( ) )
4116
+ _invocation_parameters['weighting'] = self.__weighting( self.__globals_( ) )
4117
+ _invocation_parameters['robust'] = self.__robust( self.__globals_( ) )
4118
+ _invocation_parameters['noise'] = self.__noise( self.__globals_( ) )
4119
+ _invocation_parameters['npixels'] = self.__npixels( self.__globals_( ) )
4120
+ _invocation_parameters['uvtaper'] = self.__uvtaper( self.__globals_( ) )
4121
+ _invocation_parameters['niter'] = self.__niter( self.__globals_( ) )
4122
+ _invocation_parameters['gain'] = self.__gain( self.__globals_( ) )
4123
+ _invocation_parameters['threshold'] = self.__threshold( self.__globals_( ) )
4124
+ _invocation_parameters['nsigma'] = self.__nsigma( self.__globals_( ) )
4125
+ _invocation_parameters['cycleniter'] = self.__cycleniter( self.__globals_( ) )
4126
+ _invocation_parameters['cyclefactor'] = self.__cyclefactor( self.__globals_( ) )
4127
+ _invocation_parameters['minpsffraction'] = self.__minpsffraction( self.__globals_( ) )
4128
+ _invocation_parameters['maxpsffraction'] = self.__maxpsffraction( self.__globals_( ) )
4129
+ _invocation_parameters['nmajor'] = self.__nmajor( self.__globals_( ) )
4130
+ _invocation_parameters['usemask'] = self.__usemask( self.__globals_( ) )
4131
+ _invocation_parameters['mask'] = self.__mask( self.__globals_( ) )
4132
+ _invocation_parameters['pbmask'] = self.__pbmask( self.__globals_( ) )
4133
+ _invocation_parameters['sidelobethreshold'] = self.__sidelobethreshold( self.__globals_( ) )
4134
+ _invocation_parameters['noisethreshold'] = self.__noisethreshold( self.__globals_( ) )
4135
+ _invocation_parameters['lownoisethreshold'] = self.__lownoisethreshold( self.__globals_( ) )
4136
+ _invocation_parameters['negativethreshold'] = self.__negativethreshold( self.__globals_( ) )
4137
+ _invocation_parameters['smoothfactor'] = self.__smoothfactor( self.__globals_( ) )
4138
+ _invocation_parameters['minbeamfrac'] = self.__minbeamfrac( self.__globals_( ) )
4139
+ _invocation_parameters['cutthreshold'] = self.__cutthreshold( self.__globals_( ) )
4140
+ _invocation_parameters['growiterations'] = self.__growiterations( self.__globals_( ) )
4141
+ _invocation_parameters['dogrowprune'] = self.__dogrowprune( self.__globals_( ) )
4142
+ _invocation_parameters['minpercentchange'] = self.__minpercentchange( self.__globals_( ) )
4143
+ _invocation_parameters['verbose'] = self.__verbose( self.__globals_( ) )
4144
+ _invocation_parameters['fastnoise'] = self.__fastnoise( self.__globals_( ) )
4145
+ _invocation_parameters['restart'] = self.__restart( self.__globals_( ) )
4146
+ _invocation_parameters['savemodel'] = self.__savemodel( self.__globals_( ) )
4147
+ _invocation_parameters['calcres'] = self.__calcres( self.__globals_( ) )
4148
+ _invocation_parameters['calcpsf'] = self.__calcpsf( self.__globals_( ) )
4149
+ _invocation_parameters['psfcutoff'] = self.__psfcutoff( self.__globals_( ) )
4150
+ _invocation_parameters['parallel'] = self.__parallel( self.__globals_( ) )
4151
+
4152
+ try:
4153
+ with open(_postfile,'w') as _f:
4154
+ for _i in _invocation_parameters:
4155
+ _f.write("%-20s = %s\n" % (_i,noobj(repr(_invocation_parameters[_i]))))
4156
+ _f.write("#iclean( ")
4157
+ count = 0
4158
+ for _i in _invocation_parameters:
4159
+ _f.write("%s=%s" % (_i,noobj(repr(_invocation_parameters[_i]))))
4160
+ count += 1
4161
+ if count < len(_invocation_parameters): _f.write(",")
4162
+ _f.write(" )\n")
4163
+ except: return False
4164
+ return True
4165
+
4166
+ def __call__( self, vis=None, selectdata=None, field=None, spw=None, timerange=None, uvrange=None, antenna=None, scan=None, observation=None, intent=None, datacolumn=None, imagename=None, imsize=None, cell=None, phasecenter=None, stokes=None, projection=None, startmodel=None, specmode=None, reffreq=None, nchan=None, start=None, width=None, outframe=None, veltype=None, restfreq=None, interpolation=None, perchanweightdensity=None, gridder=None, facets=None, psfphasecenter=None, wprojplanes=None, vptable=None, mosweight=None, aterm=None, psterm=None, wbawp=None, conjbeams=None, cfcache=None, usepointing=None, computepastep=None, rotatepastep=None, pointingoffsetsigdev=None, pblimit=None, normtype=None, deconvolver=None, scales=None, nterms=None, smallscalebias=None, fusedthreshold=None, largestscale=None, restoration=None, restoringbeam=None, pbcor=None, outlierfile=None, weighting=None, robust=None, noise=None, npixels=None, uvtaper=None, niter=None, gain=None, threshold=None, nsigma=None, cycleniter=None, cyclefactor=None, minpsffraction=None, maxpsffraction=None, nmajor=None, usemask=None, mask=None, pbmask=None, sidelobethreshold=None, noisethreshold=None, lownoisethreshold=None, negativethreshold=None, smoothfactor=None, minbeamfrac=None, cutthreshold=None, growiterations=None, dogrowprune=None, minpercentchange=None, verbose=None, fastnoise=None, restart=None, savemodel=None, calcres=None, calcpsf=None, psfcutoff=None, parallel=None ):
4167
+ def noobj(s):
4168
+ if s.startswith('<') and s.endswith('>'):
4169
+ return "None"
4170
+ else:
4171
+ return s
4172
+ _prefile = os.path.realpath('iclean.pre')
4173
+ _postfile = os.path.realpath('iclean.last')
4174
+ task_result = None
4175
+ _arguments = [vis,selectdata,field,spw,timerange,uvrange,antenna,scan,observation,intent,datacolumn,imagename,imsize,cell,phasecenter,stokes,projection,startmodel,specmode,reffreq,nchan,start,width,outframe,veltype,restfreq,interpolation,perchanweightdensity,gridder,facets,psfphasecenter,wprojplanes,vptable,mosweight,aterm,psterm,wbawp,conjbeams,cfcache,usepointing,computepastep,rotatepastep,pointingoffsetsigdev,pblimit,normtype,deconvolver,scales,nterms,smallscalebias,fusedthreshold,largestscale,restoration,restoringbeam,pbcor,outlierfile,weighting,robust,noise,npixels,uvtaper,niter,gain,threshold,nsigma,cycleniter,cyclefactor,minpsffraction,maxpsffraction,nmajor,usemask,mask,pbmask,sidelobethreshold,noisethreshold,lownoisethreshold,negativethreshold,smoothfactor,minbeamfrac,cutthreshold,growiterations,dogrowprune,minpercentchange,verbose,fastnoise,restart,savemodel,calcres,calcpsf,psfcutoff,parallel,]
4176
+ _invocation_parameters = OrderedDict( )
4177
+ if any(map(lambda x: x is not None,_arguments)):
4178
+ # invoke python style
4179
+ # set the non sub-parameters that are not None
4180
+ local_global = { }
4181
+ if vis is not None: local_global['vis'] = vis
4182
+ if selectdata is not None: local_global['selectdata'] = selectdata
4183
+ if datacolumn is not None: local_global['datacolumn'] = datacolumn
4184
+ if imagename is not None: local_global['imagename'] = imagename
4185
+ if imsize is not None: local_global['imsize'] = imsize
4186
+ if cell is not None: local_global['cell'] = cell
4187
+ if phasecenter is not None: local_global['phasecenter'] = phasecenter
4188
+ if stokes is not None: local_global['stokes'] = stokes
4189
+ if projection is not None: local_global['projection'] = projection
4190
+ if startmodel is not None: local_global['startmodel'] = startmodel
4191
+ if specmode is not None: local_global['specmode'] = specmode
4192
+ if gridder is not None: local_global['gridder'] = gridder
4193
+ if pblimit is not None: local_global['pblimit'] = pblimit
4194
+ if deconvolver is not None: local_global['deconvolver'] = deconvolver
4195
+ if restoration is not None: local_global['restoration'] = restoration
4196
+ if outlierfile is not None: local_global['outlierfile'] = outlierfile
4197
+ if weighting is not None: local_global['weighting'] = weighting
4198
+ if niter is not None: local_global['niter'] = niter
4199
+ if nmajor is not None: local_global['nmajor'] = nmajor
4200
+ if usemask is not None: local_global['usemask'] = usemask
4201
+ if fastnoise is not None: local_global['fastnoise'] = fastnoise
4202
+ if restart is not None: local_global['restart'] = restart
4203
+ if savemodel is not None: local_global['savemodel'] = savemodel
4204
+ if calcres is not None: local_global['calcres'] = calcres
4205
+ if calcpsf is not None: local_global['calcpsf'] = calcpsf
4206
+ if parallel is not None: local_global['parallel'] = parallel
4207
+
4208
+ # the invocation parameters for the non-subparameters can now be set - this picks up those defaults
4209
+ _invocation_parameters['vis'] = self.__vis( local_global )
4210
+ _invocation_parameters['selectdata'] = self.__selectdata( local_global )
4211
+ _invocation_parameters['datacolumn'] = self.__datacolumn( local_global )
4212
+ _invocation_parameters['imagename'] = self.__imagename( local_global )
4213
+ _invocation_parameters['imsize'] = self.__imsize( local_global )
4214
+ _invocation_parameters['cell'] = self.__cell( local_global )
4215
+ _invocation_parameters['phasecenter'] = self.__phasecenter( local_global )
4216
+ _invocation_parameters['stokes'] = self.__stokes( local_global )
4217
+ _invocation_parameters['projection'] = self.__projection( local_global )
4218
+ _invocation_parameters['startmodel'] = self.__startmodel( local_global )
4219
+ _invocation_parameters['specmode'] = self.__specmode( local_global )
4220
+ _invocation_parameters['gridder'] = self.__gridder( local_global )
4221
+ _invocation_parameters['pblimit'] = self.__pblimit( local_global )
4222
+ _invocation_parameters['deconvolver'] = self.__deconvolver( local_global )
4223
+ _invocation_parameters['restoration'] = self.__restoration( local_global )
4224
+ _invocation_parameters['outlierfile'] = self.__outlierfile( local_global )
4225
+ _invocation_parameters['weighting'] = self.__weighting( local_global )
4226
+ _invocation_parameters['niter'] = self.__niter( local_global )
4227
+ _invocation_parameters['nmajor'] = self.__nmajor( local_global )
4228
+ _invocation_parameters['usemask'] = self.__usemask( local_global )
4229
+ _invocation_parameters['fastnoise'] = self.__fastnoise( local_global )
4230
+ _invocation_parameters['restart'] = self.__restart( local_global )
4231
+ _invocation_parameters['savemodel'] = self.__savemodel( local_global )
4232
+ _invocation_parameters['calcres'] = self.__calcres( local_global )
4233
+ _invocation_parameters['calcpsf'] = self.__calcpsf( local_global )
4234
+ _invocation_parameters['parallel'] = self.__parallel( local_global )
4235
+
4236
+ # the sub-parameters can then be set. Use the supplied value if not None, else the function, which gets the appropriate default
4237
+ _invocation_parameters['field'] = self.__field( _invocation_parameters ) if field is None else field
4238
+ _invocation_parameters['spw'] = self.__spw( _invocation_parameters ) if spw is None else spw
4239
+ _invocation_parameters['timerange'] = self.__timerange( _invocation_parameters ) if timerange is None else timerange
4240
+ _invocation_parameters['uvrange'] = self.__uvrange( _invocation_parameters ) if uvrange is None else uvrange
4241
+ _invocation_parameters['antenna'] = self.__antenna( _invocation_parameters ) if antenna is None else antenna
4242
+ _invocation_parameters['scan'] = self.__scan( _invocation_parameters ) if scan is None else scan
4243
+ _invocation_parameters['observation'] = self.__observation( _invocation_parameters ) if observation is None else observation
4244
+ _invocation_parameters['intent'] = self.__intent( _invocation_parameters ) if intent is None else intent
4245
+ _invocation_parameters['reffreq'] = self.__reffreq( _invocation_parameters ) if reffreq is None else reffreq
4246
+ _invocation_parameters['nchan'] = self.__nchan( _invocation_parameters ) if nchan is None else nchan
4247
+ _invocation_parameters['start'] = self.__start( _invocation_parameters ) if start is None else start
4248
+ _invocation_parameters['width'] = self.__width( _invocation_parameters ) if width is None else width
4249
+ _invocation_parameters['outframe'] = self.__outframe( _invocation_parameters ) if outframe is None else outframe
4250
+ _invocation_parameters['veltype'] = self.__veltype( _invocation_parameters ) if veltype is None else veltype
4251
+ _invocation_parameters['restfreq'] = self.__restfreq( _invocation_parameters ) if restfreq is None else restfreq
4252
+ _invocation_parameters['interpolation'] = self.__interpolation( _invocation_parameters ) if interpolation is None else interpolation
4253
+ _invocation_parameters['perchanweightdensity'] = self.__perchanweightdensity( _invocation_parameters ) if perchanweightdensity is None else perchanweightdensity
4254
+ _invocation_parameters['facets'] = self.__facets( _invocation_parameters ) if facets is None else facets
4255
+ _invocation_parameters['psfphasecenter'] = self.__psfphasecenter( _invocation_parameters ) if psfphasecenter is None else psfphasecenter
4256
+ _invocation_parameters['wprojplanes'] = self.__wprojplanes( _invocation_parameters ) if wprojplanes is None else wprojplanes
4257
+ _invocation_parameters['vptable'] = self.__vptable( _invocation_parameters ) if vptable is None else vptable
4258
+ _invocation_parameters['mosweight'] = self.__mosweight( _invocation_parameters ) if mosweight is None else mosweight
4259
+ _invocation_parameters['aterm'] = self.__aterm( _invocation_parameters ) if aterm is None else aterm
4260
+ _invocation_parameters['psterm'] = self.__psterm( _invocation_parameters ) if psterm is None else psterm
4261
+ _invocation_parameters['wbawp'] = self.__wbawp( _invocation_parameters ) if wbawp is None else wbawp
4262
+ _invocation_parameters['conjbeams'] = self.__conjbeams( _invocation_parameters ) if conjbeams is None else conjbeams
4263
+ _invocation_parameters['cfcache'] = self.__cfcache( _invocation_parameters ) if cfcache is None else cfcache
4264
+ _invocation_parameters['usepointing'] = self.__usepointing( _invocation_parameters ) if usepointing is None else usepointing
4265
+ _invocation_parameters['computepastep'] = self.__computepastep( _invocation_parameters ) if computepastep is None else computepastep
4266
+ _invocation_parameters['rotatepastep'] = self.__rotatepastep( _invocation_parameters ) if rotatepastep is None else rotatepastep
4267
+ _invocation_parameters['pointingoffsetsigdev'] = self.__pointingoffsetsigdev( _invocation_parameters ) if pointingoffsetsigdev is None else pointingoffsetsigdev
4268
+ _invocation_parameters['normtype'] = self.__normtype( _invocation_parameters ) if normtype is None else normtype
4269
+ _invocation_parameters['scales'] = self.__scales( _invocation_parameters ) if scales is None else scales
4270
+ _invocation_parameters['nterms'] = self.__nterms( _invocation_parameters ) if nterms is None else nterms
4271
+ _invocation_parameters['smallscalebias'] = self.__smallscalebias( _invocation_parameters ) if smallscalebias is None else smallscalebias
4272
+ _invocation_parameters['fusedthreshold'] = self.__fusedthreshold( _invocation_parameters ) if fusedthreshold is None else fusedthreshold
4273
+ _invocation_parameters['largestscale'] = self.__largestscale( _invocation_parameters ) if largestscale is None else largestscale
4274
+ _invocation_parameters['restoringbeam'] = self.__restoringbeam( _invocation_parameters ) if restoringbeam is None else restoringbeam
4275
+ _invocation_parameters['pbcor'] = self.__pbcor( _invocation_parameters ) if pbcor is None else pbcor
4276
+ _invocation_parameters['robust'] = self.__robust( _invocation_parameters ) if robust is None else robust
4277
+ _invocation_parameters['noise'] = self.__noise( _invocation_parameters ) if noise is None else noise
4278
+ _invocation_parameters['npixels'] = self.__npixels( _invocation_parameters ) if npixels is None else npixels
4279
+ _invocation_parameters['uvtaper'] = self.__uvtaper( _invocation_parameters ) if uvtaper is None else uvtaper
4280
+ _invocation_parameters['gain'] = self.__gain( _invocation_parameters ) if gain is None else gain
4281
+ _invocation_parameters['threshold'] = self.__threshold( _invocation_parameters ) if threshold is None else threshold
4282
+ _invocation_parameters['nsigma'] = self.__nsigma( _invocation_parameters ) if nsigma is None else nsigma
4283
+ _invocation_parameters['cycleniter'] = self.__cycleniter( _invocation_parameters ) if cycleniter is None else cycleniter
4284
+ _invocation_parameters['cyclefactor'] = self.__cyclefactor( _invocation_parameters ) if cyclefactor is None else cyclefactor
4285
+ _invocation_parameters['minpsffraction'] = self.__minpsffraction( _invocation_parameters ) if minpsffraction is None else minpsffraction
4286
+ _invocation_parameters['maxpsffraction'] = self.__maxpsffraction( _invocation_parameters ) if maxpsffraction is None else maxpsffraction
4287
+ _invocation_parameters['mask'] = self.__mask( _invocation_parameters ) if mask is None else mask
4288
+ _invocation_parameters['pbmask'] = self.__pbmask( _invocation_parameters ) if pbmask is None else pbmask
4289
+ _invocation_parameters['sidelobethreshold'] = self.__sidelobethreshold( _invocation_parameters ) if sidelobethreshold is None else sidelobethreshold
4290
+ _invocation_parameters['noisethreshold'] = self.__noisethreshold( _invocation_parameters ) if noisethreshold is None else noisethreshold
4291
+ _invocation_parameters['lownoisethreshold'] = self.__lownoisethreshold( _invocation_parameters ) if lownoisethreshold is None else lownoisethreshold
4292
+ _invocation_parameters['negativethreshold'] = self.__negativethreshold( _invocation_parameters ) if negativethreshold is None else negativethreshold
4293
+ _invocation_parameters['smoothfactor'] = self.__smoothfactor( _invocation_parameters ) if smoothfactor is None else smoothfactor
4294
+ _invocation_parameters['minbeamfrac'] = self.__minbeamfrac( _invocation_parameters ) if minbeamfrac is None else minbeamfrac
4295
+ _invocation_parameters['cutthreshold'] = self.__cutthreshold( _invocation_parameters ) if cutthreshold is None else cutthreshold
4296
+ _invocation_parameters['growiterations'] = self.__growiterations( _invocation_parameters ) if growiterations is None else growiterations
4297
+ _invocation_parameters['dogrowprune'] = self.__dogrowprune( _invocation_parameters ) if dogrowprune is None else dogrowprune
4298
+ _invocation_parameters['minpercentchange'] = self.__minpercentchange( _invocation_parameters ) if minpercentchange is None else minpercentchange
4299
+ _invocation_parameters['verbose'] = self.__verbose( _invocation_parameters ) if verbose is None else verbose
4300
+ _invocation_parameters['psfcutoff'] = self.__psfcutoff( _invocation_parameters ) if psfcutoff is None else psfcutoff
4301
+
4302
+ else:
4303
+ # invoke with inp/go semantics
4304
+ _invocation_parameters['vis'] = self.__vis( self.__globals_( ) )
4305
+ _invocation_parameters['selectdata'] = self.__selectdata( self.__globals_( ) )
4306
+ _invocation_parameters['field'] = self.__field( self.__globals_( ) )
4307
+ _invocation_parameters['spw'] = self.__spw( self.__globals_( ) )
4308
+ _invocation_parameters['timerange'] = self.__timerange( self.__globals_( ) )
4309
+ _invocation_parameters['uvrange'] = self.__uvrange( self.__globals_( ) )
4310
+ _invocation_parameters['antenna'] = self.__antenna( self.__globals_( ) )
4311
+ _invocation_parameters['scan'] = self.__scan( self.__globals_( ) )
4312
+ _invocation_parameters['observation'] = self.__observation( self.__globals_( ) )
4313
+ _invocation_parameters['intent'] = self.__intent( self.__globals_( ) )
4314
+ _invocation_parameters['datacolumn'] = self.__datacolumn( self.__globals_( ) )
4315
+ _invocation_parameters['imagename'] = self.__imagename( self.__globals_( ) )
4316
+ _invocation_parameters['imsize'] = self.__imsize( self.__globals_( ) )
4317
+ _invocation_parameters['cell'] = self.__cell( self.__globals_( ) )
4318
+ _invocation_parameters['phasecenter'] = self.__phasecenter( self.__globals_( ) )
4319
+ _invocation_parameters['stokes'] = self.__stokes( self.__globals_( ) )
4320
+ _invocation_parameters['projection'] = self.__projection( self.__globals_( ) )
4321
+ _invocation_parameters['startmodel'] = self.__startmodel( self.__globals_( ) )
4322
+ _invocation_parameters['specmode'] = self.__specmode( self.__globals_( ) )
4323
+ _invocation_parameters['reffreq'] = self.__reffreq( self.__globals_( ) )
4324
+ _invocation_parameters['nchan'] = self.__nchan( self.__globals_( ) )
4325
+ _invocation_parameters['start'] = self.__start( self.__globals_( ) )
4326
+ _invocation_parameters['width'] = self.__width( self.__globals_( ) )
4327
+ _invocation_parameters['outframe'] = self.__outframe( self.__globals_( ) )
4328
+ _invocation_parameters['veltype'] = self.__veltype( self.__globals_( ) )
4329
+ _invocation_parameters['restfreq'] = self.__restfreq( self.__globals_( ) )
4330
+ _invocation_parameters['interpolation'] = self.__interpolation( self.__globals_( ) )
4331
+ _invocation_parameters['perchanweightdensity'] = self.__perchanweightdensity( self.__globals_( ) )
4332
+ _invocation_parameters['gridder'] = self.__gridder( self.__globals_( ) )
4333
+ _invocation_parameters['facets'] = self.__facets( self.__globals_( ) )
4334
+ _invocation_parameters['psfphasecenter'] = self.__psfphasecenter( self.__globals_( ) )
4335
+ _invocation_parameters['wprojplanes'] = self.__wprojplanes( self.__globals_( ) )
4336
+ _invocation_parameters['vptable'] = self.__vptable( self.__globals_( ) )
4337
+ _invocation_parameters['mosweight'] = self.__mosweight( self.__globals_( ) )
4338
+ _invocation_parameters['aterm'] = self.__aterm( self.__globals_( ) )
4339
+ _invocation_parameters['psterm'] = self.__psterm( self.__globals_( ) )
4340
+ _invocation_parameters['wbawp'] = self.__wbawp( self.__globals_( ) )
4341
+ _invocation_parameters['conjbeams'] = self.__conjbeams( self.__globals_( ) )
4342
+ _invocation_parameters['cfcache'] = self.__cfcache( self.__globals_( ) )
4343
+ _invocation_parameters['usepointing'] = self.__usepointing( self.__globals_( ) )
4344
+ _invocation_parameters['computepastep'] = self.__computepastep( self.__globals_( ) )
4345
+ _invocation_parameters['rotatepastep'] = self.__rotatepastep( self.__globals_( ) )
4346
+ _invocation_parameters['pointingoffsetsigdev'] = self.__pointingoffsetsigdev( self.__globals_( ) )
4347
+ _invocation_parameters['pblimit'] = self.__pblimit( self.__globals_( ) )
4348
+ _invocation_parameters['normtype'] = self.__normtype( self.__globals_( ) )
4349
+ _invocation_parameters['deconvolver'] = self.__deconvolver( self.__globals_( ) )
4350
+ _invocation_parameters['scales'] = self.__scales( self.__globals_( ) )
4351
+ _invocation_parameters['nterms'] = self.__nterms( self.__globals_( ) )
4352
+ _invocation_parameters['smallscalebias'] = self.__smallscalebias( self.__globals_( ) )
4353
+ _invocation_parameters['fusedthreshold'] = self.__fusedthreshold( self.__globals_( ) )
4354
+ _invocation_parameters['largestscale'] = self.__largestscale( self.__globals_( ) )
4355
+ _invocation_parameters['restoration'] = self.__restoration( self.__globals_( ) )
4356
+ _invocation_parameters['restoringbeam'] = self.__restoringbeam( self.__globals_( ) )
4357
+ _invocation_parameters['pbcor'] = self.__pbcor( self.__globals_( ) )
4358
+ _invocation_parameters['outlierfile'] = self.__outlierfile( self.__globals_( ) )
4359
+ _invocation_parameters['weighting'] = self.__weighting( self.__globals_( ) )
4360
+ _invocation_parameters['robust'] = self.__robust( self.__globals_( ) )
4361
+ _invocation_parameters['noise'] = self.__noise( self.__globals_( ) )
4362
+ _invocation_parameters['npixels'] = self.__npixels( self.__globals_( ) )
4363
+ _invocation_parameters['uvtaper'] = self.__uvtaper( self.__globals_( ) )
4364
+ _invocation_parameters['niter'] = self.__niter( self.__globals_( ) )
4365
+ _invocation_parameters['gain'] = self.__gain( self.__globals_( ) )
4366
+ _invocation_parameters['threshold'] = self.__threshold( self.__globals_( ) )
4367
+ _invocation_parameters['nsigma'] = self.__nsigma( self.__globals_( ) )
4368
+ _invocation_parameters['cycleniter'] = self.__cycleniter( self.__globals_( ) )
4369
+ _invocation_parameters['cyclefactor'] = self.__cyclefactor( self.__globals_( ) )
4370
+ _invocation_parameters['minpsffraction'] = self.__minpsffraction( self.__globals_( ) )
4371
+ _invocation_parameters['maxpsffraction'] = self.__maxpsffraction( self.__globals_( ) )
4372
+ _invocation_parameters['nmajor'] = self.__nmajor( self.__globals_( ) )
4373
+ _invocation_parameters['usemask'] = self.__usemask( self.__globals_( ) )
4374
+ _invocation_parameters['mask'] = self.__mask( self.__globals_( ) )
4375
+ _invocation_parameters['pbmask'] = self.__pbmask( self.__globals_( ) )
4376
+ _invocation_parameters['sidelobethreshold'] = self.__sidelobethreshold( self.__globals_( ) )
4377
+ _invocation_parameters['noisethreshold'] = self.__noisethreshold( self.__globals_( ) )
4378
+ _invocation_parameters['lownoisethreshold'] = self.__lownoisethreshold( self.__globals_( ) )
4379
+ _invocation_parameters['negativethreshold'] = self.__negativethreshold( self.__globals_( ) )
4380
+ _invocation_parameters['smoothfactor'] = self.__smoothfactor( self.__globals_( ) )
4381
+ _invocation_parameters['minbeamfrac'] = self.__minbeamfrac( self.__globals_( ) )
4382
+ _invocation_parameters['cutthreshold'] = self.__cutthreshold( self.__globals_( ) )
4383
+ _invocation_parameters['growiterations'] = self.__growiterations( self.__globals_( ) )
4384
+ _invocation_parameters['dogrowprune'] = self.__dogrowprune( self.__globals_( ) )
4385
+ _invocation_parameters['minpercentchange'] = self.__minpercentchange( self.__globals_( ) )
4386
+ _invocation_parameters['verbose'] = self.__verbose( self.__globals_( ) )
4387
+ _invocation_parameters['fastnoise'] = self.__fastnoise( self.__globals_( ) )
4388
+ _invocation_parameters['restart'] = self.__restart( self.__globals_( ) )
4389
+ _invocation_parameters['savemodel'] = self.__savemodel( self.__globals_( ) )
4390
+ _invocation_parameters['calcres'] = self.__calcres( self.__globals_( ) )
4391
+ _invocation_parameters['calcpsf'] = self.__calcpsf( self.__globals_( ) )
4392
+ _invocation_parameters['psfcutoff'] = self.__psfcutoff( self.__globals_( ) )
4393
+ _invocation_parameters['parallel'] = self.__parallel( self.__globals_( ) )
4394
+ try:
4395
+ with open(_prefile,'w') as _f:
4396
+ for _i in _invocation_parameters:
4397
+ _f.write("%-20s = %s\n" % (_i,noobj(repr(_invocation_parameters[_i]))))
4398
+ _f.write("#iclean( ")
4399
+ count = 0
4400
+ for _i in _invocation_parameters:
4401
+ _f.write("%s=%s" % (_i,noobj(repr(_invocation_parameters[_i]))))
4402
+ count += 1
4403
+ if count < len(_invocation_parameters): _f.write(",")
4404
+ _f.write(" )\n")
4405
+ except: pass
4406
+ try:
4407
+ _logging_state_ = None
4408
+ assert _pc.validate(_invocation_parameters,self.__schema), create_error_string(_pc.errors)
4409
+ _logging_state_ = _start_log( 'iclean', [ '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']), 'nmajor=' + repr(_pc.document['nmajor']), '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']), ] )
4410
+ task_result = _iclean_t( vis=_pc.document['vis'],selectdata=_pc.document['selectdata'],field=_pc.document['field'],spw=_pc.document['spw'],timerange=_pc.document['timerange'],uvrange=_pc.document['uvrange'],antenna=_pc.document['antenna'],scan=_pc.document['scan'],observation=_pc.document['observation'],intent=_pc.document['intent'],datacolumn=_pc.document['datacolumn'],imagename=_pc.document['imagename'],imsize=_pc.document['imsize'],cell=_pc.document['cell'],phasecenter=_pc.document['phasecenter'],stokes=_pc.document['stokes'],projection=_pc.document['projection'],startmodel=_pc.document['startmodel'],specmode=_pc.document['specmode'],reffreq=_pc.document['reffreq'],nchan=_pc.document['nchan'],start=_pc.document['start'],width=_pc.document['width'],outframe=_pc.document['outframe'],veltype=_pc.document['veltype'],restfreq=_pc.document['restfreq'],interpolation=_pc.document['interpolation'],perchanweightdensity=_pc.document['perchanweightdensity'],gridder=_pc.document['gridder'],facets=_pc.document['facets'],psfphasecenter=_pc.document['psfphasecenter'],wprojplanes=_pc.document['wprojplanes'],vptable=_pc.document['vptable'],mosweight=_pc.document['mosweight'],aterm=_pc.document['aterm'],psterm=_pc.document['psterm'],wbawp=_pc.document['wbawp'],conjbeams=_pc.document['conjbeams'],cfcache=_pc.document['cfcache'],usepointing=_pc.document['usepointing'],computepastep=_pc.document['computepastep'],rotatepastep=_pc.document['rotatepastep'],pointingoffsetsigdev=_pc.document['pointingoffsetsigdev'],pblimit=_pc.document['pblimit'],normtype=_pc.document['normtype'],deconvolver=_pc.document['deconvolver'],scales=_pc.document['scales'],nterms=_pc.document['nterms'],smallscalebias=_pc.document['smallscalebias'],fusedthreshold=_pc.document['fusedthreshold'],largestscale=_pc.document['largestscale'],restoration=_pc.document['restoration'],restoringbeam=_pc.document['restoringbeam'],pbcor=_pc.document['pbcor'],outlierfile=_pc.document['outlierfile'],weighting=_pc.document['weighting'],robust=_pc.document['robust'],noise=_pc.document['noise'],npixels=_pc.document['npixels'],uvtaper=_pc.document['uvtaper'],niter=_pc.document['niter'],gain=_pc.document['gain'],threshold=_pc.document['threshold'],nsigma=_pc.document['nsigma'],cycleniter=_pc.document['cycleniter'],cyclefactor=_pc.document['cyclefactor'],minpsffraction=_pc.document['minpsffraction'],maxpsffraction=_pc.document['maxpsffraction'],nmajor=_pc.document['nmajor'],usemask=_pc.document['usemask'],mask=_pc.document['mask'],pbmask=_pc.document['pbmask'],sidelobethreshold=_pc.document['sidelobethreshold'],noisethreshold=_pc.document['noisethreshold'],lownoisethreshold=_pc.document['lownoisethreshold'],negativethreshold=_pc.document['negativethreshold'],smoothfactor=_pc.document['smoothfactor'],minbeamfrac=_pc.document['minbeamfrac'],cutthreshold=_pc.document['cutthreshold'],growiterations=_pc.document['growiterations'],dogrowprune=_pc.document['dogrowprune'],minpercentchange=_pc.document['minpercentchange'],verbose=_pc.document['verbose'],fastnoise=_pc.document['fastnoise'],restart=_pc.document['restart'],savemodel=_pc.document['savemodel'],calcres=_pc.document['calcres'],calcpsf=_pc.document['calcpsf'],psfcutoff=_pc.document['psfcutoff'],parallel=_pc.document['parallel'], )
4411
+ except Exception as e:
4412
+ from traceback import format_exc
4413
+ from casatasks import casalog
4414
+ casalog.origin('iclean')
4415
+ casalog.post("Exception Reported: Error in iclean: %s" % str(e),'SEVERE')
4416
+ casalog.post(format_exc( ))
4417
+ raise #exception is now raised
4418
+ #task_result = False
4419
+ finally:
4420
+ try:
4421
+ os.rename(_prefile,_postfile)
4422
+ except: pass
4423
+ if _logging_state_:
4424
+ task_result = _end_log( _logging_state_, 'iclean', task_result )
4425
+
4426
+ #Added if _iclean_t returns False and does not raise an exception.
4427
+ if task_result is False:
4428
+ raise
4429
+
4430
+ return task_result #Still needed
4431
+
4432
+ iclean = _iclean( )