Skip to content

Commit

Permalink
πŸ› Do not assume keys present in metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
astrogewgaw committed Mar 26, 2024
1 parent 5683a0e commit 0729e7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/priwo/sigproc/hdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ def readhdr(f):
break
meta[key] = HDRKEYS[key].parse(fp)
meta["size"] = fp.tell()
meta["src_raj"] = float2coord(meta["src_raj"])
meta["src_dej"] = float2coord(meta["src_dej"])
ra = meta.get("src_raj", None)
dec = meta.get("src_dej", None)
if ra is not None:
meta["src_raj"] = float2coord(ra)
if dec is not None:
meta["src_dej"] = float2coord(dec)
return meta


Expand Down

0 comments on commit 0729e7e

Please sign in to comment.