multicolorfits.McfHeader#

class multicolorfits.McfHeader(header=None, normalize=True, force_2d=True)[source]#

A stateful wrapper around an astropy.io.fits.Header.

Parameters:
  • header (astropy.io.fits.Header, McfHeader, str, dict, or None) – Source header. None yields a minimal placeholder header.

  • normalize (bool) – Float-coerce WCS cards (force_header_floats) and integer-coerce NAXIS / WCSAXES (normalize_wcs_meta) on construction.

  • force_2d (bool) – Strip >2D structure cards (force_header_2d) when NAXIS > 2.

__init__(header=None, normalize=True, force_2d=True)[source]#

Methods

__init__([header, normalize, force_2d])

copy()

fromstring(text[, sep])

fromtextfile(path, **kwargs)

Load an McfHeader from a plain-text header file.

get(key[, default])

keys()

matches_grid(other[, rtol])

True if other shares this header's pixel grid (shape + WCS), so the two images can be combined without reprojection.

minimal_wcs_header()

A stripped-down astropy.io.fits.Header containing only the cards needed to define the pixel grid -- the celestial WCS plus NAXIS, NAXIS1 and NAXIS2.

set(*args, **kwargs)

to_frame([frame])

Return a new McfHeader describing the same sky area in a different celestial frame (wraps skyframes.convert_header_frame).

tostring([sep])

totextfile(path[, overwrite])

Write this header to a portable plain-text .hdr file.

Attributes

astropy

The underlying astropy.io.fits.Header (for the functional API).

frame

Cached celestial frame name (e.g. 'fk5', 'galactic').

is_celestial

True if the header defines a usable celestial WCS.

pixscale_asec

Pixel scale in arcsec/pixel, or None if undefined/anisotropic.

shape

Image shape (ny, nx) from NAXIS2/NAXIS1, or None.

wcs

Cached celestial astropy.wcs.WCS built from this header.