Skip to content

Commit

Permalink
Merge pull request #79 from lsst/tickets/DM-17837
Browse files Browse the repository at this point in the history
DM-17837: Fix typo in RTM-004_S20 detector serial
  • Loading branch information
timj committed Feb 13, 2019
2 parents 84ca5e5 + 2b2e4b5 commit c08874c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
3 changes: 0 additions & 3 deletions config/ts8/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

config.parse.retarget(Ts8ParseTask)

# what used to be config.parse.translation = {
config.parse.translation['wavelength'] = 'MONOWL'

# what used to be config.parse.translators = {
del config.parse.translators['snap']
config.parse.translators['dayObs'] = 'translate_dayObs'
Expand Down
2 changes: 1 addition & 1 deletion policy/ts8/RTM-004.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RTM-004 :
S10 : ITL-3800C-346
S11 : ITL-3800C-062
S12 : ITL-3800C-371
S20 : ITL-3800C-285
S20 : ITL-3800C-385
S21 : ITL-3800C-424
S22 : ITL-3800C-247

Expand Down
9 changes: 6 additions & 3 deletions python/lsst/obs/lsst/translators/lsst.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def read_detector_ids(policyFile):
"""

file = os.path.join(obs_lsst_packageDir, policyFile)
with open(file) as fh:
# Use the fast parser since these files are large
camera = yaml.load(fh, Loader=yaml.CLoader)
try:
with open(file) as fh:
# Use the fast parser since these files are large
camera = yaml.load(fh, Loader=yaml.CLoader)
except OSError as e:
raise ValueError(f"Could not load camera policy file {file}") from e

mapping = {}
for ccd, value in camera["CCDs"].items():
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/obs/lsst/translators/lsstsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def compute_detector_info_from_serial(cls, detector_serial):
if detector_serial in serial_mapping:
info = serial_mapping[detector_serial]
else:
log.warning(f"Unable to determine detector information from detector serial {detector_serial}")
raise RuntimeError("Unable to determine detector information from detector serial"
f" {detector_serial}")

return info

Expand Down
12 changes: 10 additions & 2 deletions python/lsst/obs/lsst/translators/ts8.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ def can_translate(cls, header, filename=None):
return True

if "LSST_NUM" in header and "REBNAME" in header and \
"CONTNUM" in header and header["CONTNUM"] == "000018910e0c":
"CONTNUM" in header and \
header["CONTNUM"] in ("000018910e0c", "000018ee33b7", "000018ee0f35", "000018ee3b40",
"00001891fcc7", "000018edfd65", "0000123b5ba8", "000018911b05",
"00001891fa3e", "000018910d7f", "000018ed9f12", "000018edf4a7",
"000018ee34e6", "000018ef1464", "000018eda120", "000018edf8a2",
"000018ef3819", "000018ed9486", "000018ee02c8", "000018edfb24",
"000018ee34c0", "000018edfb51", "0000123b51d1", "0000123b5862",
"0000123b8ca9", "0000189208fa", "0000189111af", "0000189126e1",
"000018ee0618", "000018ee3b78", "000018ef1534"):
return True

return False
Expand Down Expand Up @@ -143,7 +151,7 @@ def to_instrument(self):
instrume : `str`
Name of the test stand.
"""
return f"LSST-TS8"
return "LSST-TS8"

@cache_translation
def to_datetime_begin(self):
Expand Down

0 comments on commit c08874c

Please sign in to comment.