Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/deconvolve.py: 100%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1##################### generated by xml-casa (v2) from deconvolve.xml ################
2##################### 15d515ca00097c91935333421853fdfb ##############################
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_deconvolve import deconvolve as _deconvolve_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 _deconvolve:
15 """
16 deconvolve ---- Image-domain deconvolution
18 Task deconvolve executes image-domain deconvolution with options for automasking and restoration. It can be viewed as the minor cycle of the iterative image reconstruction offered by the tclean task. The functionality that it introduces is the ability to just run the deconvolution step alone.
21 --------- parameter descriptions ---------------------------------------------
23 imagename Pre-name of input and output images
24 example : imagename='try'
26 Input images (* = required):
28 try.psf* - The point spread function
29 try.residual* - The observed (or residual) image, such as one
30 generated by tclean
31 try.model - An existing model image from a previous run of
32 tclean or deconvolve
33 try.mask - A pre-defined mask to be either used directly or
34 combined with additional masking options
35 try.pb - Primary beam model, if required for masking settings
37 Output images:
39 try.model - A new or updated model image
40 try.residual - An updated residual image
41 try.image - A restored image, created only when restoration=True
42 try.mask - The output mask
43 try.prev.mask - An intermediate by-product of automasking
44 (when usemask='auto-multithresh')
46 For multi-term wideband imaging, all relevant images above will
47 have additional .tt0,.tt1, etc suffixes to indicate Taylor terms,
48 plus the following extra input images.
49 try.alpha - spectral index
50 try.alpha.error - estimate of error on spectral index
51 try.beta - spectral curvature (if nterms > 2)
53 Tip : Include a directory name in 'imagename' for all
54 output images to be sent there instead of the
55 current working directory : imagename='mydir/try'
57 Tip : Restarting a deconvolution run without changing 'imagename'
58 implies continuation from the existing model image on disk.
59 By default, the residual image will be recomputed.
61 Note : All deconvolution runs will by default produce restored images.
62 For a niter=0 run, this will be redundant and can optionally
63 be turned off via the 'restoration=T/F' parameter.
65 Note : All input/output images should be 4D image cubes with axes
66 [ra,dec,pol,chan], as is the default for the task tclean. Any input
67 images without this format must be modified (eg with imregrid,
68 imtrans, image.adddegaxes) in order to be accepted.
69 startmodel Name of starting model image
71 The contents of the supplied starting model image will be
72 copied to the imagename.model before the run begins.
74 example : startmodel = 'singledish.im'
76 For deconvolver='mtmfs', one image per Taylor term must be provided.
77 example : startmodel = ['try.model.tt0', 'try.model.tt1']
78 startmodel = ['try.model.tt0'] will use a starting model only
79 for the zeroth order term.
80 startmodel = ['','try.model.tt1'] will use a starting model only
81 for the first order term.
83 This starting model can be of a different image shape and size from
84 what is currently being imaged. If so, an image regrid is first triggered
85 to resample the input image onto the target coordinate system.
87 If the startmodel is supplied, but a copy of of the destination
88 imagename.model already exists, deconvolve will exit with an error.
90 A common usage is to set this parameter equal to a single dish image
92 Negative components in the model image will be included as is.
93 deconvolver Name of minor cycle algorithm (hogbom,clark,multiscale,mem,clarkstokes)
95 Each of the following algorithms operate on residual images and psfs
96 from the gridder and produce output model and restored images.
97 Minor cycles stop when threshold or niter are reached. For all
98 methods, components are picked from the entire extent of the image or
99 (if specified) within a mask.
101 hogbom : An adapted version of Hogbom Clean [Hogbom, 1974]
102 - Find the location of the peak residual
103 - Add this delta function component to the model image
104 - Subtract a scaled and shifted PSF of the same size as the image
105 from regions of the residual image where the two overlap.
106 - Repeat
108 clark : An adapted version of Clark Clean [Clark, 1980]
109 - Find the location of max(I^2+Q^2+U^2+V^2)
110 - Add delta functions to each stokes plane of the model image
111 - Subtract a scaled and shifted PSF within a small patch size
112 from regions of the residual image where the two overlap.
113 - After several iterations trigger a Clark major cycle to subtract
114 components from the visibility domain, but without de-gridding.
115 - Repeat
117 ( Note : 'clark' maps to imagermode='' in the old clean task.
118 'clark_exp' is another implementation that maps to
119 imagermode='mosaic' or 'csclean' in the old clean task
120 but the behavior is not identical. For now, please
121 use deconvolver='hogbom' if you encounter problems. )
123 clarkstokes : Clark Clean operating separately per Stokes plane
125 (Note : 'clarkstokes_exp' is an alternate version. See above.)
127 multiscale : MultiScale Clean [Cornwell, 2008]
128 - Smooth the residual image to multiple scale sizes
129 - Find the location and scale at which the peak occurs
130 - Add this multiscale component to the model image
131 - Subtract a scaled,smoothed,shifted PSF (within a small
132 patch size per scale) from all residual images
133 - Repeat from step 2
136 mem : Maximum Entropy Method [Cornwell and Evans, 1985]
137 - Iteratively solve for values at all individual pixels via the
138 MEM method. It minimizes an objective function of
139 chi-square plus entropy (here, a measure of difference
140 between the current model and a flat prior model).
142 (Note : This MEM implementation is not very robust.
143 Improvements will be made in the future.)
145 mtmfs : Multi-term (Multi Scale) Multi-Frequency Synthesis [Rau and Cornwell, 2011]
146 - Smooth each Taylor residual image to multiple scale sizes
147 - Solve a NTxNT system of equations per scale size to compute
148 Taylor coefficients for components at all locations
149 - Compute gradient chi-square and pick the Taylor coefficients
150 and scale size at the location with maximum reduction in
151 chi-square
152 - Add multi-scale components to each Taylor-coefficient
153 model image
154 - Subtract scaled,smoothed,shifted PSF (within a small patch size
155 per scale) from all smoothed Taylor residual images
156 - Repeat from step 2
158 asp : This deconvolver is not currently considered reliable when used with
159 task deconvolve and is therefore disabled. Please choose a different
160 deconvolver.
161 scales List of scale sizes (in pixels) for multi-scale and mtmfs algorithms.
162 This set of scale sizes should represent the sizes
163 (diameters in units of number of pixels)
164 of dominant features in the image being reconstructed.
166 The smallest scale size is recommended to be 0 (point source),
167 the second the size of the synthesized beam and the third 3-5
168 times the synthesized beam, etc. For example, if the synthesized
169 beam is 10" FWHM and cell=2",try scales = [0,5,15].
171 For numerical stability, the largest scale must be
172 smaller than the image (or mask) size and smaller than or
173 comparable to the scale corresponding to the lowest measured
174 spatial frequency (as a scale size much larger than what the
175 instrument is sensitive to is unconstrained by the data making
176 it harder to recovery from errors during the minor cycle).
177 nterms Number of Taylor coefficients in the spectral model
179 - nterms=1 : Assume flat spectrum source
180 - nterms=2 : Spectrum is a straight line with a slope
181 - nterms=N : A polynomial of order N-1
183 From a Taylor expansion of the expression of a power law, the
184 spectral index is derived as alpha = taylorcoeff_1 / taylorcoeff_0
186 Spectral curvature is similarly derived when possible.
188 The optimal number of Taylor terms depends on the available
189 signal to noise ratio, bandwidth ratio, and spectral shape of the
190 source as seen by the telescope (sky spectrum x PB spectrum).
192 nterms=2 is a good starting point for wideband EVLA imaging
193 and the lower frequency bands of ALMA (when fractional bandwidth
194 is greater than 10%) and if there is at least one bright source for
195 which a dynamic range of greater than few 100 is desired.
197 Spectral artifacts for the VLA often look like spokes radiating out from
198 a bright source (i.e. in the image made with standard mfs imaging).
199 If increasing the number of terms does not eliminate these artifacts,
200 check the data for inadequate bandpass calibration. If the source is away
201 from the pointing center, consider including wide-field corrections too.
203 (Note : In addition to output Taylor coefficient images .tt0,.tt1,etc
204 images of spectral index (.alpha), an estimate of error on
205 spectral index (.alpha.error) and spectral curvature (.beta,
206 if nterms is greater than 2) are produced.
207 - These alpha, alpha.error and beta images contain
208 internal T/F masks based on a threshold computed
209 as peakresidual/10. Additional masking based on
210 .alpha/.alpha.error may be desirable.
211 - .alpha.error is a purely empirical estimate derived
212 from the propagation of error during the division of
213 two noisy numbers (alpha = xx.tt1/xx.tt0) where the
214 'error' on tt1 and tt0 are simply the values picked from
215 the corresponding residual images. The absolute value
216 of the error is not always accurate and it is best to interpret
217 the errors across the image only in a relative sense.)
218 smallscalebias A numerical control to bias the scales when using multi-scale or mtmfs algorithms.
219 The peak from each scale's smoothed residual is
220 multiplied by ( 1 - smallscalebias * scale/maxscale )
221 to increase or decrease the amplitude relative to other scales,
222 before the scale with the largest peak is chosen.
223 Smallscalebias can be varied between -1.0 and 1.0.
224 A score of 0.0 gives all scales equal weight (default).
225 A score larger than 0.0 will bias the solution towards smaller scales.
226 A score smaller than 0.0 will bias the solution towards larger scales.
227 The effect of smallscalebias is more pronounced when using multi-scale relative to mtmfs.
228 restoration .
230 Construct a restored image : imagename.image by convolving the model
231 image with a clean beam and adding the residual image to the result.
232 If a restoringbeam is specified, the residual image is also
233 smoothed to that target resolution before adding it in.
235 If a .model does not exist, it will make an empty one and create
236 the restored image from the residuals ( with additional smoothing if needed ).
237 With algorithm='mtmfs', this will construct Taylor coefficient maps from
238 the residuals and compute .alpha and .alpha.error.
239 restoringbeam ze to use.
241 - restoringbeam='' or ['']
242 A Gaussian fitted to the PSF main lobe (separately per image plane).
244 - restoringbeam='10.0arcsec'
245 Use a circular Gaussian of this width for all planes
247 - restoringbeam=['8.0arcsec','10.0arcsec','45deg']
248 Use this elliptical Gaussian for all planes
250 - restoringbeam='common'
251 Automatically estimate a common beam shape/size appropriate for
252 all planes.
254 Note : For any restoring beam different from the native resolution
255 the model image is convolved with the beam and added to
256 residuals that have been convolved to the same target resolution.
257 niter Maximum number of iterations
259 A stopping criterion based on total iteration count.
260 Currently the parameter type is defined as an integer therefore the integer value
261 larger than 2147483647 will not be set properly as it causes an overflow.
263 Iterations are typically defined as the selecting one flux component
264 and partially subtracting it out from the residual image.
266 niter=0 : Skip the deconvolution step (only do restoration)
268 niter larger than zero : The minor cycle.
270 Note : The following additional triggers will also stop minor cycle
271 iterations. Whichever condition is triggered first stops the minor
272 cycle.
274 'threshold' : The parameter value, compared to peak residual.
275 Divergence : As detected by an increase of 10% in peak residual from
276 the minimum so far (during minor cycle iterations).
278 The first criterion to be satisfied takes precedence.
280 Note : Iteration counts for cubes or multi-field images :
281 For images with multiple planes (or image fields) on which the
282 deconvolver operates in sequence, iterations are counted across
283 all planes (or image fields). The iteration count is compared with
284 'niter' only after all channels/planes/fields have completed their
285 minor cycles and exited either due to 'niter' or 'threshold'.
286 Therefore, the actual number of iterations reported in the logger
287 can sometimes be larger than the user specified value in 'niter'.
288 For example, with niter=100, nchan=10,threshold=0,
289 a total of 1000 iterations will be done in the first set of minor cycles
290 before the total is compared with niter=100 and it exits.
291 gain Loop gain
293 Fraction of the source flux to subtract out of the residual image
294 for the CLEAN algorithm and its variants.
296 A low value (0.2 or less) is recommended when the sky brightness
297 distribution is not well represented by the basis functions used by
298 the chosen deconvolution algorithm. A higher value can be tried when
299 there is a good match between the true sky brightness structure and
300 the basis function shapes. For example, for extended emission,
301 multiscale clean with an appropriate set of scale sizes will tolerate
302 a higher loop gain than Clark clean (for example).
303 threshold The minor cycle's stopping threshold (number in units of Jy, or string)
305 threshold = 0.005 : 5mJy
306 threshold = '5.0mJy'
308 Note : If nsigma is set (>0.0), the N-sigma threshold is calculated (see
309 the description under nsigma). Then threshold is modified as:
311 threshold = max( threshold, nsgima_threshold )
312 nsigma Multiplicative factor for rms-based threshold stopping
314 N-sigma threshold is calculated as nsigma * rms value per image plane determined
315 from a robust statistics. For nsigma > 0.0, in a minor cycle, a maximum of the two values,
316 the N-sigma threshold and threshold, is used as a stopping trigger
317 (see also the descreption under 'threshold').
318 Set nsigma=0.0 to preserve the previous deconvolve behavior without this feature.
319 The top level parameter, fastnoise is relevant for the rms noise calculation which is used
320 to determine the threshold.
321 interactive Modify masks and parameters at runtime
323 interactive=True will trigger an interactive GUI after deconvolution finishes.
325 Options for runtime parameter modification are :
327 Interactive clean mask : Draw a 1/0 mask (appears as a contour) by hand.
328 If a mask is supplied at the task interface or if
329 automasking is invoked, the current mask is
330 displayed in the GUI and is available for manual
331 editing.
333 Note : If a mask contour is not visible, please
334 check the cursor display at the bottom of
335 GUI to see which parts of the mask image
336 have ones and zeros. If the entire mask=1
337 no contours will be visible.
340 Operation buttons : -- For the task deconvolve, all options stop the minor cycle.
342 Iteration control : -- max cycleniter : For task deconvolve, this contol has no effect.
343 -- iterations left : Sets the limit on the number of iterations
344 about to be done.
345 -- threshold : Sets the peak residual stopping threshold for
346 for this execution of deconvolve.
347 fullsummary Return dictionary with complete convergence history
349 fullsummary=True: A full version of the summary dictionary is returned.
350 Keys include 'iterDone','peakRes','modelFlux','cycleThresh' that record the
351 convergence state at the end of each set of minor cycle iterations
352 separately for each image plane (i.e. channel/stokes) being
353 deconvolved. Additional keys report the convergence state at the
354 start of minor cycle iterations, stopping criteria that triggered major
355 cycles, and a processor ID per channel, for parallel cube runs.
357 fullsummary=False (default): A shorten version of the summary dictionary is returned
358 with only 'iterDone','peakRes','modelFlux', and 'cycleThresh'.
360 Detailed information about the return dictionary fields may be found
361 at CASA Docs > Synthesis Imaging > Iteration Control > Returned Dictionary.
362 fastnoise mask (user='multi-autothresh') and/or n-sigma stopping threshold
363 (nsigma>0.0) are/is used. If it is set to True, a simpler but faster noise calucation is used.
364 In this case, the threshold values are determined based on classic statistics (using all
365 unmasked pixels for the calculations).
367 If it is set to False, the new noise calculation
368 method is used based on pre-existing mask.
370 Case 1: no exiting mask
371 Calculate image statistics using Chauvenet algorithm
373 Case 2: there is an existing mask
374 Calculate image statistics by classical method on the region
375 outside the mask and inside the primary beam mask.
377 In all cases above RMS noise is calculated from MAD.
378 usemask Type of mask(s) to be used for deconvolution
380 user: (default) mask image(s) or user specified region file(s) or string CRTF expression(s)
381 subparameters: mask, pbmask
382 pb: primary beam mask
383 subparameter: pbmask
385 Example: usemask="pb", pbmask=0.2
386 Construct a mask at the 0.2 pb gain level.
387 (Currently, this option will work only with
388 gridders that produce .pb (i.e. mosaic and awproject)
389 or if an externally produced .pb image exists on disk)
391 auto-multithresh : auto-masking by multiple thresholds for deconvolution
392 subparameters : sidelobethreshold, noisethreshold, lownoisethreshold,
393 negativethrehsold, smoothfactor, minbeamfrac, cutthreshold,
394 pbmask, growiterations, dogrowprune, minpercentchange, verbose
395 Additional top level parameter relevant to auto-multithresh: fastnoise
400 Note: By default the intermediate mask generated by automask at each deconvolution cycle
401 is over-written in the next cycle but one can save them by setting
402 the environment variable, SAVE_ALL_AUTOMASKS="true".
403 (e.g. in the CASA prompt, os.environ['SAVE_ALL_AUTOMASKS']="true" )
404 The saved CASA mask image name will be imagename.mask.autothresh#, where
405 # is the iteration cycle number.
406 mask Mask (a list of image name(s) or region file(s) or region string(s)
409 The name of a CASA image or region file or region string that specifies
410 a 1/0 mask to be used for deconvolution. Only locations with value 1 will
411 be considered for the centers of flux components in the minor cycle.
412 If regions specified fall completely outside of the image, deconvolve will throw an error.
414 Manual mask options/examples :
416 mask='xxx.mask' : Use this CASA image named xxx.mask and containing
417 ones and zeros as the mask.
418 If the mask is only different in spatial coordinates from what is being made
419 it will be resampled to the target coordinate system before being used.
420 The mask has to have the same shape in velocity and Stokes planes
421 as the output image. Exceptions are single velocity and/or single
422 Stokes plane masks. They will be expanded to cover all velocity and/or
423 Stokes planes of the output cube.
425 [ Note : If an error occurs during image resampling or
426 if the expected mask does not appear, please try
427 using tasks 'imregrid' or 'makemask' to resample
428 the mask image onto a CASA image with the target
429 shape and coordinates and supply it via the 'mask'
430 parameter. ]
433 mask='xxx.crtf' : A text file with region strings and the following on the first line
434 ( #CRTFv0 CASA Region Text Format version 0 )
435 This is the format of a file created via the viewer's region
436 tool when saved in CASA region file format.
438 mask='circle[[40pix,40pix],10pix]' : A CASA region string.
440 mask=['xxx.mask','xxx.crtf', 'circle[[40pix,40pix],10pix]'] : a list of masks
446 Note : Mask images for deconvolution must contain 1 or 0 in each pixel.
447 Such a mask is different from an internal T/F mask that can be
448 held within each CASA image. These two types of masks are not
449 automatically interchangeable, so please use the makemask task
450 to copy between them if you need to construct a 1/0 based mask
451 from a T/F one.
453 Note : Work is in progress to generate more flexible masking options and
454 enable more controls.
455 pbmask Sub-parameter for usemask: primary beam mask
457 Examples : pbmask=0.0 (default, no pb mask)
458 pbmask=0.2 (construct a mask at the 0.2 pb gain level)
459 sidelobethreshold Sub-parameter for "auto-multithresh": mask threshold based on sidelobe levels:
460 sidelobethreshold * max_sidelobe_level * peak residual
461 noisethreshold Sub-parameter for "auto-multithresh": mask threshold based on the noise level:
462 noisethreshold * rms + location (=median)
464 The rms is calculated from MAD with rms = 1.4826*MAD.
465 lownoisethreshold Sub-parameter for "auto-multithresh": mask threshold to grow previously masked regions via binary dilation:
466 lownoisethreshold * rms in residual image + location (=median)
468 The rms is calculated from MAD with rms = 1.4826*MAD.
469 negativethreshold Sub-parameter for "auto-multithresh": mask threshold for negative features:
470 -1.0* negativethreshold * rms + location(=median)
472 The rms is calculated from MAD with rms = 1.4826*MAD.
473 smoothfactor Sub-parameter for "auto-multithresh": smoothing factor in a unit of the beam
474 minbeamfrac Sub-parameter for "auto-multithresh": minimum beam fraction in size to prune masks smaller than mimbeamfrac * beam
475 <=0.0 : No pruning
476 cutthreshold Sub-parameter for "auto-multithresh": threshold to cut the smoothed mask to create a final mask:
477 cutthreshold * peak of the smoothed mask
478 growiterations Sub-parameter for "auto-multithresh": Maximum number of iterations to perform using binary dilation for growing the mask
479 dogrowprune Experimental sub-parameter for "auto-multithresh": Do pruning on the grow mask
480 verbose he summary of automasking at the end of each automasking process
481 is printed in the logger. Following information per channel will be listed in the summary.
483 chan: channel number
484 masking?: F - stop updating automask for the subsequent iteration cycles
485 RMS: robust rms noise
486 peak: peak in residual image
487 thresh_type: type of threshold used (noise or sidelobe)
488 thresh_value: the value of threshold used
489 N_reg: number of the automask regions
490 N_pruned: number of the automask regions removed by pruning
491 N_grow: number of the grow mask regions
492 N_grow_pruned: number of the grow mask regions removed by pruning
493 N_neg_pix: number of pixels for negative mask regions
495 Note that for a large cube, extra logging may slow down the process.
496 [1;42mRETURNS[1;m void
498 --------- examples -----------------------------------------------------------
502 Please refer to the CASAdocs pages for the task deconvolve for examples.
507 """
509 _info_group_ = """imaging"""
510 _info_desc_ = """Image-domain deconvolution"""
512 def __call__( self, imagename='', startmodel='', deconvolver='hogbom', scales=[ ], nterms=int(2), smallscalebias=float(0.0), restoration=True, restoringbeam=[ ], niter=int(100), gain=float(0.1), threshold=float(0.0), nsigma=float(0.0), interactive=False, fullsummary=False, fastnoise=True, usemask='user', mask='', pbmask=float(0.0), sidelobethreshold=float(3.0), noisethreshold=float(5.0), lownoisethreshold=float(1.5), negativethreshold=float(0.0), smoothfactor=float(1.0), minbeamfrac=float(0.3), cutthreshold=float(0.01), growiterations=int(75), dogrowprune=True, verbose=False ):
513 schema = {'imagename': {'anyof': [{'type': 'cInt'}, {'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'startmodel': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'deconvolver': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'clarkstokes_exp', 'mtmfs', 'mem', 'clarkstokes', 'hogbom', 'clark_exp', 'clark', '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}, 'restoration': {'type': 'cBool'}, 'restoringbeam': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'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}, 'interactive': {'type': 'cBool'}, 'fullsummary': {'type': 'cBool'}, 'fastnoise': {'type': 'cBool'}, 'usemask': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'user', 'pb', 'auto-multithresh' ]}, 'mask': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'pbmask': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'sidelobethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'noisethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'lownoisethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'negativethreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'smoothfactor': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'minbeamfrac': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'cutthreshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'growiterations': {'type': 'cInt'}, 'dogrowprune': {'type': 'cBool'}, 'verbose': {'type': 'cBool'}}
514 doc = {'imagename': imagename, 'startmodel': startmodel, 'deconvolver': deconvolver, 'scales': scales, 'nterms': nterms, 'smallscalebias': smallscalebias, 'restoration': restoration, 'restoringbeam': restoringbeam, 'niter': niter, 'gain': gain, 'threshold': threshold, 'nsigma': nsigma, 'interactive': interactive, 'fullsummary': fullsummary, 'fastnoise': fastnoise, 'usemask': usemask, 'mask': mask, 'pbmask': pbmask, 'sidelobethreshold': sidelobethreshold, 'noisethreshold': noisethreshold, 'lownoisethreshold': lownoisethreshold, 'negativethreshold': negativethreshold, 'smoothfactor': smoothfactor, 'minbeamfrac': minbeamfrac, 'cutthreshold': cutthreshold, 'growiterations': growiterations, 'dogrowprune': dogrowprune, 'verbose': verbose}
515 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
516 _logging_state_ = _start_log( 'deconvolve', [ 'imagename=' + repr(_pc.document['imagename']), 'startmodel=' + repr(_pc.document['startmodel']), 'deconvolver=' + repr(_pc.document['deconvolver']), 'scales=' + repr(_pc.document['scales']), 'nterms=' + repr(_pc.document['nterms']), 'smallscalebias=' + repr(_pc.document['smallscalebias']), 'restoration=' + repr(_pc.document['restoration']), 'restoringbeam=' + repr(_pc.document['restoringbeam']), 'niter=' + repr(_pc.document['niter']), 'gain=' + repr(_pc.document['gain']), 'threshold=' + repr(_pc.document['threshold']), 'nsigma=' + repr(_pc.document['nsigma']), 'interactive=' + repr(_pc.document['interactive']), 'fullsummary=' + repr(_pc.document['fullsummary']), 'fastnoise=' + repr(_pc.document['fastnoise']), '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']), 'verbose=' + repr(_pc.document['verbose']) ] )
517 task_result = None
518 try:
519 task_result = _deconvolve_t( _pc.document['imagename'], _pc.document['startmodel'], _pc.document['deconvolver'], _pc.document['scales'], _pc.document['nterms'], _pc.document['smallscalebias'], _pc.document['restoration'], _pc.document['restoringbeam'], _pc.document['niter'], _pc.document['gain'], _pc.document['threshold'], _pc.document['nsigma'], _pc.document['interactive'], _pc.document['fullsummary'], _pc.document['fastnoise'], _pc.document['usemask'], _pc.document['mask'], _pc.document['pbmask'], _pc.document['sidelobethreshold'], _pc.document['noisethreshold'], _pc.document['lownoisethreshold'], _pc.document['negativethreshold'], _pc.document['smoothfactor'], _pc.document['minbeamfrac'], _pc.document['cutthreshold'], _pc.document['growiterations'], _pc.document['dogrowprune'], _pc.document['verbose'] )
520 except Exception as exc:
521 _except_log('deconvolve', exc)
522 raise
523 finally:
524 task_result = _end_log( _logging_state_, 'deconvolve', task_result )
525 return task_result
527deconvolve = _deconvolve( )