casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
task_imsubimage.py
Go to the documentation of this file.
00001 from taskinit import *
00002 
00003 def imsubimage(
00004     imagename=None, outfile=None, region=None,
00005     mask=None, dropdeg=None, overwrite=None, verbose=None,
00006     stretch=None, wantreturn=None
00007 ):
00008     casalog.origin('imsubimage')
00009     myia = iatool()
00010     try:
00011         if (not myia.open(imagename)):
00012             raise Exception, "Cannot create image analysis tool using " + imagename
00013         outia = myia.subimage(
00014             outfile=outfile, region=region, mask=mask, dropdeg=dropdeg,
00015             overwrite=overwrite, list=verbose, stretch=stretch
00016         )
00017         myia.done()
00018         if (wantreturn):
00019             return outia
00020         else:
00021             outia.done()
00022             return True
00023     except Exception, instance:
00024         if (myia):
00025             myia.done()
00026         if (outia):
00027             outia.done()
00028         casalog.post( str( '*** Error ***') + str(instance), 'SEVERE')
00029         return False
00030