Skip to content

Commit

Permalink
Merge pull request #442 from alercebroker/fix/remove_bad_fp
Browse files Browse the repository at this point in the history
Fix/remove bad fp
  • Loading branch information
AlxEnashi authored May 30, 2024
2 parents c602aef + 1bca0fb commit c7743f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/production_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ jobs:
poetry run python main.py deploy add-package correction-step --chart=correction-step --values=correction_step-helm-values --chart-folder=correction_step
poetry run python main.py deploy add-package early-classifier-step --chart=early-classifier --values=early_classification_step-helm-values --chart-folder=early_classification_step
# feature step from main
poetry run python main.py deploy add-package feature-step --chart=feature-step --values=feature_step-helm-values --chart-folder=feature_step
# poetry run python main.py deploy add-package feature-step --chart=feature-step --values=feature_step-helm-values --chart-folder=feature_step
# feature step freezed 23.x version
poetry run python main.py deploy add-package feature-step-23.x --chart=feature-step --values=feature_step-helm-values:13 --chart-folder=feature_step
poetry run python main.py deploy add-package lc-classifier-step --chart=lc-classifier-step --values=lc_classification_step_ztf-helm-values --chart-folder=lc_classification_step
Expand Down
15 changes: 15 additions & 0 deletions prv_candidates_step/prv_candidates_step/core/strategy/ztf.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@ def extract_detections_and_non_detections(alert: dict) -> dict:
pickle.loads(forced_photometries) if forced_photometries else []
)

# filter forced photometry by value
# potencial bugs from ztf
def filter_fp(fp):
forcediffimflux_bad_values = [None, 0]
# if the value is not close to -99999 return true
good_fp = fp[
"forcediffimflux"
] not in forcediffimflux_bad_values and not np.isclose(
fp["forcediffimflux"], -99999
)
return good_fp

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

acopy = copy.deepcopy(alert)
detections = [acopy]
non_detections = []
Expand Down

0 comments on commit c7743f0

Please sign in to comment.