fpack(1)
π fpack(1) β the FITS glow-up page π
okay bestie, welcome to fpack β it's a User Commands legend and it's about to become your new hyperfixation. π¦
β¨ NAME β¨
fpack β the FITS image compression program, no cap. π
πΈ SYNOPSIS πΈ
fpack [OPTION]... FILE...
π DESCRIPTION π
So, fpack is a utility program for optimally compressing images in the FITS data format. Think of it as the GZIP utility's cooler cousin β except it's optimized for FITS format images and offers a way wider choice of compression options. It's giving glow-up, it's giving options, it's giving main character energy. π
β¨ OPTIONS β¨
Real talk first, two house rules π«Ά:
- Flags must be separate and they have to appear before filenames. Also, use
-to read from stdin. - The compression parameters you specify on the
fpackcommand line may be overridden by compression directive keywords in the header of each HDU of the input file(s). So the file itself can lowkey talk back. π
Now the menu, mwah:
-rβ Rice compression (this is the default, the moment, the standard). π-hβ Hcompress compression.-gor-g1β GZIP_1 (per-tile) compression.-g2β GZIP_2 (per-tile) compression, and yes it comes with byte shuffling. β¨-pβ PLIO compression (only for positive 8 or 16-bit integer images, so don't get cute with it).-dβ Tile the image without compression (debugging mode, literally just vibes).-wβ Compress the whole image as a single large tile. One tile, one queen. π-taxes β Comma separated list of tile dimensions (default is row by row).-qlevel β Quantized level spacing when converting floating point images to scaled integers. Here's the tea β:+valueis relative to sigma of background noise, and-valueis absolute. The default q value of4gives a compression ratio of about 6 with very high fidelity (only 0.26% increase in noise). Using q values of2, or1will give compression ratios of about 8, or 10, respectively (with 1.0% or 4.1% noise increase). The scaled quantized values are randomly dithered using a seed value determined from the system clock at run time. Use-q0instead of-qto suppress random dithering. Use-qzinstead of-qto not dither zero-valued pixels. Use-qtor-qztto compute random dithering seed from first tile checksum. Use-qNor-qzN, (N in range 1 to 10000) to use a specific dithering seed. And here's the plot twist π β floating-point images can be losslessly compressed by selecting the GZIP algorithm and specifying-q 0, but this is slower and often produces much less compression than the default quantization method.-i2fβ Convert integer images to floating point, then quantize and compress using the specified q level. When used appropriately, this lossy compression method can give much better compression than the normal lossless compression methods without significant loss of information. The-n3ratioand-n3minflags control the minimum noise thresholds; images below these thresholds will be losslessly compressed.-n3ratioβ Minimum ratio of background noise sigma divided by q. Default =2.0.-n3minβ Minimum background noise sigma. Default =6. The-i2fflag will be ignored if the noise level in the image does not exceed both thresholds. Both, bestie. It's strict. π-sscale β Scale factor for lossy Hcompress (default =0= lossless).+valueis relative to RMS noise;-valueis absolute.-nnoise β Rescale scaled-integer images to reduce noise and improve compression.-vβ Verbose mode; it lists each file as it is processed. Not me watching every file get its moment. π-Tβ Show compression algorithm comparison test statistics; files unchanged. (Your files are safe, she's just observing. π)-Rfile β Write the comparison test report (the one from above) to a text file.-tableβ Compress FITS binary tables using prototype method, as well as compress any image HDUs. Heads up: this option is intended for experimental use. π§ͺ-tableonlyβ Compress only FITS binary tables using prototype method; do not compress any image HDUs. Also intended for experimental use. π§ͺ-Fβ Overwrite input file by output file with same name. Dramatic, but okay. π-Dβ Delete input file after writing output. Gone. Poof. π¦-Yβ Suppress prompts to confirm-For-Doptions.-Sβ Output compressed FITS files to STDOUT.-Lβ List contents; files unchanged.-Cβ Don't update FITS checksum keywords.-Hβ Show this message. (Hi, that's this. π)-Vβ Show version number.
β οΈ gentle reminder:-tableand-tableonlyare experimental, and-F/-Ddo destructive-ish things to your actual files. Know before you go, bestie. π«Ά
π SEE ALSO π
funpack(1), fitscopy(1) β go read the whole friend group. π
and that's the page!! β¨ This one's rocking CFITSIO version 3.370, dated April 2014 β vintage but iconic, fr fr. slay, bye bestie! π ππ¦
π¦ where this page comes from
- debian trixie: libcfitsio-bin 4.6.2-2 Β· NOSA
- ubuntu questing: libcfitsio-bin 4.6.2-2
- ubuntu resolute: libcfitsio-bin 4.6.3-1 Β· NOSA
- ubuntu stonking: libcfitsio-bin 4.7.0-2 Β· NOSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms