diff --git a/src/ingest.py b/src/ingest.py index 42a1d93..7780906 100644 --- a/src/ingest.py +++ b/src/ingest.py @@ -164,6 +164,16 @@ def record_groups(resources: list[ResourcePath]) -> None: logger.exception("Error reading header for %s", res) try: instrument = header["INSTRUME"] + # Canonicalize instrument name + match instrument.lower(): + case "lsstcomcamsim" | "comcamsim": + instrument = "LSSTComCamSim" + case "lsstcomcam" | "comcam": + instrument = "LSSTComCam" + case "lsstcam": + instrument = "LSSTCam" + case "latiss": + instrument = "LATISS" groupid = header["GROUPID"] snap_number = int(header["CURINDEX"]) - 1 detector = header["RAFTBAY"] + "_" + header["CCDSLOT"] diff --git a/src/presence.py b/src/presence.py index 77607e0..1cc99fc 100644 --- a/src/presence.py +++ b/src/presence.py @@ -66,7 +66,7 @@ def presence(instrument: str, group_name: str, snap_index: int, detector_name: s return ({"error": True, "message": f"Unrecognized detector name {detector_name}"}, 400) key = f"GROUP:{instrument}:{group_name}:{snap_index}:{detector_name}" result = r.get(key) - if result: + if result is not None: logger.info(f"Found key {key}") if delete_seen: r.delete(key)