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-35460: Add programatic fixup for OBJECT starting with 'spec:' #407

Merged
merged 1 commit into from
Jul 6, 2022
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
8 changes: 8 additions & 0 deletions python/lsst/obs/lsst/translators/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
ROTPA_CONVENTION_180_SWITCH1 = Time("2020-11-19T00:00", format="isot", scale="utc")
ROTPA_CONVENTION_180_SWITCH2 = Time("2021-10-29T00:00", format="isot", scale="utc")

# TARGET is set to start with 'spec:' for dispsered images before this date
TARGET_STARTS_SPECCOLON = Time("2022-07-10T00:00", format="isot", scale="utc")

# Scaling factor radians to degrees. Keep it simple.
RAD2DEG = 180.0 / math.pi

Expand Down Expand Up @@ -360,6 +363,11 @@ def fix_header(cls, header, instrument, obsid, filename=None):
header["OBJECT"] = "NOTSET"
modified = True

if date < TARGET_STARTS_SPECCOLON:
if "OBJECT" in header:
header["OBJECT"] = header['OBJECT'].replace('spec:', '')
modified = True

if "RADESYS" in header:
if header["RADESYS"] == "":
# Default to ICRS
Expand Down