Commits

Srikrishna Sekhar authored f6b7c80f4bf
CAS-14184 : Bug fix for previous commit

Forgot to remove a second line that had the wrong maskname. Also removed extraneous print statements in gclean

casatasks/src/private/imagerhelpers/_gclean.py

Modified
38 38 from casatasks import deconvolve, tclean, imstat
39 39
40 40 ###
41 41 ### import check versions
42 42 ###
43 43 _GCV001 = True
44 44 _GCV002 = True
45 45 _GCV003 = True
46 46 _GCV004 = True
47 47
48 -print("USING THIS GCLEAN")
49 -
50 48
51 49 # from casatasks.private.imagerhelpers._gclean import gclean
52 50 class gclean:
53 51 '''gclean(...) creates a stream of convergence records which indicate
54 52 the convergence quaility of the tclean process. The initial record
55 53 describes the initial dirty image.
56 54 It is designed for use with the interactive clean GUI, but it could
57 55 be used independently. It can be used as a regular generator:
58 56 for rec in gclean( vis='refim_point_withline.ms', imagename='test', imsize=512, cell='12.0arcsec',
59 57 specmode='cube', interpolation='nearest', nchan=5, start='1.0GHz', width='0.2GHz',
206 204 def __init__( self, vis, imagename, field='', spw='', timerange='', uvrange='', antenna='', scan='', observation='', intent='', datacolumn='corrected', imsize=[100], cell=[ ],
207 205 phasecenter='', stokes='I', startmodel='', specmode='cube', reffreq='', nchan=-1, start='', width='', outframe='LSRK', veltype='radio', restfreq='', interpolation='linear',
208 206 perchanweightdensity=True, gridder='standard', wprojplanes=int(1), mosweight=True, psterm=False, wbawp=True, conjbeams=False, usepointing=False, pointingoffsetsigdev=[ ],
209 207 pblimit=0.2, deconvolver='hogbom', smallscalebias=0.0, niter=0, threshold='0.1Jy', nsigma=0.0, cycleniter=-1, nmajor=1, cyclefactor=1.0, minpsffraction=0.05,
210 208 maxpsffraction=0.8, scales=[], restoringbeam='', pbcor=False, nterms=int(2), weighting='natural', robust=float(0.5), npixels=0, gain=float(0.1), pbmask=0.2, sidelobethreshold=3.0,
211 209 noisethreshold=5.0, lownoisethreshold=1.5, negativethreshold=0.0, smoothfactor=float(1.0), minbeamfrac=0.3, cutthreshold=0.01, growiterations=75, dogrowprune=True,
212 210 minpercentchange=-1.0, verbose=False, fastnoise=True, savemodel='none', usemask='user', mask='', parallel=False, history_filter=lambda index, arg, history_value: history_value ):
213 211
214 212 self._vis = vis
215 213 self._imagename = imagename
216 - print(f"Input imagename is ", imagename)
217 - print(f"Derived maskname is ", imagename + '.mask')
218 214 self._imsize = imsize
219 215 self._cell = cell
220 216 self._phasecenter = phasecenter
221 217 self._stokes = stokes
222 218 self._startmodel = startmodel
223 219 self._specmode = specmode
224 220 self._reffreq = reffreq
225 221 self._nchan = nchan
226 222 self._start = start
227 223 self._width = width
394 390 def _fix_initial_mask(self):
395 391 """
396 392 If on start up, no user mask is provided, then flip the initial mask to
397 393 be all zeros for interactive use.
398 394 """
399 395
400 396 from casatools import image
401 397 ia = image()
402 398
403 399 if self._usemask == 'user' and self._mask == '':
404 - if self._deconvolver == 'mtmfs':
405 - maskname = self._imagename + '.mask.tt0'
406 - else:
407 - maskname = self._imagename + '.mask'
400 + maskname = self._imagename + '.mask'
408 401
409 402 # This means the mask was newly created by deconvolve, so flip it
410 403 if os.path.exists(maskname) and self._initial_mask_exists is False:
411 404 ia.open(maskname)
412 405 ia.set(0.0)
413 406 ia.close()
414 407
415 408 def _update_peakres(self):
416 409 if self._deconvolver == 'mtmfs':
417 410 residname = self._imagename + '.residual.tt0'

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut