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-36169: merge extra hard-coded named headers in rawFormatter #423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. Some minor comments.
I did notice when looking around the code base that we have a python/lsst/obs/lsst/_fitsHeader.py
that purports to read the header. I think this was a helper function for gen2 at some point. I probably should make the formatter use that code at some point.
python/lsst/obs/lsst/rawFormatter.py
Outdated
else: | ||
base_md = merge_headers([phdu, lsst.afw.fits.readMetadata(file)], | ||
mode="overwrite") | ||
fix_header(base_md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way fix_header works is that it adds a flag to say that the header has been fixed so that subsequent calls to fix_header will be no-ops. In this case you should remove the fix_header call and leave the fixing to line 94 below. super().readMetadata()
will call fix_header
itself but we have to live with that.
This implementation does not try to read all the amplifier headers and merge them and I'm not sure why. Maybe people were worried about performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood on the fix_header
call.
On the subject of the amplifier headers, I think there is some stuff potentially of interest in there. Possibly not for this ticket.
However, the implementation of doing that would probably just look like iterating through all the HDUs and pulling stuff out, so would be different to this one. By which I mean I think if we wanted that it should be a separate issue, organisationally speaking
14899d6
to
92b6b53
Compare
In current LATISS data (and likely future comcam & LSSTCAM data), the FITS files may contain extra HDUs "REB_COND" and "CONFIG_COND", which describe some sensor state that does not make sense to be included per-amplifier. This change checks if those HDUs are present, and if they are includes them in the metadata.
7a11237
to
67ab035
Compare
In current LATISS data (and likely future comcam & LSSTCAM data), the FITS files may contain extra HDUs "REB_COND" and "CONFIG_COND", which describe some sensor state that does not make sense to be included per-amplifier. This change checks if those HDUs are present, and if they are includes them in the metadata.