Repository navigation
FITS files read from .fits.gz, .fz and extension HDUs (PR #5), a public header reader that follows Athenaeum's
catalog rules, and a Moffat profile with the caller's own beta. No pixel of a plain FITS or XISF file decodes
differently, and MEASURE_VERSION stays 8; the XISF header values that read differently are listed under Changed.
Changed
- The header values rustafits decides by are read by Athenaeum's catalog reader, as the new
headermodule ports
it: the FITS reader'sXBAYROFF/YBAYROFF, the XISF reader's Bayer offsets,star_measure::raw'sBITPIX/
BZERO/BSCALE/DATAMAX/EGAINandrustafits info --facts; the crate-private copy of the older Analysis
rules (formats::stored_keys) is gone. A Bayer offset is read as the catalog'sframes.xbayroff/ybayroff
columns are, so the render, the Analysis and the catalog agree. The built-in and-kcolumns ofrustafits info
and--all/--jsonare unchanged: they list the decode's own keywords. What reads differently after the
switch, for library users:- FITS: nothing. A FITS file's
BITPIX/BZERO/BSCALE/DATAMAX/EGAINand its offsets are read on the
key as written, the first card winning, as before (HIERARCH egainis still notEGAIN). On 38,691 real FITS and
XISF files (an Athenaeum catalog and the test folders) no number or fold moves. - XISF,
DATAMAX/EGAIN/ offsets: the last<FITSKeyword>of a name wins (was the first non-empty one, so an
empty value after a real one now hides it); a value
is read as written, so a/ commentafter a number makes it no number (XBAYROFF = 1 / offis 0,
EGAIN = 1.5 / e-/ADUandDATAMAX = 0.9 / saturationare absent); a Fortran exponent such as1.5D0is read
forDATAMAX/EGAINand is no number for an offset;1.5'(a stray quote) is no number; an offset's fraction
is cut, not rounded (0.6is 0, was 1); an infinite offset (inf) is now odd, so it folds (was 0); a value that
holds a<FITSKeyword>element is no second keyword (the offset it names is absent, the pattern unshifted). - XISF, the Bayer offsets only: the name is the one written (
XBAYROFFandxbayroffare notXBAYROFF);
DATAMAX/EGAINnames are still trimmed and upper-cased. - An XISF header with no
<?xmldeclaration or no</xisf>has noDATAMAX/EGAINand no offsets (a warning
names the file);read_header_key_mapandread_frame_factsrefuse such a file, as Athenaeum's catalog does.
The XISF header is read up to 64 MB there (the pixel reader allows 100 MB). - A gzipped, tile-compressed or extension-HDU FITS file is read by its logical header, the header the pixel reader
decodes. The catalog reads the primary header of a.fitswith an image extension, so for that class a fact here
and the catalog's column can differ.
- FITS: nothing. A FITS file's
Added
header(public):header_text,header_key_map/read_header_key_mapandHeaderKeyMap,
resolve_default,read_frame_factsandFrameFacts(the facts of a frame as the catalog's scanner reads them,
serdewith camelCase names;FrameFacts,HeaderField,HeaderValueandHeaderFormatare
#[non_exhaustive], and aFrameFactsdocument missing a later field decodes).rustafits info --factsprints
one JSON object per line, thefileas given first, then theFrameFactsfields (a file that cannot be read gives
{"file": …, "error": …}); thecli
feature now also enablesserdeand an optionalserde_json.- FITS: gzipped, tile-compressed and extension-HDU images (PR #5) —
.fits.gz
(gzip magic bytes),.fztile-compressed images (RICE_1, GZIP_1, GZIP_2,
HCOMPRESS_1, PLIO_1, lossless or quantized floats) and an image in the first
image extension behind an empty primary (NAXIS = 0) are read through
fitsio-pure(pure Rust, its
parallelfeature on the rayon already in the tree). Its uncompressed
header and big-endian data unit then go through the plain reader's own
keyword parsing and BZERO / BSCALE / BITPIX conversions, so metadata
(channels, Bayer pattern incl.XBAYROFF/YBAYROFF, flip) and pixels
equal those of the same image stored plain.read_header/rustafits info
list the image HDU's cards; for a tile-compressed image that is the image's
logical header (ZBITPIX,ZNAXISn, … asBITPIX,NAXISn, …; table and
compression keywords dropped). Directory inputs pick up.fz. Plain FITS
with the image in the primary HDU is read in place exactly as before
(same bytes, same speed). 26 MP 16-bit frame (64-core x86_64): plain 46 ms,
.fzRICE_1 ~120 ms,.fits.gz~310 ms. PsfModel::Moffat(β): a Moffat profile at the caller's own β, on the config wire as{"moffat": β}. It fits as
PsfModel::Fixeddoes, in one pass and with no β sample, andMoffat(4.0)measures bit for bit likeMoffat4
though it is a different config value. A β outside 1.5 to 100 fails to decode with "moffat beta must be within
[1.5, 100], got X"."auto"and"moffat4"serialize as before, so no stored hash moves.examples/decode_hashes.rs: a decode-hash harness.cargo run --release --example decode_hashes -- FILES_OR_DIRS
prints a SHA-256 of whatImageConverter::read_rawreturns for each file and of the output of every converter
mode (plain,downscale2,downscale3,preview,no-debayer,vng,rgb,rgba);--synthetic <dir>
first writes 20 synthetic FITS files (every BITPIX, BZERO 0 and 32768, both row orders, widths of every
remainder modulo 8, an OSC file with Bayer offsets, f32 with NaN, f32 RGB). Run it before and after a change to
a reader: two runs that agree prove no decoded bit moved. It uses the public API only, so it builds against an
older checkout.