Commits
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 | |