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

DM-36169: merge extra hard-coded named headers in rawFormatter #423

Merged
merged 1 commit into from Sep 16, 2022

Conversation

weatherhead99
Copy link
Contributor

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.

Copy link
Member

@timj timj left a 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.

else:
base_md = merge_headers([phdu, lsst.afw.fits.readMetadata(file)],
mode="overwrite")
fix_header(base_md)
Copy link
Member

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.

Copy link
Contributor Author

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

python/lsst/obs/lsst/rawFormatter.py Outdated Show resolved Hide resolved
python/lsst/obs/lsst/rawFormatter.py Outdated Show resolved Hide resolved
python/lsst/obs/lsst/rawFormatter.py Outdated Show resolved Hide resolved
python/lsst/obs/lsst/rawFormatter.py Show resolved Hide resolved
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants