Commits

consistent error (except) handling, task sdfit, CAS-13125, CAS-13018
No tags

casa5/gcwrap/python/scripts/task_sdfit.py

Modified
68 68 fitfunc=fitfunc, nfit=num_fit_str,
69 69 linefinding=(fitmode=='auto'), threshold=thresh,
70 70 avg_limit=avg_limit, minwidth=minwidth, edge=edge,
71 71 tempfile=tempfile, tempoutfile=tempoutfile)
72 72
73 73 if os.path.exists(tempfile):
74 74 return _get_results(tempfile, fitfunc, nfit, outfile)
75 75 else:
76 76 raise Exception('temporary file was unexpectedly not created.')
77 77
78 - except Exception:
79 - raise
80 78 finally:
81 79 if 'tempfile' in locals() and os.path.exists(tempfile):
82 80 os.system('rm -f %s' % tempfile)
83 81 if 'tempoutfile' in locals() and os.path.exists(tempoutfile):
84 82 os.system('rm -rf %s' % tempoutfile)
85 83
86 84 def _get_results(tempfile, fitfunc, nfit, outfile):
87 85 res = {'cent':[], 'peak':[], 'fwhm':[], 'nfit':[]}
88 86 if (fitfunc == 'gaussian'):
89 87 func = 'gauss'

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

Add shortcut