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

Use HDU in instcal templates instead of ccdnum. #41

Merged
merged 1 commit into from Jan 10, 2017
Merged

Conversation

ctslater
Copy link
Member

@ctslater ctslater commented Jan 3, 2017

Since an HDU's position in an instcal file does not necessarily correspond to
its CCD number, this template had been mislabling CCDs.

Also removes special handling of decam raw files that was required to track the
hdu field. This code was largely a duplication of the pipe_tasks ingest task,
and can be alleviated with the minor changes to that task (also implemented on
this ticket.)

infoList.append(info)
extnames.discard(ext)
phuInfo, infoList = super(DecamParseTask, self).getInfo(filename)
for idx, info in enumerate(infoList):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for info in infoList ?

@@ -160,6 +159,7 @@ def getInfo(self, filename, filetype="raw"):
info[self.instcalPrefix] = self.expnumMapper[expnum][self.instcalPrefix]
info[self.dqmaskPrefix] = self.expnumMapper[expnum][self.dqmaskPrefix]
info[self.wtmapPrefix] = self.expnumMapper[expnum][self.wtmapPrefix]

elif filetype == "raw":
md = afwImage.readMetadata(filename, self.config.hdu)
phuInfo = self.getInfoFromMetadata(md)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove the two lines above, and move the following six lines to after line 172 (the call to the base method)?

@@ -68,7 +68,8 @@ def __init__(self, inputPolicy=None, **kwargs):
# The data ID key ccdnum is not directly used in the current policy
# template of the raw dataset, so is not in its keyDict automatically.
# Add it so raw dataset know about the data ID key ccdnum.
self.mappings["raw"].keyDict.update({'ccdnum': int})
for datasetType in ("raw", "instcal", "dqmask", "wtmap"):
self.mappings[datasetType].keyDict.update({'ccdnum': int})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May you please update the comments above these lines as well?

Since an HDU's position in an instcal file does not necessarily correspond to
its CCD number, this template had been mislabling CCDs.

Also removes special handling of decam raw files that was required to track the
hdu field. This code was largely a duplication of the pipe_tasks ingest task,
and can be alleviated with the minor changes to that task (also implemented on
this ticket.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants