FitsImage
Defined in: image/image.ts:57
A decoded image array plus the metadata needed to interpret it.
shape is in FITS axis order (NAXIS1 first, and NAXIS1 is the
fastest-varying axis on disk), and is the region’s shape when a cutout
was requested. data is row-major in that order, so the element at FITS
index (i1, i2, …) is at i1 + s1 * (i2 + s2 * (…)).
Unless { raw: true } was passed, BZERO/BSCALE are resolved as
follows:
- Scaled (
BSCALE/BZEROother than 1/0): the narrowest float that preserves the data,Float32ArrayforBITPIX8/16/-32 andFloat64Arrayfor 32/64/-64, withBLANKpixels set toNaN. - Unsigned-integer convention (
BSCALE=1andBZEROat the half range): the matching integer array with no float widening,Uint16ArrayforBITPIX16 (BZERO=2^15),Uint32Arrayfor 32,BigUint64Arrayfor 64;BITPIX8 withBZERO=-2^7is the signed-byte form and yieldsInt8Array(BITPIX8 is natively unsigned, so there is noUint8conversion). As with the no-scaling case, a declaredBLANKis exposed viablank, not masked: an integer array cannot holdNaN. - No scaling (
BSCALE=1,BZERO=0): the on-disk integer array is returned as-is; ifBLANKis declared it is exposed asblankfor the caller to mask. This is a deliberate deviation from astropy, which widens such an image tofloat32withNaNat the blanks. fits-js keeps the integers exact and does not force a float copy.
Properties
Section titled “Properties”bitpix
Section titled “bitpix”readonly bitpix: number;Defined in: image/image.ts:66
BITPIX as written in the header (8, 16, 32, 64, -32, -64).
blank?
Section titled “blank?”readonly optional blank?: number;Defined in: image/image.ts:75
BLANK (integer images only), when the header declares it.
bscale
Section titled “bscale”readonly bscale: number;Defined in: image/image.ts:67
readonly bzero: number;Defined in: image/image.ts:73
BZERO. A bigint BZERO is reported as the nearest number; the
canonical 2^63 uint64 offset is exact, an arbitrary large bigint
BZERO may not be. Use { raw: true } and the header for exactness.
readonly data: ImageArray;Defined in: image/image.ts:64
readonly shape: readonly number[];Defined in: image/image.ts:63
Axis lengths in FITS order. [] only for a header-only NAXIS=0 HDU;
a declared zero-length axis keeps its rank (e.g. [4, 0]), matching
astropy, with data empty either way.