Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filtering by forcediffimfluxunc too #443

Merged
merged 3 commits into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions prv_candidates_step/prv_candidates_step/core/strategy/ztf.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,19 @@ def extract_detections_and_non_detections(alert: dict) -> dict:
# potencial bugs from ztf
def filter_fp(fp):
forcediffimflux_bad_values = [None, 0]
forcediffimfluxunc_bad_values = [None, 0]
# if the value is not close to -99999 return true
good_fp = fp[
good_fp_flux = fp[
"forcediffimflux"
] not in forcediffimflux_bad_values and not np.isclose(
fp["forcediffimflux"], -99999
)
return good_fp
good_fp_fluxunc = fp[
"forcediffimfluxunc"
] not in forcediffimflux_bad_values and not np.isclose(
fp["forcediffimfluxunc"], -99999
)
return good_fp_flux and good_fp_fluxunc

# use the filter funcion to remove bad fp
forced_photometries = list(filter(filter_fp, forced_photometries))
Expand Down
Loading