Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/tsdimaging.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
1##################### generated by xml-casa (v2) from tsdimaging.xml ################
2##################### 910a61afc64dc6e995fcff168b6271ca ##############################
3from __future__ import absolute_import
4import numpy
5from casatools.typecheck import CasaValidator as _val_ctor
6_pc = _val_ctor( )
7from casatools.coercetype import coerce as _coerce
8from casatools.errors import create_error_string
9from .private.task_tsdimaging import tsdimaging as _tsdimaging_t
10from casatasks.private.task_logging import start_log as _start_log
11from casatasks.private.task_logging import end_log as _end_log
12from casatasks.private.task_logging import except_log as _except_log
14class _tsdimaging:
15 """
16 tsdimaging ---- SD task: imaging for total power and spectral data
19 Task sdimaging creates an image from input single-dish data sets.
20 The input can be either total power and spectral data.
22 The coordinate of output image is defined by four axes, i.e., two
23 spatial axes, frequency and polarization axes.n
24 By default, spatial coordinate of image is defined so that the all
25 pointing directions in POINTING tables of input data sets are covered
26 with the cell size, 1/3 of FWHM of primary beam of antennas in the
27 first MS. Therefore, it is often easiest to leave spatial definitions
28 at the default values. It is also possible to define spatial axes of
29 the image by specifying the image center direction (phasecenter),
30 number of image pixel (imsize) and size of the pixel (cell).n
31 The frequency coordinate of image is defined by three parameters,
32 the number of channels (nchan), the channel id/frequency/velocity of
33 the first channel (start), and channel width (width).There are three
34 modes available to define unit of start and width, i.e., 'channel' (use
35 channel indices), 'frequency' (use frequency unit, e.g., 'GHz'),
36 and 'velocity' (use velocity unit, e.g., 'km/s'). By default, nchan,
37 start, and width are defined so that all selected spectral windows are
38 covered with the channel width equal to separation of first two
39 channels selected.n
40 Finally, polarizations of image is defined by stokes parameter or
41 polarization. For example, stokes='XXYY' produces an image cube with
42 each plane contains the image of one of the polarizations, while
43 stokes='I' produces a 'total intensity' or Stokes I image.
44 The stokes parameter has a special option, 'pseudoI'. The option is
45 introduced to support imaging of partially flagged correlations.
46 Main difference between 'I' and 'pseudoI' is that the former only takes
47 into account the data whose correlations are all valid (this is the
48 Stokes I in the strict sense) while the latter accumulates partially
49 flagged data in addition. Note that the 'pseudoI' option is compatible
50 with 'I' for sdimaging task.
52 The task also supports various grid function (convolution kernel) to
53 weight spectra as well as an option to remove the most extreme minimum
54 and maximum (unweighted) values prior to computing the gridded pixel
55 values. See description below for details of gridfunction available.
59 --------- parameter descriptions ---------------------------------------------
61 infiles a list of names of input SD Measurementsets (only MS is allowed for this task)
62 outfile prefix of output images (.image, .weight)
63 overwrite overwrite the output file if already exists [True, False]
64 field select data by field IDs and names, e.g. \'3C2*\' (\'\'=all)
65 spw select data by IF IDs (spectral windows), e.g. \'3,5,7\' (\'\'=all)
66 antenna select data by antenna names or IDs, e.g, \'PM03\' (\'\' = all antennas)
67 scan select data by scan numbers, e.g. \'21~23\' (\'\'=all)
68 intent select data by observational intent, e.g. \'*ON_SOURCE*\' (\'\'=all)
69 timerange select data by range of time, e.g. 20:15:00~20:16:00 (\'\'=all)
70 outframe velocity frame of output image (''=current frame or LSRK for multiple-MS inputs)
71 mode spectral gridding type [\'channel\', \'frequency\', \'velocity\']
72 nchan number of channels (planes) in output image (-1=all)
73 start start of output spectral dimension, e.g. \'0\', \'110GHz\', \'-20km/s\'
74 width width of output spectral channels
75 veltype velocity definition
76 specmode Spectral definition mode (cube, cubedata, cubesource)
77 interpolation Spectral interpolation ["nearest", "linear", "cubic"]
78 Interpolation rules to use when binning data channels onto image channels and evaluating visibility values at the centers of image channels.
79 Note :
80 - "linear" and "cubic" interpolation requires data points on both sides of each image frequency. Errors are therefore possible at edge channels, or near flagged data channels. When image channel width is much larger than the data channel width there is nothing much to be gained using linear or cubic thus not worth the extra computation involved.
81 - If there are significant differences in the observation dates of the input MSes, "nearest" interpolation may cause some problems with frequency channel matching.
82 pointingcolumn pointing data column to use
83 convertfirst Specify whether the direction of the specified pointing column must be converted to image"s reference frame prior to being interpolated at data-taking time, and when. "never": interpolate against the pointing column, then convert. "always": interpolate against the beforehand converted pointing column. "auto": if there are less pointings than selected data rows convert first, else interpolate first
84 projection map projection type
85 imsize x and y image size in pixels, e.g., [64,64]. Single value: same for both spatial axes ([] = number of pixels to cover whole pointings in MSes)
86 cell x and y cell size, (e.g., [\'8arcsec\',\'8arcsec\']. default unit arcmin. ('' = 1/3 of FWHM of primary beam)
87 phasecenter image center direction: position or field index or ephemeris source info, e.g., \'J2000 17:30:15.0 -25.30.00.0\', \'MARS\'. (\'\' = the center of pointing directions in MSes)
88 stokes stokes parameters or polarization types to image, e.g. \'I\', \'XX\'
89 gridfunction gridding function for imaging (see description in help)
90 convsupport convolution support for gridding
91 truncate truncation radius for gridding
92 gwidth HWHM for gaussian
93 jwidth c-parameter for jinc function
94 clipminmax Clip minimum and maximum value from each pixel. Note the benefit of clipping is lost when the number of integrations contributing to each gridded pixel is small, or where the incidence of spurious datapoints is approximately or greater than the number of beams (in area) encompassed by expected image.
95 minweight Minimum weight ratio to the median of weight used in weight correction and weight beased masking
96 brightnessunit Overwrite the brightness unit in image (\'\' = respect the unit in MS) [\'K\' or \'Jy/beam\']
97 restfreq rest frequency to assign to image, e.g., \'114.5GHz\'. When the default value \'\' is used, the task currently internally uses REST_FREQUENCY of SOURCE table or mean frequency of given spectral window as a default value.
98 [1;42mRETURNS[1;m void
100 --------- examples -----------------------------------------------------------
103 Keyword arguments:
104 infiles -- a list of names of input SD Measurementsets
105 example: 'm100.PM01.ms'
106 ['m100.PM01.ms','m100.PM03.ms']; multiple MSes
107 outfile -- prefix of output images
108 Currently, four images are created by the task:
109 .image -- target image
110 .weight -- weight image
111 .sumwt -- sumwt image
112 .psf -- psf image (equivalent to weight image)
113 .sumwt and .psf are kind of useless so far. image products
114 will be improved later.
115 default: ''
116 example: 'mySDimage.im'
117 overwrite -- overwrite the output file if already exists
118 options: (bool) True,False
119 default: False (do NOT overwrite)
120 example: if True, existing file will be overwritten
121 field -- select data by field IDs and names
122 If field string is a non-negative integer, it is assumed to
123 be a field index otherwise, it is assumed to be a
124 field name
125 default: '' (use all fields)
126 example: field='3C2*' (all names starting with 3C2)
127 field='0,4,5~7' (field IDs 0,4,5,6,7)
128 field='0,3C273' (field ID 3 or filed named 3C273)
129 For multiple MS input, a list of field strings can be used:
130 field = ['0~2','0~4'] (field ids 0-2 for the first MS and 0-4
131 for the second)
132 field = '0~2' (field ids 0-2 for all input MSes)
133 this selection is in addition to the other selections to data
134 spw -- select data by spectral window IDs/channels
135 NOTE: channels de-selected here will contain all zeros if
136 selected by the parameter mode subparameters.
137 default: '' (use all IFs and channels)
138 example: spw='3,5,7' (IF IDs 3,5,7; all channels)
139 spw='<2' (IF IDs less than 2, i.e., 0,1; all channels)
140 spw='30~45GHz' (IF IDs with the center frequencies in range 30-45GHz; all channels)
141 spw='0:5~61' (IF ID 0; channels 5 to 61; all channels)
142 spw='3:10~20;50~60' (select multiple channel ranges within IF ID 3)
143 spw='3:10~20,4:0~30' (select different channel ranges for IF IDs 3 and 4)
144 spw='1~4;6:15~48' (for channels 15 through 48 for IF IDs 1,2,3,4 and 6)
145 For multiple MS input, a list of spw strings can be used:
146 spw=['0','0~3'] (spw ids 0 for the first MS and 0-3 for the second)
147 spw='0~3' (spw ids 0-3 for all input MSes)
148 this selection is in addition to the other selections to data
149 antenna -- select data by antenna names or IDs
150 If antenna string is a non-negative integer, it is
151 assumed to be an antenna index, otherwise, it is
152 considered an antenna name.
153 default: '' (all baselines, i.e. all antenna in case of auto data)
154 example: antenna='PM03'
155 For multiple MS input, a list of antenna strings can be used:
156 antenna=['5','6'] (antenna id5 for the first MS and 6 for the second)
157 antenna='5' (antenna index 5 for all input MSes)
158 this selection is in addition to the other selections to data
159 scan -- select data by scan numbers
160 default: '' (use all scans)
161 example: scan='21~23' (scan IDs 21,22,23)
162 For multiple MS input, a list of scan strings can be used:
163 scan=['0~100','10~200'] (scan ids 0-100 for the first MS
164 and 10-200 for the second)
165 scan='0~100 (scan ids 0-100 for all input MSes)
166 this selection is in addition to the other selections to data
167 intent -- select data by observational intent, also referred to as 'scan intent'
168 default: 'OBSERVE_TARGET#ON_SOURCE' (ALMA ON-source intent)
169 example: intent='' (use all scan intents)
170 intent='*ON_SOURCE*' (any valid scan-intent expression accepted by the MSSelection module can be specified)
171 For multiple MS input, a list of scan-intent expressions can be used:
172 intent=['ON_SOURCE','CALIBRATE_BANDPASS'] (scan intent ON_SOURCE for the first MS
173 and CALIBRATE_BANDPASS for the second)
174 this selection is in addition to the other selections to data
175 mode -- spectral gridding type
176 options: 'channel', 'velocity', 'frequency'
177 default: 'channel'
178 >>> mode expandable parameters
179 nchan -- Total number of channels in the output image.
180 default: -1; Automatically selects enough channels to cover
181 data selected by 'spw' consistent with 'start' and 'width'.
182 It is often easiest to leave nchan at the default value.
183 example: nchan=100
184 start -- First channel, velocity, or frequency.
185 For mode='channel'; This selects the channel index number
186 from the MS (0 based) that you want to correspond to the
187 first channel of the output cube. The output cube will be
188 in frequency space with the first channel having the
189 frequency of the MS channel selected by start. start=0
190 refers to the first channel in the first selected spw, even
191 if that channel is de-selected in the spw parameter.
192 Channels de-selected by the spw parameter will be filled with
193 zeros if included by the start parameter. For example,
194 spw=3~8:3~100 and start=2 will produce a cube that starts on
195 the third channel (recall 0 based) of spw index 3, and the
196 first channel will be blank.
197 default: '' (the first input channel of first input spw)
198 example: start=100 (mode='channel')
199 start='22.3GHz' (mode='frequency')
200 start='5.0km/s' (mode='velocity')
201 width -- Output channel width
202 For mode='channel', default=1; width>1 indicates channel averaging
203 example: width=4.
204 For mode= 'velocity' or 'frequency', default=''; width of
205 first input channel, or more precisely, the difference
206 in frequencies between the first two selected channels.
207 -- For example if channels 1 and 3 are selected with spw,
208 then the default width will be the difference between their
209 frequencies, and not the width of channel 1.
210 -- Similarly, if the selected data has uneven channel-spacing,
211 the default width will be picked from the first two selected
212 channels. In this case, please specify the desired width.
213 When specifying the width, one must give units
214 examples: width='1.0km/s', or width='24.2kHz'.
215 Setting width>0 gives channels of increasing frequency for
216 mode='frequency', and increasing velocity for mode='velocity'.
217 veltype -- Velocity definition
218 Options: 'radio','optical','true','relativistic'
219 default: 'radio'
220 specmode -- Spectral definition mode (cube, cubedata, cubesource)
221 default: 'cube'
222 Options: 'cube', 'cubedata', 'cubesource'
223 'cube' : Spectral line imaging with one or more channels
224 Parameters start, width,and nchan define the spectral
225 coordinate system and can be specified either in terms
226 of channel numbers, frequency or velocity in whatever
227 spectral frame is specified in 'outframe'.
228 All internal and output images are made with outframe as the
229 base spectral frame. However imaging code internally uses the fixed
230 spectral frame, LSRK for automatic internal software
231 Doppler tracking so that a spectral line observed over an
232 extended time range will line up appropriately.
233 Therefore the output images have additional spectral frame conversion
234 layer in LSRK on the top the base frame.
235 'cubedata' : Spectral line imaging with one or more channels
236 There is no internal software Doppler tracking so
237 a spectral line observed over an extended time range
238 may be smeared out in frequency. There is strictly
239 no valid spectral frame with which to label the output
240 images, but they will list the frame defined in the MS
241 'cubesource': Spectral line imaging while
242 tracking moving source (near field or solar system
243 objects). The velocity of the source is accounted
244 and the frequency reported is in the source frame.
245 As there is not SOURCE frame defined,
246 the frame reported will be REST (as it may not be
247 in the rest frame emission region may be
248 moving w.r.t the systemic velocity frame)
249 outframe -- velocity reference frame of output image
250 Options: '','LSRK','LSRD','BARY','GEO','TOPO','GALACTO',
251 'LGROUP','CMB'
252 default: ''; same as input data or 'LSRK' for multiple-MS inputs
253 example: frame='bary' for Barycentric frame
254 gridfunction -- gridding function for imaging
255 options: 'BOX' (Box-car), 'SF' (Spheroidal),
256 'PB' (Primary-beam), 'GAUSS' (Gaussian),
257 'GJINC' (Gaussian*Jinc)
258 default: 'BOX'
259 example: 'SF'
260 >>> gridfunction expandable parameter:
261 convsupport -- convolution support for 'SF'
262 default: -1 (use default for each gridfunction)
263 example: 3
264 truncate -- truncattion radius of convolution kernel.
265 effective only for 'GAUSS' and 'GJINC'.
266 default: '-1' (use default for each gridfunction)
267 example: 3, '20arcsec', '3pixel'
268 gwidth -- HWHM for gaussian. Effective only for
269 'GAUSS' and 'GJINC'.
270 default: '-1' (use default for each gridfunction)
271 example: 3, '20arcsec', '3pixel'
272 jwidth -- Width of jinc function. Effective only for
273 'GJINC'.
274 default: '-1' (use default for each gridfunction)
275 example: 3, '20arcsec', '3pixel'
276 imsize -- x and y image size in pixels, symmetric for single value
277 default: [] (=cover all pointings in MS)
278 example: imsize=200 (equivalent to [200,200])
279 cell -- x and y cell size. default unit arcmin
280 default: '' (= 1/3 of FWHM of primary beam)
281 example: cell=['0.2arcmin, 0.2arcmin']
282 cell='0.2arcmin' (equivalent to example above)
283 phasecenter -- image center: direction measure, field ID, or
284 ephemerides source information for moving source (solar system objects)
285 default: '' (= the center of pointing directions in
286 POINTING table of infiles)
287 example: phasecenter=6 (field ID)
288 phasecenter='J2000 13h44m00 -17d02m00'
289 phasecenter='AZEL -123d48m29 15d41m41'
290 phasecenter='MARS'
291 phasecenter='myComet_ephem.tab'
292 phasecenter='TRACKFIELD'
294 If the phasecenter is the name known major solar system object
295 ('MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', 'URANUS',
296 'NEPTUNE', 'PLUTO', 'SUN', 'MOON') or is an ephemerides table
297 then that source is tracked and the background sources get smeared.
298 There is a special case, when phasecenter='TRACKFIELD', which
299 will use the ephemerides or polynomial phasecenter in the FIELD
300 table of the MS's as the source center to track.
302 When moving source correction is applied, the source is fixed to
303 the position at the beginning of on-source observations in the data.
304 Direction reference frame of output image refers phasecenter ('J2000'
305 if phasecenter is empty).
307 Caution: in case of specifying ephemeris table name, its name or path
308 must not start with known major solar system object listed
309 above (case-insensitive), otherwise, CASA will use its
310 internal ephemeris data for phasecenter instead. In such case
311 you need to add './' at the beginning so that the specified
312 table will be used. For example, if you wish to explicitly
313 specify ephemeris table attached to the input MS 'SunObs.ms',
314 set phasecenter like './SunObs.ms/FIELD/ephemtab_name.tab'.
316 projection -- map projection type. See Calabretta & Greisen (2002) for detail.
317 default: 'SIN'
318 options: 'SIN', 'CAR', 'TAN', 'SFL'
319 pointingcolumn -- pointing data column to use
320 option: 'direction', 'target', 'pointing_offset', 'source_offset', encoder'
321 default: 'direction'
322 restfreq -- specify rest frequency to use for output image
323 default: '' (refer input data)
324 example: 1.0e11, '100GHz'
325 stokes -- Stokes Planes to make
326 default='I'; example: stokes='XXYY';
327 options: 'I','Q','U','V','IV','QU','IQ','UV','IQUV','RR','LL','XX','YY','RRLL','XXYY','pseudoI'
328 Note : The 'pseudoI' option is a partial solution, allowing Stokes I imaging
329 when either of the parallel-hand correlations are unflagged.
331 minweight -- Minimum weight ratio to the median of weight used in
332 weight correction and weight based masking
333 default: 0.1
334 example: minweight = 0.
335 brightnessunit -- Overwrite the brightness unit in image.
336 default: '' (use the unit in MS)
337 Options: '', 'K' (Kelvin), 'Jy/beam'
338 clipminmax -- Clip minimum and maximum value from each pixel.
339 Note the benefit of clipping is lost when the number of
340 integrations contributing to each gridded pixel is small,
341 or where the incidence of spurious datapoints is
342 approximately or greater than the number of beams (in area)
343 encompassed by expected image.
344 default: False
345 option: True, False
346 interpolation -- Spectral interpolation.
347 Interpolation rules to use when binning data channels onto image channels and
348 evaluating visibility values at the centers of image channels.
349 Note :
350 - 'linear' and 'cubic' interpolation requires data points on both sides of each image frequency.
351 Errors are therefore possible at edge channels, or near flagged data channels.
352 When image channel width is much larger than the data channel width there is nothing much to be gained
353 using linear or cubic thus not worth the extra computation involved.
354 - If there are significant differences in observing dates of input MSes, some problems merely occur
355 in frequency channel matching when 'nearest' interpolation.
356 option: 'linear', 'nearest', 'cubic'
357 default: 'linear'
359 -----------------
360 Gridding Kernel
361 -----------------
362 The parameter gridfunction sets gridding function (convolution kernel)
363 for imaging. Currently, the task supports 'BOX' (Box-car), 'SF' (Prolate
364 Spheroidal Wave Function), 'GAUSS' (Gaussian), 'GJINC' (Gaussian*Jinc),
365 where Jinc(x) = J_1(pi*x/c)/(pi*x/c) with a first order Bessel function
366 J_1, and 'PB' (Primary Beam). For 'PB', correct antenna informations
367 should be included in input file.
369 There are four subparameters for gridfunction: convsupport, truncate,
370 gwidth, and jwidth. The convsupport is an integer specifying cut-off
371 radius for 'SF' in units of pixel. By default (convsupport=-1),
372 the cut-off radius is set to 3 pixels. The truncate is a cut-off
373 radius for 'GAUSS' or 'GJINC'. It accepts integer, float, and
374 string values of numeric plus unit. Allowed units are angular
375 units such as 'deg', 'arcmin', 'arcsec', and 'pixel'. Default unit
376 is 'pixel' so that string without unit or numerical values (integer
377 or float) will be interpreted as radius in pixel. Default value
378 for truncate, which is used when negative radius is set, is 3*HWHM
379 for 'GAUSS' and radius at first null for 'GJINC'. The gwidth is
380 the HWHM of gaussian for 'GAUSS' and 'GJINC'. Default value is
381 sqrt(log(2)) pixel for 'GAUSS' and 2.52*sqrt(log(2)) pixel for
382 'GJINC'. The jwidth specifies width of the jinc function (parameter
383 'c' in the definition above). Default is 1.55 pixel. Both gwidth
384 jwidth allows integer, float, or string of numeric plus unit.
385 Default values for gwidth and jwidth are taken from Mangum et al.
386 (2007). Formula for 'GAUSS' and 'GJINC' are taken from Table 1 in
387 the paper, and are written as below using gwidth and jwidth:
389 GAUSS: exp[-log(2)*(|r|/gwidth)**2]
391 GJINC: J_1(pi*|r|/jwidth)/(pi*|r|/jwidth)
392 * exp[-log(2)*(|r|/gwidth)^2]
395 Reference: Mangum, et al. 2007, A&A, 474, 679-687
397 --------------------
398 Mask in Output Image
399 --------------------
400 The parameter minweight defines a threshold of weight values
401 to mask. The pixels in outfile whose weight is smaller than
402 minweight*median(weight) are masked out. The task also creates
403 a weight image with the name outfile.weight.
408 """
410 _info_group_ = """single dish"""
411 _info_desc_ = """SD task: imaging for total power and spectral data"""
413 def __call__( self, infiles=[ ], outfile='', overwrite=False, field='', spw='', antenna='', scan='', intent='OBSERVE_TARGET#ON_SOURCE', timerange='', outframe='', mode='channel', nchan=int(-1), start=int(0), width=int(1), veltype='radio', specmode='cube', interpolation='linear', pointingcolumn='direction', convertfirst='never', projection='SIN', imsize=[ ], cell='', phasecenter='', stokes='I', gridfunction='BOX', convsupport=int(-1), truncate=int(-1), gwidth=int(-1), jwidth=int(-1), clipminmax=False, minweight=float(0.1), brightnessunit='', restfreq='' ):
414 schema = {'infiles': {'type': 'cReqPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}, 'outfile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'overwrite': {'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]}]}, '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]}]}, 'intent': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'timerange': {'type': 'cStr', 'coerce': _coerce.to_str}, 'outframe': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'LSRK', 'CMB', 'geo', 'bary', 'GALACTO', 'GEO', 'TOPO', 'LSRD', 'lsrk', 'topo', 'LGROUP', 'BARY', 'lsrd', 'cmb', 'galacto', 'lgroup', '' ]}, 'mode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'channel', 'frequency', 'velocity' ]}, 'nchan': {'type': 'cInt'}, 'start': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}]}, 'width': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}]}, 'veltype': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'OPTICAL', 'RELATIVISTIC', 'radio', 'true', 'optical', 'RADIO', 'TRUE', 'relativistic' ]}, 'specmode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'cube', 'cubedata', 'cubesource' ]}, 'interpolation': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'nearest', 'linear', 'cubic' ]}, 'pointingcolumn': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'TARGET', 'encoder', 'ENCODER', 'source_offset', 'pointing_offset', 'target', 'POINTING_OFFSET', 'DIRECTION', 'SOURCE_OFFSET', 'direction' ]}, 'convertfirst': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'never', 'auto', 'always' ]}, 'projection': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'sin', 'SIN', 'SFL', 'CAR', 'sfl', 'car', 'TAN', 'tan' ]}, 'imsize': {'anyof': [{'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'cell': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'phasecenter': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'stokes': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'I', 'IQUV', 'UV', 'RRLL', 'IQ', 'V', 'pseudoI', 'QU', 'YY', 'RR', 'Q', 'U', 'IV', 'XX', 'XXYY', 'LL' ]}, 'gridfunction': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'GJINC', 'pb', 'sf', 'GAUSS', 'PB', 'SF', 'gauss', 'BOX', 'box', 'gjinc' ]}, 'convsupport': {'type': 'cInt'}, 'truncate': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}, {'type': 'cFloat', 'coerce': _coerce.to_float}]}, 'gwidth': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}, {'type': 'cFloat', 'coerce': _coerce.to_float}]}, 'jwidth': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}, {'type': 'cFloat', 'coerce': _coerce.to_float}]}, 'clipminmax': {'type': 'cBool'}, 'minweight': {'type': 'cFloat', 'coerce': _coerce.to_float, 'min': 0}, 'brightnessunit': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ '', 'K', 'Jy/beam' ]}, 'restfreq': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cFloat', 'coerce': _coerce.to_float}]}}
415 doc = {'infiles': infiles, 'outfile': outfile, 'overwrite': overwrite, 'field': field, 'spw': spw, 'antenna': antenna, 'scan': scan, 'intent': intent, 'timerange': timerange, 'outframe': outframe, 'mode': mode, 'nchan': nchan, 'start': start, 'width': width, 'veltype': veltype, 'specmode': specmode, 'interpolation': interpolation, 'pointingcolumn': pointingcolumn, 'convertfirst': convertfirst, 'projection': projection, 'imsize': imsize, 'cell': cell, 'phasecenter': phasecenter, 'stokes': stokes, 'gridfunction': gridfunction, 'convsupport': convsupport, 'truncate': truncate, 'gwidth': gwidth, 'jwidth': jwidth, 'clipminmax': clipminmax, 'minweight': minweight, 'brightnessunit': brightnessunit, 'restfreq': restfreq}
416 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
417 _logging_state_ = _start_log( 'tsdimaging', [ 'infiles=' + repr(_pc.document['infiles']), 'outfile=' + repr(_pc.document['outfile']), 'overwrite=' + repr(_pc.document['overwrite']), 'field=' + repr(_pc.document['field']), 'spw=' + repr(_pc.document['spw']), 'antenna=' + repr(_pc.document['antenna']), 'scan=' + repr(_pc.document['scan']), 'intent=' + repr(_pc.document['intent']), 'timerange=' + repr(_pc.document['timerange']), 'outframe=' + repr(_pc.document['outframe']), 'mode=' + repr(_pc.document['mode']), 'nchan=' + repr(_pc.document['nchan']), 'start=' + repr(_pc.document['start']), 'width=' + repr(_pc.document['width']), 'veltype=' + repr(_pc.document['veltype']), 'specmode=' + repr(_pc.document['specmode']), 'interpolation=' + repr(_pc.document['interpolation']), 'pointingcolumn=' + repr(_pc.document['pointingcolumn']), 'convertfirst=' + repr(_pc.document['convertfirst']), 'projection=' + repr(_pc.document['projection']), 'imsize=' + repr(_pc.document['imsize']), 'cell=' + repr(_pc.document['cell']), 'phasecenter=' + repr(_pc.document['phasecenter']), 'stokes=' + repr(_pc.document['stokes']), 'gridfunction=' + repr(_pc.document['gridfunction']), 'convsupport=' + repr(_pc.document['convsupport']), 'truncate=' + repr(_pc.document['truncate']), 'gwidth=' + repr(_pc.document['gwidth']), 'jwidth=' + repr(_pc.document['jwidth']), 'clipminmax=' + repr(_pc.document['clipminmax']), 'minweight=' + repr(_pc.document['minweight']), 'brightnessunit=' + repr(_pc.document['brightnessunit']), 'restfreq=' + repr(_pc.document['restfreq']) ] )
418 task_result = None
419 try:
420 task_result = _tsdimaging_t( _pc.document['infiles'], _pc.document['outfile'], _pc.document['overwrite'], _pc.document['field'], _pc.document['spw'], _pc.document['antenna'], _pc.document['scan'], _pc.document['intent'], _pc.document['timerange'], _pc.document['outframe'], _pc.document['mode'], _pc.document['nchan'], _pc.document['start'], _pc.document['width'], _pc.document['veltype'], _pc.document['specmode'], _pc.document['interpolation'], _pc.document['pointingcolumn'], _pc.document['convertfirst'], _pc.document['projection'], _pc.document['imsize'], _pc.document['cell'], _pc.document['phasecenter'], _pc.document['stokes'], _pc.document['gridfunction'], _pc.document['convsupport'], _pc.document['truncate'], _pc.document['gwidth'], _pc.document['jwidth'], _pc.document['clipminmax'], _pc.document['minweight'], _pc.document['brightnessunit'], _pc.document['restfreq'] )
421 except Exception as exc:
422 _except_log('tsdimaging', exc)
423 raise
424 finally:
425 task_result = _end_log( _logging_state_, 'tsdimaging', task_result )
426 return task_result
428tsdimaging = _tsdimaging( )