Skip to content

Commit

Permalink
Merge pull request #295 from lsst/tickets/DM-29187
Browse files Browse the repository at this point in the history
DM-29187: Do not fix RASTART header for LATISS after 2021-02-12
  • Loading branch information
timj committed Mar 18, 2021
2 parents 71a6537 + a5bb829 commit 0bee64f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions python/lsst/obs/lsst/translators/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
# instead of degrees.
RASTART_IS_HOURS = Time("2021-02-11T18:45", format="isot", scale="utc")

# From this date RASTART is correct as-is.
RASTART_IS_OKAY = Time("2021-02-12T00:00", format="isot", scale="utc")

# DATE-END is not to be trusted before this date
DATE_END_IS_BAD = Time("2020-02-01T00:00", format="isot", scale="utc")

Expand Down Expand Up @@ -378,9 +381,9 @@ def fix_header(cls, header, instrument, obsid, filename=None):
modified = True

# RASTART/END headers have a TAI/UTC confusion causing an offset
# of 37 seconds. Once this is fixed in the acquisition system
# the correction will have an upper date bound.
if date > RASTART_IS_BAD:
# of 37 seconds for a period of time.
if RASTART_IS_BAD < date < RASTART_IS_OKAY:
modified = True
offset = (37.0 / 3600.0) * 15.0
for epoch in ("START", "END"):
h = "RA" + epoch
Expand Down
5 changes: 3 additions & 2 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,14 +852,15 @@ def test_fix_header(self):
# Not all headers are used in metadata translation
test_data = (
("latiss-AT_O_20210212_000006.yaml",
dict(RASTART=260.1785517385836)),
dict(RASTART=260.024385071917)),
("latiss-AT_O_20210210_000011.yaml",
dict(RASTART=355.41750341182313)),
)
for filename, expected in test_data:
with self.subTest(f"Testing {filename}"):
header = read_test_file(filename, dir=self.datadir)
fix_header(header)
modified = fix_header(header)
self.assertTrue(modified)
for k, v in expected.items():
self.assertEqual(header[k], v, f"Testing {k} in {filename}")

Expand Down

0 comments on commit 0bee64f

Please sign in to comment.