From 2293b425773fed40a0ec2f1f25cff574594e60c1 Mon Sep 17 00:00:00 2001 From: sphemakh Date: Sat, 12 Jan 2019 12:18:20 +0200 Subject: [PATCH 1/2] Fixes #49 --- CHANGES.md | 3 +++ simms/__init__.py | 2 +- simms/casasm.py | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index fb3d10e..a8040dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,3 +11,6 @@ Changes since 0.6.0 # 1.0.3 - Fix interface to when auto-setting VLA configurations. + +# 1.0.7 +- Fix synthesis time when scan_legth is a scalar diff --git a/simms/__init__.py b/simms/__init__.py index 382021f..9e604c0 100644 --- a/simms/__init__.py +++ b/simms/__init__.py @@ -1 +1 @@ -__version__ = "1.0.6" +__version__ = "1.0.7" diff --git a/simms/casasm.py b/simms/casasm.py index fed3094..b7786d8 100644 --- a/simms/casasm.py +++ b/simms/casasm.py @@ -174,6 +174,12 @@ def toFloat(val): nscans = 0 synthesis *= 3600 + + if nscans == 1 and scan_length[0] < synthesis: + nscans = np.int( np.ceil( synthesis/scan_length[0] ) ) + scan_length = scan_length*(nscans -0) + + if ndir>=1: # if scan legth is not set, set it to equal the synthesis time if nscans == 0: From 02b48788229067d4ec3aaa9702a8a855ddfc42d8 Mon Sep 17 00:00:00 2001 From: sphemakh Date: Sat, 12 Jan 2019 14:28:20 +0200 Subject: [PATCH 2/2] Remove uncessary flag check --- simms/casasm.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/simms/casasm.py b/simms/casasm.py index b7786d8..4fb8665 100644 --- a/simms/casasm.py +++ b/simms/casasm.py @@ -173,12 +173,14 @@ def toFloat(val): else: nscans = 0 + synthesis *= 3600 if nscans == 1 and scan_length[0] < synthesis: nscans = np.int( np.ceil( synthesis/scan_length[0] ) ) - scan_length = scan_length*(nscans -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 @@ -239,16 +241,6 @@ def toFloat(val): 'Double check you settings. If you feel this ' 'is due a to bug, raise an issue on https://github.com/SpheMakh/simms') - # Clear all flags if limits were not set - if not setlimits: - tb.open(msname, nomodify=False) - flags = tb.getcol("FLAG") - if flags.sum() > 0: - flags[...] = False - tb.putcol("FLAG", flags) - tb.close() - - if validate(msname): return msname else: