Skip to content

Commit

Permalink
Canonicalize instrument name.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Jun 26, 2024
1 parent 23b793d commit 01e52ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion src/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01e52ad

Please sign in to comment.