ztforce.image

ZTFImage: FITS loading, WCS, and pixel/sky coordinate transforms.

Attributes

_ZTF_GAIN_PER_FRAME

Classes

ZTFImage

Lazy-loading wrapper around a single ZTF science FITS image.

Module Contents

_ZTF_GAIN_PER_FRAME = 5.8[source]
class ZTFImage(fits_fpath: str, band: str, config: ztforce.config.ZTForceConfig)[source]

Lazy-loading wrapper around a single ZTF science FITS image.

_fpath[source]
band[source]
_config[source]
_header: astropy.io.fits.Header | None = None[source]
_data: numpy.ndarray | None = None[source]
_wcs: astropy.wcs.WCS | None = None[source]
_nan_mask: numpy.ndarray | None = None[source]
property header: astropy.io.fits.Header[source]

FITS primary header.

property data: numpy.ndarray[source]

Image array as a native-endian float64.

_load_fits() None[source]
property cutout_origin: tuple[float, float][source]

Pixel offset (x0, y0) of this cutout’s origin within the full quadrant.

IRSA IBE cutouts include LTV1/LTV2 header keywords following the IRAF convention where LTV is the negative of the cutout’s 0-indexed starting pixel: x_full = x_cutout - LTV1. Returns (0.0, 0.0) for full images.

property gain: float[source]

Effective gain in e-/ADU.

property fwhm: float[source]

Median PSF FWHM in pixels from header.

property zero_point: float[source]

AB photometric zero-point from header (MAGZP).

Calibrated against PanSTARRS DR1 by the ZTF pipeline (Masci et al. 2019, PASP, 131, 018003).

property obs_jd: float[source]

Observation Julian date.

property mag_limit: float | None[source]

5-sigma limiting magnitude from header, if present.

property wcs: astropy.wcs.WCS[source]

Astropy WCS built from the image header.

sky_to_pixel(coord: astropy.coordinates.SkyCoord) tuple[float, float][source]

Return (x, y) pixel position within this image (cutout-local).

sky_to_full_quadrant_pixel(coord: astropy.coordinates.SkyCoord) tuple[float, float][source]

Return (x, y) in full-quadrant pixel coordinates.

Required for the spatially-varying DAOPhot PSF model, whose polynomial coefficients are indexed to the full quadrant, not the cutout. Identical to sky_to_pixel when the image is a full quadrant download.

pixel_to_sky(x: float, y: float) astropy.coordinates.SkyCoord[source]

Return a SkyCoord for pixel position (x, y).

footprint() tuple[tuple[float, float], tuple[float, float]][source]

Return ((ra_min, ra_max), (dec_min, dec_max)) of the image footprint.

property nan_mask: numpy.ndarray[source]

True where pixel is NaN.

Type:

Boolean mask