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

Make HDU number available to ingest. #90

Merged
merged 1 commit into from
Jan 10, 2017
Merged
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
5 changes: 4 additions & 1 deletion python/lsst/pipe/tasks/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def getInfo(self, filename):
break
ext = self.getExtensionName(md)
if ext in extnames:
infoList.append(self.getInfoFromMetadata(md, info=phuInfo.copy()))
hduInfo = self.getInfoFromMetadata(md, info=phuInfo.copy())
# We need the HDU number when registering MEF files.
hduInfo["hdu"] = extnum - 1
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes hdu a very special dataId key name. Have you checked if this could affect other obs packages?
I wonder if we want this to be added to some higher-level documentations.

Copy link
Member

Choose a reason for hiding this comment

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

HDU is very FITS-centric for a generic butler...

Copy link
Member Author

Choose a reason for hiding this comment

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

It does makes hdu special in that it could potentially collide with a header keyword named HDU. I haven't found any obs packages that use anything called HDU though. CFHT does a similar thing as this loop but calls it extension. There is a bit of a snag in that the normal translations can't affect this field, but I think I'd like to put that off in order to get decam not-broken in the 13.0 release.

@timj This isn't in the generic butler, it's in a task that parses FITS files.

infoList.append(hduInfo)
extnames.discard(ext)
return phuInfo, infoList

Expand Down