1Pamtofits User Manual(0) Pamtofits User Manual(0)
2
3
4
6 pamtofits - convert a Netpbm image into FITS format
7
8
10 pamtofits [-max f] [-min f] [pamfile]
11
12
14 This program is part of Netpbm(1).
15
16 pamtofits reads a PNM or PAM image as input and produces a FITS (Flexi‐
17 ble Image Transport System) file as output. The resolution of the out‐
18 put file is either 8 bits/pixel, or 16 bits/pixel, depending on the
19 value of maxval in the input file. If the input file is a PBM or PGM
20 image, the output file consists of a single plane image (NAXIS = 2). If
21 instead the input file is a PPM image, the output file will consist of
22 a three-plane image (NAXIS = 3, NAXIS3 = 3).
23
24
26 -min and -max tell pamtofits what 'physical values' zero and maxval
27 sample values, respectively, in the input image represent. Physical
28 values are a FITS concept. pamtofits sets up the BSCALE and BZERO FITS
29 header cards to indicate this information.
30
31 The default for -min is 0 and for -max is the maxval, which means if
32 you don't specify these options, the FITS physical values are in fact
33 the original Netpbm sample values.
34
35 pamtofits always sets up the FITS header DATAMIN and DATAMAX cards to
36 indicate that the highest physical value in the image is the one corre‐
37 sponding to the Netpbm maxval and the lowest is that corresponding to
38 Netpbm zero. This isn't really how those cards are supposed to be
39 used, since the input image doesn't necessarily contain the full possi‐
40 ble range of sample values. It is a conservative approximation.
41
42
44 Pixel Order
45 The FITS specification does not specify which data in the file corre‐
46 sponds to which pixel in the image (i.e. which bytes are the the top
47 left pixel, etc.). Netpbm uses the common sense, most popular arrange‐
48 ment: row major, top to bottom, left to right. That means in a 10 wide
49 by 20 high image, the first 10 pixels in the file are the top row and
50 the last 10 are the bottom row. Within each row, the first pixel is
51 the leftmost one and the last pixel is the rightmost one.
52
53 Netpbm has always done that, since it first understood the FITS format
54 in 1989, so it is something of a de facto standard. Nobody reported
55 trouble with that until 2008.
56
57 However, at least some versions of ImageMagick and Gimp (as seen in
58 2008) use bottom to top order, so if you use display a FITS image gen‐
59 erated by pamtofits, it will appear upside down. To fix that, use pam‐
60 flip -topbottom on the image before feeding it to pamtofits.
61
62 Since 2008, people have noted that NASA distributes FITS files with
63 bottom to top order.
64
65
66
68 pamtofits was originally pnmtofits and did not handle PAM input. It
69 was extended and renamed in Netpbm 10.30 (October 2005).
70
71 pnmtofits was itself an extension of pgmtofits, which was added to Pbm‐
72 plus in 1989.
73
74
76 fitstopnm(1), pam(1) FITS(1)
77
78
80 Copyright (C) 1989 by Wilson H. Bent (whb@hoh-2.att.com), with modifi‐
81 cations by Alberto Accomazzi (alberto@cfa.harvard.edu).
82
83
84
85netpbm documentation 25 September 2005 Pamtofits User Manual(0)