Commits

Takeshi Nakazato authored 6231c86dd60 Merge
Merge pull request #883 in CASA/casa from bugfix/CAS-12301 to master

* commit '45fbaa1ca92dc25b2f64cf224cbe1f444842dc1b': CAS-12301 fix message if no outfile specified
No tags

gcwrap/python/scripts/task_imcollapse.py

Modified
68 68 from ialib import write_image_history
69 69
70 70 def imcollapse(
71 71 imagename=None, function=None, axes=None, outfile=None, box=None,
72 72 region=None, chans=None, stokes=None, mask=None,
73 73 overwrite=None, stretch=None
74 74 ):
75 75 casalog.origin('imcollapse')
76 76 try :
77 77 if (len(outfile) == 0):
78 - raise Exception, "oufile must be specified"
78 + raise Exception, "outfile must be specified"
79 79 myia = iatool()
80 80 myia.dohistory(False)
81 81 if (not myia.open(imagename)):
82 82 raise Exception, "Cannot create image analysis tool using " + imagename
83 83 outia = myia.collapse(
84 84 function, axes, outfile, region, box, chans,
85 85 stokes, mask, overwrite, stretch
86 86 )
87 87 try:
88 88 param_names = imcollapse.func_code.co_varnames[:imcollapse.func_code.co_argcount]
89 89 param_vals = [eval(p) for p in param_names]
90 90 write_image_history(
91 91 outia, sys._getframe().f_code.co_name,
92 92 param_names, param_vals, casalog
93 93 )
94 94 except Exception, instance:
95 95 casalog.post("*** Error \'%s\' updating HISTORY" % (instance), 'WARN')
96 96 outia.done()
97 97 return True
98 98 except Exception, instance:
99 - casalog.post( str( '*** Error ***') + str(instance), 'SEVERE')
99 + casalog.post('*** Error *** ' + str(instance), 'SEVERE')
100 100 raise
101 101 finally:
102 102 if myia:
103 103 myia.done()
104 104 if outia:
105 105 outia.done()
106 106

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

Add shortcut