ia, dc, tb=gentools(['ia', 'dc', 'tb'])
def deconvolve(imagename,model,psf,alg,niter,gain,threshold,mask,scales,sigma,targetflux,prior):
""" deconvolve: Image based deconvolver. The psf provided is
deconvolved out of the image provided.
imagename -- Name of input image to be deconvoled
model -- Name of output to store found model, a.k.a clean components
psf -- Name of psf image to use e.g psf='mypsf.image' .
But if the psf has 3 parameter, then
a gaussian psf is assumed with the values representing
the major , minor and position angle values
e.g psf=['3arcsec', '2.5arcsec', '10deg']
alg -- algorithm to use clark, hogbom or multiscale or mem. if multiscale
the parameter scale is used to define the number of scales.
niter -- Number of iteration
gain -- CLEAN gain parameter; fraction to remove from peak (< 1.0)
threshold -- deconvolution stopping threshold: if no peak above
mask -- mask image (same shape as image and psf) to limit region
where deconvoltion is to occur
------parameters useful for multiscale only
scales -- parameter needed for multiscale clean. default value [0,3,10]
------parameters useful for mem only
sigma -- Estimated noise for image
targetflux -- Target total flux in image
prior -- Prior image to guide mem
casalog.origin('deconvolve')
raise Exception, "****give some psf please****"
if (type(psf[0])==str and os.path.exists(psf[0])):
raise Exception, "****problem with input psf image****"
ia.fromimage(tmppsf,modPsf, overwrite=True)
tmpImagename=_add_axes(imagename)
if tmpImagename is False:
raise Exception, "****problem with input diry image****"