Skip to content

Commit

Permalink
fix: the t0s grid again
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrcia committed Feb 6, 2024
1 parent c09d943 commit e3d6ced
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nuance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit e3d6ced

Please sign in to comment.