FITSTOPNM(1)
π fitstopnm π
okay bestie, gather round, because we're talking about fitstopnm from the Fitstopnm User Manual, section 1 of the general commands manual. she converts a FITS file into a PNM image and honestly? iconic behaviour.
β¨ NAME β¨
fitstopnm β convert a FITS file into a PNM image π¦
πΈ SYNOPSIS πΈ
fitstopnm [-image=N] [-scanmax] [-printmax] [-min=f] [-max=f]
[-omaxval=N [FITSfile]
(yes bestie, that bracket situation at the end is exactly how the original is, no cap, I do not make the rules π )
Quick lil' housekeeping notes so you don't get caught out:
- The minimum unique abbreviation of an option is acceptable β so like, short names are fine as long as they're unambiguous, slay.
- You may use double hyphens instead of a single hyphen to denote options. both work, live your truth.
- You may use white space in place of the equals sign to separate an option name from its value. so
-min 5and-min=5are giving the same energy fr fr.
π DESCRIPTION π
This program is part of Netpbm(1). π
fitstopnm reads a FITS (Flexible Image Transport System) file as input, and here's the tea on what it spits out:
- It produces a PPM image if the FITS file consists of 3 image planes (
NAXIS = 3andNAXIS3 = 3). - It produces a PGM image if the FITS file consists of 2 image planes (
NAXIS = 2), or if you specify the-imageoption.
β οΈ okay so real talk, bestie: that PPM image is highly unlikely to be a true PPM image, because it is not normal for a FITS image to use the third axis as R, G, and B components of the pixels. not me breaking the colour rules π
The most common interpretation when there are 3 axes is that the third one is time. So the image is actually a pseudo-PPM, where the three sample values of a pixel represent something other than colour components β for example gray levels at three instants. (This variation on PPM is common in programs such as fitstopnm that predate the PAM format. vintage queen behaviour β¨)
If you work with FITS images with 3 axes, you should probably always use the -image option to avoid getting an unwanted pseudo-PPM image. protecting your peace, one flag at a time π«Ά
The program tells you what kind of PNM image it is writing. she communicates. we love that. π£
β¨ OPTIONS β¨
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), fitstopnm recognizes the following command line options:
-image=Nβ this one is for FITS files with three axes. It says that the third axis is for multiple images, and the option value N tells which one you want. pick your fighter π-omaxval=Nβ this is the maxval that the output PNM image is to have.- By default, the maxval is the least possible to retain all the precision of the FITS input. That means the difference between the highest and lowest sample value in the input. If the values range from
-5to100, for example, the default maxval would be106and each PNM sample value would correspond to one FITS sample value. - For a FITS input with floating point sample values, the precision is essentially unlimited, so this is not possible. In that case, the default maxval is simply
255. yeah she just says 255 and moves on π - This option was new in Netpbm 10.39 (June 2007). Before that, the output maxval is always the default. throwback era, no thanks.
- By default, the maxval is the least possible to retain all the precision of the FITS input. That means the difference between the highest and lowest sample value in the input. If the values range from
-min=floatβ use this to override the min value as read from the FITS header or the image data if the header has noDATAMINandDATAMAXkeywords.-max=floatβ same situation, but for the max value; override what's read from the FITS header or the image data if the header has noDATAMINandDATAMAXkeywords.-scanmaxβ use this option to force the program to scan the data even when the header hasDATAMINandDATAMAX. she's thorough π-printmaxβ with this option, the program just prints the min and max values and quits without doing its normal job. she said βοΈ
This is for use in shell programs. Example:
eval 'fitstopnm -printmax $filename | \
awk {min = $1; max = $2} \
END {print "min=" min; " max=" max}'
π NOTES π
π Pixel Order π
You may need to pass the output of fitstopnm through pamflip -topbottom. See pamtofits. little flip moment, she's just built that way π
π SEE ALSO π
pamtofits(1), pamflip(1), pgm(1)
π AUTHOR π
Copyright (C) 1989 by Jef Poskanzer, with modifications by Daniel Briggs (dbriggs@nrao.edu) and Alberto Accomazzi (alberto@cfa.harvard.edu). legends only, fr fr π
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/fitstopnm.html
and that's the whole vibe bestie π¦ this was netpbm documentation, dated 02 August 2015, and you just read the Fitstopnm User Manual, section 1. periodt. π β¨
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms