FitsOpaqueMetadata#
- final class lsst.images.fits.FitsOpaqueMetadata(headers: dict[~lsst.images.fits._common.ExtensionKey, ~astropy.io.fits.header.Header] = <factory>, precompressed: dict[str, ~lsst.images.fits._common.PrecompressedImage] = <factory>)#
Bases:
OpaqueArchiveMetadataOpaque metadata that may be carried around by a serializable type to propagate serialization options and opaque information without that type knowing how it was serialized.
Methods Summary
add_header(header[, name, ver, key])Add a header to the opaque metadata if it is not already present, and strip EXTNAME and EXTVER if present.
copy()Copy, reference, or discard metadata when its holding object is copied.
extract_legacy_primary_header(header)Update the opaque metadata with the header of the primary HDU of a legacy (
lsst.afw.image) FITS file.maybe_use_precompressed(name)Look up the given EXTNAME to see if there is a tile compressed image HDU that should be used directly, instead of requantizing.
subset(bbox)Copy, reference, or discard metadata when a subset of its its holding object is extracted.
Methods Documentation
- add_header(header: Header, name: str | None = None, ver: int | None = None, key: ExtensionKey | None = None) None#
Add a header to the opaque metadata if it is not already present, and strip EXTNAME and EXTVER if present.
Parameters#
- header
Header to add. May be modified in place.
- name
EXTNAME (all caps). If not provided, the EXTNAME card must be present in the header. Use
""for the primary header.- ver
EXTVER. If not provided and the EXTVER card is not present, defaults to 1.
- key
Combination of EXTNAME and EXTVER; used instead of both
nameandverif provided.
- copy() FitsOpaqueMetadata#
Copy, reference, or discard metadata when its holding object is copied.
- extract_legacy_primary_header(header: Header) None#
Update the opaque metadata with the header of the primary HDU of a legacy (
lsst.afw.image) FITS file.
- maybe_use_precompressed(name: str) BinTableHDU | None#
Look up the given EXTNAME to see if there is a tile compressed image HDU that should be used directly, instead of requantizing.
Parameters#
- name
EXTNAME (all caps).
Returns#
astropy.io.fits.BinTableHDU|NoneAn already-compressed HDU, in binary table form, or
Noneif there is no precompressed HDU for this EXTNAME.
- subset(bbox: Box) FitsOpaqueMetadata#
Copy, reference, or discard metadata when a subset of its its holding object is extracted.