Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-39169: Correct non-numeric ROTPA values. #450

Merged
merged 1 commit into from
May 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion python/lsst/obs/lsst/translators/comCam.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
__all__ = ("LsstComCamTranslator", )

import logging
from numbers import Number

from astropy.time import Time
from .lsstCam import LsstCamTranslator
Expand Down Expand Up @@ -91,8 +92,10 @@ def fix_header(cls, header, instrument, obsid, filename=None):
-----
Fixes the following issues:

* If ComCam was in Chile, the FILTER is always empty (or unknown).
* If LSST_NUM is missing it is filled in by looking at the CCDSLOT
value and assuming that the ComCam detectors are fixed.
* If ROTPA is missing or non-numeric, it is set to 0.0.

Corrections are reported as debug level log messages.

Expand Down Expand Up @@ -131,7 +134,7 @@ def fix_header(cls, header, instrument, obsid, filename=None):
modified = True
log.debug("%s: Set LSST_NUM to %s", log_label, header["LSST_NUM"])

if "ROTPA" not in header:
if "ROTPA" not in header or not isinstance(header["ROTPA"], Number):
header["ROTPA"] = 0.0
log.warning("Missing ROTPA in header - replacing with 0.0")
modified = True
Expand Down