Changelog
The fits-core changelog lives alongside the source:
GitHub release · Latest
References: #4 · #6 · #7 · #8 · #11 · #12 · 26916cd · 74e8422 · a1ec3a0 · 853b19a · 1783b56 · 8f15e80
- Header parsing:
parseHeader(bytes): fixed and free-format cards into aFitsHeader, reportingbyteLength,endFound, and recovered violations onwarnings- Typed values: logical, integer, float including the Fortran
Dexponent, complex, string with quote escaping CONTINUElong strings andHIERARCHkeywords including the ESO dialectFitsHeaderaccessorsget,getAll,getString,getNumber,getBoolean,comments,history; big integers come back exact asbigint- Lenient by default, matching astropy tolerance on real archive headers;
{ strict: true }rejects standard violations - HDU enumeration:
readHdus(bytes): walk every Header-Data Unit, locating and sizing each data unit from its keywords per the FITS size formulafindHdu(hdus, name, version?): lookup byEXTNAME/EXTVER; an absentEXTVERmatches version 1- Primary,
IMAGE,BINTABLE(including theA3DTABLEalias), and ASCIITABLErecognized; unknown conforming extensions are skipped so later HDUs stay reachable - Structural keywords are domain-validated; a missing or out-of-domain value stops enumeration with a warning and
dataSizeKnown: false(lenient) or throwsFitsStructureError(strict), rather than desyncing later offsets - Empty, shorter-than-one-block, or all-zero input reports
no HDUsonwarnings(lenient) or throws (strict);SIMPLE = Fis surfaced as a warning in both modes - Random groups rejected with
FitsUnsupportedError readImage(hdu, reader, opts?): decode the pixels of a primary orIMAGEHDU through any reader:- Every
BITPIX(8/16/32/64/-32/-64), decoded from FITS big-endian into the matching typed array - astropy-parity
BZERO/BSCALE: a scaled image widens to the narrowest float that preserves it, withBLANKasNaN; the unsigned-integer convention yieldsUint16/Uint32/BigUint64(andInt8for the signed-byte form) - Unscaled integer images stay integer with
BLANKexposed asblank, a documented deviation from astropy - N-dimensional cubes; a
{ region }rectangular cutout fetches only the bytes the region spans { raw: true }returns the on-disk array; anAbortSignalcancels the read- Tile-compressed images (
ZIMAGE = T) reject withFitsUnsupportedErrornaming the algorithm, not a malformed-file error - Adds the
FitsImage,ImageArray,ImageRegion, andReadImageOptionstypes - The
RandomAccessReaderbyte-source abstraction, one parser over any source: BytesReader(in-memory) andBlobReader(browserBlob/File)NodeFileReader(Node/Bun/Deno): async factory taking a path orURL, dynamicnode:fs/promisesimport so importing the barrel stays browser-safeHttpRangeReader(HTTPRange): LRU page cache, request coalescing,If-Rangevalidators, short-206follow-up, whole-body fallback when the server ignoresRange, injectablefetch,AbortSignal- Failures are typed: request, HTTP-status, and mid-stream body errors all throw
FitsIoErrorcarryingurl/status/offsetand the underlying cause openFitsacceptssignal?: AbortSignal, checked before every block read. A header without anENDcard reportsdataSizeKnown: false, soreadImagerefuses the declared data unit of a malformed header.openFits(reader): lazy HDU enumeration over any byte source:- Only header blocks are read; each data unit is sized from its keywords and seeked past, never fetched, so a remote file enumerates without materializing it and a later
readImagecutout fetches only its region - Same sizing, classification, and strict/lenient code as
readHdus, so well-formed files enumerate identically maxHeaderBlocks(default 1000) bounds a malformed source that never emitsEND