diff --git a/nuance/utils.py b/nuance/utils.py index 711f95a..2f773cb 100644 --- a/nuance/utils.py +++ b/nuance/utils.py @@ -13,11 +13,11 @@ def interp_split_times(time, p, dphi=0.01): # since for very small periods we might fold on few points only, it's better to impose # at least 200 phases, to compare period folds more fairly phase = np.arange(0, 1, np.min([1 / 200, dphi / p])) - n = np.arange(np.ceil(total / p)) # number of 'folds' + n = np.arange(np.ceil(total / p) + 1) # number of 'folds' # this line is important so that different time-series have the same phase 0 tmin -= tmin % p pt0s = np.array([tmin + phase * p + j * p for j in n]) # corresponding t0s - has_time = np.any([np.abs(time - _t0) % p < p / 2 for _t0 in pt0s.mean(1)], 1) + has_time = np.any([np.abs(time - _t0) < p / 2 for _t0 in pt0s.mean(1)], 1) pt0s = pt0s[has_time] return pt0s diff --git a/pyproject.toml b/pyproject.toml index 506fdeb..d261742 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nuance" -version = "0.5.1" +version = "0.5.2" description = "Transit signals detection among correlated noises" authors = ["Lionel Garcia"] license = "MIT"