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-23278: Clear RASTART etc headers taken before Feb 2020 #166

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions python/lsst/obs/lsst/translators/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
# RA and DEC headers are in radians until this date
RADEC_IS_RADIANS = Time("2020-01-28T22:00", format="isot", scale="utc")

# RASTART/DECSTART/RAEND/DECEND used wrong telescope location before this
RASTART_IS_BAD = Time("2020-02-01T00:00", format="isot", scale="utc")

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

Expand Down Expand Up @@ -277,6 +280,13 @@ def fix_header(cls, header):
log.debug("%s: Forcing blank RADESYS to '%s'", obsid, header["RADESYS"])
modified = True

if date < RASTART_IS_BAD:
# The wrong telescope position was used. Unsetting these will force
# the RA/DEC demand headers to be used instead.
for h in ("RASTART", "DECSTART", "RAEND", "DECEND"):
header[h] = None
log.debug("%s: Forcing derived RA/Dec headers to undefined", obsid)

return modified

def _is_on_mountain(self):
Expand Down
27 changes: 27 additions & 0 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,33 @@ def test_latiss_translator(self):
temperature=None,
visit_id=4702443654717948604,
)),
("latiss-AT_O_20200128_000379.yaml",
dict(telescope="LSSTAuxTel",
instrument="LATISS",
boresight_rotation_coord="sky",
dark_time=5.0*u.s,
detector_exposure_id=2020012800379,
detector_group="RXX",
detector_name="S00",
detector_num=0,
detector_serial="ITL-3800C-068",
exposure_id=2020012800379,
exposure_group="2020-01-29T07:25:52.166",
exposure_time=5.0*u.s,
object="HD107696",
observation_id="AT_O_20200128_000379",
observation_type="science",
physical_filter="KPNO_406_828nm",
pressure=None,
relative_humidity=None,
science_program="unknown",
temperature=None,
visit_id=1602123521660000,
# We have some timing discrepancies in the headers
# that make it hard to match the demand RA/DEC to
# the recorded AZ/EL/TIME.
wcs_params=dict(max_sep=7.),
)),
)
self.assertObservationInfoFromYaml("latiss-future.yaml", dir=self.datadir)
for filename, expected in test_data:
Expand Down