Skip to content

Commit

Permalink
Merge pull request #407 from lsst/tickets/DM-35460
Browse files Browse the repository at this point in the history
DM-35460: Add programatic fixup for OBJECT starting with 'spec:'
  • Loading branch information
mfisherlevine committed Jul 6, 2022
2 parents 423dd17 + 5c61cd6 commit 426fd26
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 426fd26

Please sign in to comment.