00001
00002
00003
00004
00005
00006
00007
00008
00009 from sys import version_info
00010 if version_info >= (2,6,0):
00011 def swig_import_helper():
00012 from os.path import dirname
00013 import imp
00014 fp = None
00015 try:
00016 fp, pathname, description = imp.find_module('_deconvolver', [dirname(__file__)])
00017 except ImportError:
00018 import _deconvolver
00019 return _deconvolver
00020 if fp is not None:
00021 try:
00022 _mod = imp.load_module('_deconvolver', fp, pathname, description)
00023 finally:
00024 fp.close()
00025 return _mod
00026 _deconvolver = swig_import_helper()
00027 del swig_import_helper
00028 else:
00029 import _deconvolver
00030 del version_info
00031 try:
00032 _swig_property = property
00033 except NameError:
00034 pass
00035 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
00036 if (name == "thisown"): return self.this.own(value)
00037 if (name == "this"):
00038 if type(value).__name__ == 'SwigPyObject':
00039 self.__dict__[name] = value
00040 return
00041 method = class_type.__swig_setmethods__.get(name,None)
00042 if method: return method(self,value)
00043 if (not static):
00044 self.__dict__[name] = value
00045 else:
00046 raise AttributeError("You cannot add attributes to %s" % self)
00047
00048 def _swig_setattr(self,class_type,name,value):
00049 return _swig_setattr_nondynamic(self,class_type,name,value,0)
00050
00051 def _swig_getattr(self,class_type,name):
00052 if (name == "thisown"): return self.this.own()
00053 method = class_type.__swig_getmethods__.get(name,None)
00054 if method: return method(self)
00055 raise AttributeError(name)
00056
00057 def _swig_repr(self):
00058 try: strthis = "proxy of " + self.this.__repr__()
00059 except: strthis = ""
00060 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
00061
00062 try:
00063 _object = object
00064 _newclass = 1
00065 except AttributeError:
00066 class _object : pass
00067 _newclass = 0
00068
00069
00070 class deconvolver(_object):
00071 """Proxy of C++ casac::deconvolver class"""
00072 __swig_setmethods__ = {}
00073 __setattr__ = lambda self, name, value: _swig_setattr(self, deconvolver, name, value)
00074 __swig_getmethods__ = {}
00075 __getattr__ = lambda self, name: _swig_getattr(self, deconvolver, name)
00076 __repr__ = _swig_repr
00077 def __init__(self):
00078 """__init__(self) -> deconvolver"""
00079 this = _deconvolver.new_deconvolver()
00080 try: self.this.append(this)
00081 except: self.this = this
00082 __swig_destroy__ = _deconvolver.delete_deconvolver
00083 __del__ = lambda self : None;
00084 def open(self, *args, **kwargs):
00085 """
00086 open(self, dirty=string(""), psf=string(""), warn=True) -> bool
00087
00088 Summary
00089 Open a new dirty image and PSF
00090
00091 Input Parameters:
00092 dirty Dirty image to be processed
00093 psf point spread function to be processed
00094 warn Produce warning messages if psf is not provided true
00095
00096 --------------------------------------------------------------------------------
00097
00098 """
00099 return _deconvolver.deconvolver_open(self, *args, **kwargs)
00100
00101 def reopen(self):
00102 """
00103 reopen(self) -> bool
00104
00105 Summary
00106 Reopen the dirty image and PSF
00107 --------------------------------------------------------------------------------
00108
00109 """
00110 return _deconvolver.deconvolver_reopen(self)
00111
00112 def close(self):
00113 """
00114 close(self) -> bool
00115
00116 Summary
00117 Close the deconvolver tool
00118 --------------------------------------------------------------------------------
00119
00120 """
00121 return _deconvolver.deconvolver_close(self)
00122
00123 def done(self):
00124 """
00125 done(self) -> bool
00126
00127 Summary
00128 Terminate the deconvolver process
00129 --------------------------------------------------------------------------------
00130
00131 """
00132 return _deconvolver.deconvolver_done(self)
00133
00134 def summary(self):
00135 """
00136 summary(self) -> bool
00137
00138 Summary
00139 Summarize the current state
00140 --------------------------------------------------------------------------------
00141
00142 """
00143 return _deconvolver.deconvolver_summary(self)
00144
00145 def boxmask(self, *args, **kwargs):
00146 """
00147 boxmask(self, mask=string(""), blc=initialize_vector(1, (int)-1), trc=initialize_vector(1, (int)-1),
00148 fillvalue=initialize_variant("1.0Jy"), outsidevalue=initialize_variant("0.0Jy")) -> bool
00149
00150 Summary
00151 Construct a mask from blc, trc
00152
00153 Input Parameters:
00154 mask name of mask image
00155 blc Bottom left corner -1
00156 trc Top right corner -1
00157 fillvalue Value to fill in 1.0Jy
00158 outsidevalue outside value 0.0Jy
00159
00160 --------------------------------------------------------------------------------
00161
00162 """
00163 return _deconvolver.deconvolver_boxmask(self, *args, **kwargs)
00164
00165 def regionmask(self, *args, **kwargs):
00166 """
00167 regionmask(self, mask=string(""), region=initialize_record(""), boxes=initialize_variant(""), value=1.0) -> bool
00168
00169 Summary
00170 Construct a mask image from a region
00171
00172 Input Parameters:
00173 mask name of mask image
00174 region Region record usually from regionmanager unset
00175 boxes list of 4 elements lists e.g [[xblc1, yblc1, xtrc1, ytrc1], [[xblc2, yblc2, xtrc2, ytrc2]]
00176 value Value to set the mask to 1.0
00177
00178 --------------------------------------------------------------------------------
00179
00180 """
00181 return _deconvolver.deconvolver_regionmask(self, *args, **kwargs)
00182
00183 def clipimage(self, *args, **kwargs):
00184 """
00185 clipimage(self, clippedimage=string(""), inputimage=string(""), threshold=initialize_variant("0.0Jy")) -> bool
00186
00187 Summary
00188 Zero all pixels where Stokes I is below
00189 a threshold
00190
00191 Input Parameters:
00192 clippedimage name of clipped image
00193 inputimage name of input image
00194 threshold Threshold 0.0Jy
00195
00196 --------------------------------------------------------------------------------
00197
00198 """
00199 return _deconvolver.deconvolver_clipimage(self, *args, **kwargs)
00200
00201 def clarkclean(self, *args, **kwargs):
00202 """
00203 clarkclean(self, niter=1000, gain=0.1, threshold=initialize_variant("0Jy"), displayprogress=False,
00204 model=string(""), mask=string(""), histbins=500, psfpatchsize=initialize_vector(2,(int)51, (int)51),
00205 maxextpsf=0.2, speedup=0.0, maxnumpix=10000, maxnummajcycles=-1,
00206 maxnumminoriter=-1) -> bool
00207
00208 Summary
00209 Make a clean image using the Clark Clean
00210 a threshold
00211
00212 Input Parameters:
00213 niter Number of iterations 1000
00214 gain Loop Gain for CLEANing 0.1
00215 threshold Flux level at which to stop CLEANing 0Jy
00216 displayprogress Display the progress of the cleaning? false
00217 model Name of images
00218 mask Name of mask images used for CLEANing
00219 histbins Number of bins in the pixel-flux histogram 500
00220 psfpatchsize Size of PSF for minor cycle 51 51
00221 maxextpsf maximum external sidelobe, used to set depth of minor cycle clean 0.2
00222 speedup Cleaning speedup exponent 0.0
00223 maxnumpix Maximum number of pixels used in each minor cycle 10000
00224 maxnummajcycles Max number of major cycles; -1 = no restrictions -1
00225 maxnumminoriter Max number of minor iterations; -1 = no restrictions -1
00226
00227 --------------------------------------------------------------------------------
00228
00229 """
00230 return _deconvolver.deconvolver_clarkclean(self, *args, **kwargs)
00231
00232 def fullclarkclean(self, *args, **kwargs):
00233 """
00234 fullclarkclean(self, niter=1000, gain=0.1, threshold=initialize_variant("0Jy"), model=string(""), mask=string(""),
00235 cyclefactor=1.5) -> record *
00236
00237 Summary
00238 Make a clean image using the Clark Clean
00239 a threshold
00240
00241 Input Parameters:
00242 niter Number of iterations 1000
00243 gain Loop Gain for CLEANing 0.1
00244 threshold Flux level at which to stop CLEANing 0Jy
00245 model Name of model image that will contain the clean components
00246 mask Name of mask image used for CLEANing
00247 cyclefactor Factor to determine how deep to go in a Clark minor cycle 1.5
00248
00249 --------------------------------------------------------------------------------
00250
00251 """
00252 return _deconvolver.deconvolver_fullclarkclean(self, *args, **kwargs)
00253
00254 def dirtyname(self):
00255 """
00256 dirtyname(self) -> string
00257
00258 Summary
00259 Return the name of the dirty-image table
00260 --------------------------------------------------------------------------------
00261
00262 """
00263 return _deconvolver.deconvolver_dirtyname(self)
00264
00265 def psfname(self):
00266 """
00267 psfname(self) -> string
00268
00269 Summary
00270 Return the name of the PSF-image table
00271 --------------------------------------------------------------------------------
00272
00273 """
00274 return _deconvolver.deconvolver_psfname(self)
00275
00276 def make(self, *args, **kwargs):
00277 """
00278 make(self, image=string(""), async=False) -> bool
00279
00280 Summary
00281 Make an empty image
00282
00283 Input Parameters:
00284 image Name of the new image on the disk
00285 async Run asynchronously in the background? false
00286
00287 --------------------------------------------------------------------------------
00288
00289 """
00290 return _deconvolver.deconvolver_make(self, *args, **kwargs)
00291
00292 def convolve(self, *args, **kwargs):
00293 """
00294 convolve(self, convolvemodel=string(""), model=string("")) -> bool
00295
00296 Summary
00297 Convolves an image with the PSF
00298
00299 Input Parameters:
00300 convolvemodel Name of the output image on the disk to hold the result of the convolution
00301 model The input image to be convolved with the PSF
00302
00303 --------------------------------------------------------------------------------
00304
00305 """
00306 return _deconvolver.deconvolver_convolve(self, *args, **kwargs)
00307
00308 def makegaussian(self, *args, **kwargs):
00309 """
00310 makegaussian(self, gaussianimage=string(""), bmaj=initialize_variant("0rad"), bmin=initialize_variant("0rad"),
00311 bpa=initialize_variant("0deg"), normalize=True, async=False) -> bool
00312
00313 Summary
00314 Make an image with a single gaussian
00315 component
00316
00317 Input Parameters:
00318 gaussianimage Name of the output image on the disk
00319 bmaj The major axis of the gaussian 0rad
00320 bmin The minor axis of the gaussian 0rad
00321 bpa The Position Angle of the gaussian 0deg
00322 normalize Normalize the area under the gaussian to 1.0? true
00323 async Run asynchronously in the background? false
00324
00325 --------------------------------------------------------------------------------
00326
00327 """
00328 return _deconvolver.deconvolver_makegaussian(self, *args, **kwargs)
00329
00330 def state(self):
00331 """
00332 state(self) -> bool
00333
00334 Summary
00335 Return the ``state'' of the tool
00336 --------------------------------------------------------------------------------
00337
00338 """
00339 return _deconvolver.deconvolver_state(self)
00340
00341 def updatestate(self, *args, **kwargs):
00342 """
00343 updatestate(self, f=string(""), method=string("INIT")) -> bool
00344
00345 Summary
00346 [A GUI builders related function]Update the GUI to reflect the currect state
00347
00348 Input Parameters:
00349 f Glish variable for the GUI to be updated
00350 method The method to be used for updating DONE close INIT
00351
00352 --------------------------------------------------------------------------------
00353
00354 """
00355 return _deconvolver.deconvolver_updatestate(self, *args, **kwargs)
00356
00357 def clean(self, *args, **kwargs):
00358 """
00359 clean(self, algorithm=string("hogbom"), niter=1000, gain=0.1, threshold=initialize_variant("0Jy"),
00360 displayprogress=False, model=string(""), mask=string(""), async=False) -> record *
00361
00362 Summary
00363 Make a clean image with Hogbom or MultiScale Clean
00364
00365 Input Parameters:
00366 algorithm Algorithm to use fullmsclean msclean hogbom
00367 niter Number of Iterations, set to zero for no CLEANing 1000
00368 gain Loop Gain for CLEANing, try 0.7 for msclean or fullmsclean 0.1
00369 threshold Flux level at which to stop CLEANing 0Jy
00370 displayprogress Display progress false
00371 model Name of images
00372 mask Name of mask images used for CLEANing
00373 async Run asynchronously in the background? false
00374
00375 --------------------------------------------------------------------------------
00376
00377 """
00378 return _deconvolver.deconvolver_clean(self, *args, **kwargs)
00379
00380 def setscales(self, *args, **kwargs):
00381 """
00382 setscales(self, scalemethod=string("nscales"), nscales=5, uservector=initialize_vector(3,(double)0.0, (double)3.0, (double)10.0)) -> bool
00383
00384 Summary
00385 Set the scale sizes for MultiScale Clean
00386
00387 Input Parameters:
00388 scalemethod Method by which scales are set uservector nscales
00389 nscales Number of scales 5
00390 uservector Vector of scale sizes to use 0.0 3.0 10.0
00391
00392 --------------------------------------------------------------------------------
00393
00394 """
00395 return _deconvolver.deconvolver_setscales(self, *args, **kwargs)
00396
00397 def ft(self, *args, **kwargs):
00398 """
00399 ft(self, model=string(""), transform=string(""), async=False) -> bool
00400
00401 Summary
00402 Fourier transform the specified model
00403
00404 Input Parameters:
00405 model Name of image
00406 transform Name of transform image
00407 async Run asynchronously in the background? false
00408
00409 --------------------------------------------------------------------------------
00410
00411 """
00412 return _deconvolver.deconvolver_ft(self, *args, **kwargs)
00413
00414 def restore(self, *args, **kwargs):
00415 """
00416 restore(self, model=string(""), image=string(""), bmaj=initialize_variant("0rad"), bmin=initialize_variant("0rad"),
00417 bpa=initialize_variant("0deg"), async=False) -> bool
00418
00419 Summary
00420 Restore the residuals
00421
00422 Input Parameters:
00423 model Name of input model
00424 image Name of output restored image
00425 bmaj Major axis of beam 0rad
00426 bmin Minor axis of beam 0rad
00427 bpa 0deg Position angle of beam
00428 async Run asynchronously in the background false
00429
00430 --------------------------------------------------------------------------------
00431
00432 """
00433 return _deconvolver.deconvolver_restore(self, *args, **kwargs)
00434
00435 def residual(self, *args, **kwargs):
00436 """
00437 residual(self, model=string(""), image=string(""), async=False) -> bool
00438
00439 Summary
00440 Find the residuals
00441
00442 Input Parameters:
00443 model Names of input models
00444 image Names of output residual images
00445 async Run asynchronously in the background false
00446
00447 --------------------------------------------------------------------------------
00448
00449 """
00450 return _deconvolver.deconvolver_residual(self, *args, **kwargs)
00451
00452 def smooth(self, *args, **kwargs):
00453 """
00454 smooth(self, model=string(""), image=string(""), bmaj=initialize_variant("0rad"), bmin=initialize_variant("0rad"),
00455 bpa=initialize_variant("0deg"), normalize=True, async=False) -> bool
00456
00457 Summary
00458 smooth the image
00459
00460 Input Parameters:
00461 model Name of input model
00462 image Name of output smoothed image
00463 bmaj Major axis of beam 0rad
00464 bmin Minor axis of beam 0rad
00465 bpa Position angle of beam 0deg
00466 normalize Normalize volume of psf to unity true
00467 async Run asynchronously in the background false
00468
00469 --------------------------------------------------------------------------------
00470
00471 """
00472 return _deconvolver.deconvolver_smooth(self, *args, **kwargs)
00473
00474 def mem(self, *args, **kwargs):
00475 """
00476 mem(self, entropy=string("entropy"), niter=20, sigma=initialize_variant("0.001Jy"), targetflux=initialize_variant("1.0Jy"),
00477 constrainflux=False, displayprogress=False,
00478 model=string(""), prior=string(""), mask=string(""), imageplane=False, async=False) -> bool
00479
00480 Summary
00481 Make the mem image
00482
00483 Input Parameters:
00484 entropy entropy to use emptiness entropy
00485 niter Number of Iterations, set to zero for no MEMing 20
00486 sigma Noise level to try to achieve 0.001Jy
00487 targetflux Total image flux to try to achieve 1.0Jy
00488 constrainflux Use targetflux as a constraint? (or starting flux) false
00489 displayprogress Display progress false
00490 model Name of input/output model image
00491 prior Name of prior (default) image used for mem
00492 mask Mask image restricting emission (all pixels 0 or 1)
00493 imageplane Is this an image plane problem (like single dish)? false
00494 async Run asynchronously in the background? false
00495
00496 --------------------------------------------------------------------------------
00497
00498 """
00499 return _deconvolver.deconvolver_mem(self, *args, **kwargs)
00500
00501 def makeprior(self, *args, **kwargs):
00502 """
00503 makeprior(self, prior=string(""), templateimage=string(""), lowclipfrom=initialize_variant("0.0Jy"),
00504 lowclipto=initialize_variant("0.0Jy"), highclipfrom=initialize_variant("9e20Jy"),
00505 highclipto=initialize_variant("9e20Jy"), blc=initialize_vector(1, (int)-1),
00506 trc=initialize_vector(1, (int)-1), async=False) -> bool
00507
00508 Summary
00509 Make the mem's prior image, or make a mask
00510
00511 Input Parameters:
00512 prior output prior image
00513 templateimage starting point for prior image
00514 lowclipfrom Clip any pixel below this level 0.0Jy
00515 lowclipto Any clipped pixel will be given this value 0.0Jy
00516 highclipfrom Clip any pixel above this level 9e20Jy
00517 highclipto Any clipped pixel will be given this value 9e20Jy
00518 blc Bottom left hand corner for box; outside box is clipped -1
00519 trc Top right hand corner for box; outside box is clipped -1
00520 async Run asynchronously in the background? false
00521
00522 --------------------------------------------------------------------------------
00523
00524 """
00525 return _deconvolver.deconvolver_makeprior(self, *args, **kwargs)
00526
00527 def mtopen(self, *args, **kwargs):
00528 """
00529 mtopen(self, ntaylor=2, scalevector=initialize_vector(3,(double)0.0, (double)3.0, (double)10.0),
00530 psfs=std::vector< string >(1, ""), async=False) -> bool
00531
00532 Summary
00533 Init : Make a series of images using a Multi-Term Clean algorithm
00534
00535 Input Parameters:
00536 ntaylor Number of terms in the taylor polynomial 2
00537 scalevector Vector of scale sizes to use 0.0 3.0 10.0
00538 psfs Intpu : List of names of 2N-1 psfs. This is valid only for a Taylor-polynomial model.
00539 async Run asynchronously in the background? false
00540
00541 --------------------------------------------------------------------------------
00542
00543 """
00544 return _deconvolver.deconvolver_mtopen(self, *args, **kwargs)
00545
00546 def mtclean(self, *args, **kwargs):
00547 """
00548 mtclean(self, residuals=std::vector< string >(1, ""), models=std::vector< string >(1, ""), niter=1000,
00549 gain=0.1, threshold=initialize_variant("0Jy"), displayprogress=False,
00550 mask=string(""), async=False) -> record *
00551
00552 Summary
00553 Make a series of images using a Multi-Term Clean algorithm
00554
00555 Input Parameters:
00556 residuals Input : List of names of N residual images
00557 models Output : List of names of N model images
00558 niter Number of Iterations, set to zero for no CLEANing 1000
00559 gain Loop Gain for CLEANing, try 0.7 for msclean or fullmsclean 0.1
00560 threshold Flux level at which to stop CLEANing 0Jy
00561 displayprogress Display progress false
00562 mask Name of mask images used for CLEANing
00563 async Run asynchronously in the background? false
00564
00565 --------------------------------------------------------------------------------
00566
00567 """
00568 return _deconvolver.deconvolver_mtclean(self, *args, **kwargs)
00569
00570 def mtrestore(self, *args, **kwargs):
00571 """
00572 mtrestore(self, models=std::vector< string >(1, ""), residuals=std::vector< string >(1, ""), images=std::vector< string >(1, ""),
00573 bmaj=initialize_variant("0rad"), bmin=initialize_variant("0rad"),
00574 bpa=initialize_variant("0deg"), async=False) -> bool
00575
00576 Summary
00577 Restore the Multi-Term residuals
00578
00579 Input Parameters:
00580 models Input : Name of input model
00581 residuals Input : Name of residual image
00582 images Output : Name of output restored image
00583 bmaj Major axis of beam 0rad
00584 bmin Minor axis of beam 0rad
00585 bpa 0deg Position angle of beam
00586 async Run asynchronously in the background false
00587
00588 --------------------------------------------------------------------------------
00589
00590 """
00591 return _deconvolver.deconvolver_mtrestore(self, *args, **kwargs)
00592
00593 def mtcalcpowerlaw(self, *args, **kwargs):
00594 """
00595 mtcalcpowerlaw(self, images=std::vector< string >(1, ""), residuals=std::vector< string >(1, ""), alphaname=string(""),
00596 betaname=string(""), threshold=initialize_variant("0.0Jy"),
00597 calcerror=False, async=False) -> bool
00598
00599 Summary
00600 Interpret Taylor coefficients as a power law, and compute spectral index
00601
00602 Input Parameters:
00603 images Input : Names of input restored images
00604 residuals Input : Names of input residuals images ( for error calcs )
00605 alphaname Output : Name of output spectral-index image
00606 betaname Output : Name of output spectral-curvature image
00607 threshold Threshold 0.0Jy
00608 calcerror Calculate an error image for spectral index false
00609 async Run asynchronously in the background false
00610
00611 --------------------------------------------------------------------------------
00612
00613 """
00614 return _deconvolver.deconvolver_mtcalcpowerlaw(self, *args, **kwargs)
00615
00616 deconvolver_swigregister = _deconvolver.deconvolver_swigregister
00617 deconvolver_swigregister(deconvolver)
00618
00619
00620
00621