diff --git a/ampel/lsst/ingest/LSSTDataPointShaper.py b/ampel/lsst/ingest/LSSTDataPointShaper.py index 74563b0..3aa366e 100755 --- a/ampel/lsst/ingest/LSSTDataPointShaper.py +++ b/ampel/lsst/ingest/LSSTDataPointShaper.py @@ -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( @@ -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"]) ]