Skip to content

Commit

Permalink
Make crash when CASA crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
SpheMakh committed Jan 18, 2019
1 parent 8ac89c6 commit 3cceaef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion simms/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.8"
__version__ = "1.0.9"
2 changes: 0 additions & 2 deletions simms/casasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ def toFloat(val):
nscans = np.int( np.ceil( synthesis/scan_length[0] ) )
scan_length = scan_length*(nscans)

print sum(scan_length)/3600.0

if ndir>=1:
# if scan legth is not set, set it to equal the synthesis time
if nscans == 0:
Expand Down
4 changes: 3 additions & 1 deletion simms/simms.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def toList_freq(item, nounits=False):
stdout=subprocess.PIPE if not isinstance(sys.stdout,file) else sys.stdout,
shell=True)

failed = False
if process.stdout or process.stderr:
out,err = process.communicate()
sys.stdout.write(out)
Expand All @@ -202,6 +203,7 @@ def toList_freq(item, nounits=False):
process.wait()
if process.returncode:
print 'ERROR: simms.py returns errr code %d. %s'%(process.returncode, message)
failed = True

casa_script.close()
os.system('mv %s/%s . && rm -fr %s'%(tmpdir,logfile,tmpdir) )
Expand All @@ -222,7 +224,7 @@ def toList_freq(item, nounits=False):
std.write('\n %s ::: %s\n%s\n'%(ts," ".join(command),ran))
std.write("Parameters: %s\n"%fmt)

if os.path.exists(msname):
if os.path.exists(msname) and failed==False:
info("simms succeeded")
else:
raise CasapyError(message)
Expand Down

0 comments on commit 3cceaef

Please sign in to comment.