Skip to content

Commit

Permalink
Standardize how Gen3 ingest uses DecamTranslator
Browse files Browse the repository at this point in the history
Gen2 ingest also uses the translator by calling pipe_tasks' IngestTask
  • Loading branch information
mrawls committed Nov 20, 2020
1 parent fbf216c commit 83bc7ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/lsst/obs/decam/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class DecamParseTask(ParseTask):
put the file in the correct location and populate the registry.
"""

_translatorClass = DecamTranslator

def __init__(self, *args, **kwargs):
super(ParseTask, self).__init__(*args, **kwargs)

Expand All @@ -133,10 +135,10 @@ def _listdir(self, path, prefix):
for file in os.listdir(path):
fileName = os.path.join(path, file)
md = readMetadata(fileName)
fix_header(md, translator_class=DecamTranslator)
if "EXPNUM" not in md.names():
fix_header(md, translator_class=self._translatorClass)
if "EXPNUM" not in md:
return
expnum = md.getScalar("EXPNUM")
expnum = md["EXPNUM"]
if expnum not in self.expnumMapper:
self.expnumMapper[expnum] = {self.instcalPrefix: None,
self.wtmapPrefix: None,
Expand Down

0 comments on commit 83bc7ef

Please sign in to comment.