From 10b752cc9b3688a1afd8d80df50d5c4cbe637488 Mon Sep 17 00:00:00 2001 From: SpheMakh Date: Mon, 16 Feb 2015 17:48:16 +0200 Subject: [PATCH] add casasm.py symlink to bin --- Owlcat/bin/casasm.py | 1 + Owlcat/simms/simms.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 120000 Owlcat/bin/casasm.py diff --git a/Owlcat/bin/casasm.py b/Owlcat/bin/casasm.py new file mode 120000 index 0000000..fb41200 --- /dev/null +++ b/Owlcat/bin/casasm.py @@ -0,0 +1 @@ +../simms/casasm.py \ No newline at end of file diff --git a/Owlcat/simms/simms.py b/Owlcat/simms/simms.py index 0f084cb..f388e2c 100755 --- a/Owlcat/simms/simms.py +++ b/Owlcat/simms/simms.py @@ -83,6 +83,9 @@ def toList(string,delimiter=',',f0=False): if date is None: date = '%d/%d/%d'%(time.localtime()[:3]) + if msname is None: + msname = '%s/%s_%dh%s.MS'%(outdir,label or tel,synthesis,dtime) + casa_script = tempfile.NamedTemporaryFile(suffix='.py') casa_script.write('# Auto Gen casapy script. From simms.py\n') casa_script.write('execfile("%s/casasm.py")\n'%simms_path) @@ -99,6 +102,11 @@ def toList(string,delimiter=',',f0=False): tmpfile = casa_script.name t0 = time.time() + # Log the simms command that invoked simms and add a time stamp + with open('log-simms.txt','a') as std: + ts = '%d/%d/%d %d:%d:%d'%(time.localtime()[:6]) + ran = " ".join(map(str,sys.argv)) + std.write('\n %s ::: %s\n'%(ts,ran)) process = subprocess.Popen(['casapy --nologger --log2term %s -c %s'%('--nologfile'\ if nolog else '--logfile log-simms.txt',repr(tmpfile))], stderr=subprocess.PIPE if not isinstance(sys.stderr,file) else sys.stderr,