From ee7e62051de72b3856a03b6bf0f954a90c94cce3 Mon Sep 17 00:00:00 2001 From: Scott Ransom Date: Thu, 5 Jan 2012 17:27:43 -0500 Subject: [PATCH] Fixed timing check to allow tiny but non-zero values --- lib/python/prepfold.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/python/prepfold.py b/lib/python/prepfold.py index 84e2fa6bc..b5f65629a 100644 --- a/lib/python/prepfold.py +++ b/lib/python/prepfold.py @@ -272,6 +272,7 @@ def freq_offsets(self, p=None, pd=None, pdd=None): # Get frequency and frequency derivative offsets f_diff = bestf - foldf fd_diff = bestfd - foldfd + print bestfd, foldfd # bestpdd=0.0 only if there was no searching over pdd if bestpdd != 0.0: fdd_diff = bestfdd - foldfdd @@ -293,7 +294,7 @@ def use_for_timing(self): with it. """ # If any of the offsets are non-zero, then prepfold searched - if any(self.freq_offsets()): + if max(Num.fabs(Num.asarray(self.freq_offsets()))) > 2e-16: return False else: return True