Skip to content

Commit

Permalink
Merge pull request #170 from StingraySoftware/improve_accelsearch
Browse files Browse the repository at this point in the history
Filter clearly bad candidates (the ones compatible with 0)
  • Loading branch information
matteobachetti authored Jan 29, 2025
2 parents 78ba748 + b5a2253 commit 73e9ff7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hendrics/efsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,19 @@ def fft_rescale(fourier_trans):
candidate_file=outfile.replace(".csv", ""),
)

bad_pos = (results["frequency"] + results["fdot"] * results["length"]) < results[
"frequency"
] * 0.1
bad_neg = (results["frequency"] - results["fdot"] * results["length"]) < results[
"frequency"
] * 0.1
bad = bad_pos | bad_neg
if np.any(bad):
warnings.warn(
"Some candidates would have negative frequency over the length of the observations"
)
results = results[~bad]

if len(results) > 0:
results["emin"] = emin if emin else -1.0
results["emax"] = emax if emax else -1.0
Expand Down

0 comments on commit 73e9ff7

Please sign in to comment.