imagename, moments, axis, region, box, chans, stokes,
mask, includepix, excludepix, outfile, stretch
casalog.origin('immoments')
raise Exception, "outfile must be specified"
# First check to see if the output file exists. If it
# does then we abort. CASA doesn't allow files to be
# over-written, just a policy.
if ( len( outfile ) > 0 and os.path.exists( outfile ) ):
if os.path.exists(outfile):
raise Exception, 'Output file, '+outfile+\
' exists. immoment can not proceed, please\n'\
'remove it or change the output file name.'
elif ( len( outfile ) == 1 ):
raise Exception, 'outfile is not specified but must be'
reg = _rg.frombcs(csys=_myia.coordsys().torecord(),
shape=_myia.shape(), box=box, chans=chans, stokes=stokes,
stokescontrol="a", region=region
param_names = immoments.func_code.co_varnames[:immoments.func_code.co_argcount]
param_vals = [eval(p) for p in param_names]
method = sys._getframe().f_code.co_name
for im in created_images:
im, method, param_names, param_vals, casalog
except Exception, instance:
casalog.post("*** Error \'%s\' updating HISTORY" % (instance), 'WARN')
print '*** Error ***: ' + str(x)
except Exception, instance:
casalog.post('*** Error *** ' + str(instance), 'SEVERE')
def _immoments_get_created_images(out1name, outfile):
dirpath = os.path.dirname(out1name)
target_time = os.path.getmtime(out1name)