Skip to content
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
15 changes: 6 additions & 9 deletions ampel/lsst/ingest/LSSTDataPointShaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,21 @@ def process( # type: ignore[override]
Non detection limit don't have an identifier.
"""

id = hash_payload(
encode(dict(sorted(photo_dict.items()))),
size=-self.digest_size * 8,
)
if "diaSourceId" in photo_dict:
id = photo_dict["diaSourceId"]
tags.append("LSST_DP")
sourceid_list.add(id)
sourceid_list.add(photo_dict["diaSourceId"])
elif "diaForcedSourceId" in photo_dict:
id = photo_dict["diaForcedSourceId"]
tags.append("LSST_FP")
elif "diaObjectId" in photo_dict: # DiaObject
# diaObjectId is also used in (prv)diaSource and diaForcedPhotometry
# if other fields are added, check if they contain diaObjectId
id = photo_dict["diaObjectId"]
tags.append("LSST_OBJ")
else:
# Nondetection Limit
id = hash_payload(
encode(dict(sorted(photo_dict.items()))),
size=-self.digest_size * 8,
)
tags.append("LSST_ND")
print("OOOOOO do we have upper limits?")
ret_list.append(
Expand All @@ -79,5 +76,5 @@ def process( # type: ignore[override]
return [
dp
for dp in ret_list
if not (dp["id"] in sourceid_list and "LSST_FP" in dp["tag"])
if not (dp["body"].get("diaForcedSourceId") in sourceid_list and "LSST_FP" in dp["tag"])
]