FitsOpaqueMetadata#

final class lsst.images.fits.FitsOpaqueMetadata(headers=<factory>, precompressed=<factory>)#

Bases: OpaqueArchiveMetadata

Opaque 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.

Parameters:

Methods Summary

add_cutdown_primary_header(header)

Add the primary header of a cut-down lsst.images FITS file as opaque metadata.

add_header(header[, name, ver, key])

Add a header to the opaque metadata if it is not already present, and strip EXTNAME, EXTVER, and DATE 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, stripping cards we know we don't need and extracting any LSST IMAGES ... cards into a dictionary we return.

get_instrumental_unit()

Extract the LSST ISR UNIT key from the primary header (if it exists) and wrap it with Astropy.

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_cutdown_primary_header(header)#

Add the primary header of a cut-down lsst.images FITS file as opaque metadata.

A cut-down file is one whose JSON-tree, index, and nested-archive HDUs have been dropped, leaving only the primary, image, mask, and variance HDUs (e.g. as written by dax_images_cutout). Only the container-layout cards that would be misleading after re-serialization are stripped; all other cards are retained so they survive the round trip.

Parameters:

header (Header) – Primary header to read. Not modified.

Return type:

None

add_header(header, name=None, ver=None, key=None)#

Add a header to the opaque metadata if it is not already present, and strip EXTNAME, EXTVER, and DATE if present.

Parameters:
  • header (Header) – Header to add. May be modified in place.

  • name (str | None, default: None) – EXTNAME (all caps). If not provided, the EXTNAME card must be present in the header. Use "" for the primary header.

  • ver (int | None, default: None) – EXTVER. If not provided and the EXTVER card is not present, defaults to 1.

  • key (ExtensionKey | None, default: None) – Combination of EXTNAME and EXTVER; used instead of both name and ver if provided.

Return type:

None

copy()#

Copy, reference, or discard metadata when its holding object is copied.

Return type:

FitsOpaqueMetadata

extract_legacy_primary_header(header)#

Update the opaque metadata with the header of the primary HDU of a legacy (lsst.afw.image) FITS file, stripping cards we know we don’t need and extracting any LSST IMAGES ... cards into a dictionary we return.

Parameters:

header (Header) – Primary HDU header of the legacy FITS file.

Return type:

dict[str, Any]

get_instrumental_unit()#

Extract the LSST ISR UNIT key from the primary header (if it exists) and wrap it with Astropy.

Return type:

UnitBase | None

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.

Parameters:

name (str) – EXTNAME (all caps).

Returns:

An already-compressed HDU, in binary table form, or None if there is no precompressed HDU for this EXTNAME.

Return type:

astropy.io.fits.BinTableHDU | None

subset(bbox)#

Copy, reference, or discard metadata when a subset of its its holding object is extracted.

Parameters:

bbox (Box) – Bounding box of the subset being extracted.

Return type:

FitsOpaqueMetadata

This page was last modified on .