Documentation
¶
Overview ¶
Package fits reads the images and binary tables in FITS files as the FITS Standard 4.0 describes them, and refuses the rest. It reads a header's cards, an image's pixels a row at a time, a table's cells a few thousand rows at a time, and where an image lies on the sky.
The image is the primary array or an `IMAGE` extension. Its pixels are any of the six types the standard allows. They are scaled by `BSCALE` and `BZERO`, and `BLANK` is read as no value.
The table is the first `BINTABLE` extension. A column is read when it holds one value a row: a logical, an integer of one to eight bytes, a single or double float, or text. `TSCAL` and `TZERO` scale the numbers.
A column of many values a row is stepped over: the table opens and its other columns read, and a read of it is refused.
An integer equal to its column's `TNULL`, and a float that is not a number, are read as no value. A `TNULL` on a float column is ignored: archives write one on every column, and a float's null is not a number whatever the card says.
Where it lies on the sky is read from the world coordinate cards. The projections read are TAN and CAR, in equatorial or galactic coordinates.
Anything else is refused, and each refusal says why in words.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶ added in v0.0.7
type Column struct {
// contains filtered or unexported fields
}
Column is one column of a binary table: its name and unit as the header gives them, the kind of value it holds, how many a row, and where it lies in a row.
func (Column) Count ¶ added in v0.0.7
Count is how many values a row holds in the column: one, or more in a column of many, which is stepped over and not read. Text is one value however many characters it holds.
func (Column) Kind ¶ added in v0.0.7
Kind is the letter of the column's TFORM: what each value is and how many bytes it takes, L, B, I, J, K, E, D or A.
type Frame ¶
type Frame string
Frame is the coordinates an image's axes are in.
const ( // Equatorial is right ascension and declination, ICRS. FK5 at the // J2000 equinox is read as ICRS: the two differ by tens of // milliarcseconds, far below any pixel here. Equatorial Frame = "equatorial" // Galactic is galactic longitude and latitude. Galactic Frame = "galactic" )
The frames an image may be in.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header is a header's cards by keyword. Each value is kept as its card writes it, with its comment taken off.
func ReadHeader ¶
ReadHeader is the header at the front of a reader, read a block at a time to its END card. Headers that end before their END card are refused.
func (*Header) Integer ¶ added in v0.0.7
Integer is a keyword's value as a whole number, read whole: one too large for a float to hold is read exactly. It refuses a value that is not a whole number.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is a two-dimensional image in a FITS file. Its rows are read as they are asked for.
func Open ¶
Open is the first two-dimensional image in a file: the primary array or an IMAGE extension. HDUs that hold no image are stepped over. Tables and empty primaries are such. Files with no image are refused.
func (*Image) Row ¶
Row is the values of one row. The first row is the bottom one, as the standard counts them. Each is BZERO more than BSCALE times the stored value. Stored BLANKs are NaN, and so are floats that are not a number.
type Row ¶ added in v0.0.7
type Row struct {
// contains filtered or unexported fields
}
Row is one row of a table, counted from none. It is read from the file when a cell of it is asked for. It refuses a row the table does not have.
func (Row) Float ¶ added in v0.0.7
Float is a cell's value as a number, scaled by the column's TSCAL and TZERO. A float that is not a number, and an integer equal to the column's TNULL, read as not a number. It refuses a column of text or of logical values, and a column of many values a row.
func (Row) Int ¶ added in v0.0.7
Int is a cell's value as a whole number, unscaled, and whether it is one: false for the column's TNULL. It refuses a column that holds no integers, and a column of many values a row.
type Sky ¶
type Sky struct {
// contains filtered or unexported fields
}
Sky is where an image's pixels lie on the sky: a projection about a reference point, and the matrix that turns pixels into degrees.
func SkyOf ¶
SkyOf is where a header says its image lies on the sky. It refuses a projection or a frame it does not read, and axes not in degrees.
It refuses a CAR grid not about the equator and a pole moved from where the projection puts it. It refuses an equinox other than J2000 and a pixel matrix with no inverse.
type Table ¶ added in v0.0.7
type Table struct {
// contains filtered or unexported fields
}
Table is a binary table extension in a FITS file: columns of numbers and text in rows of one width, read as they are asked for, a few thousand rows at a time.
func OpenTable ¶ added in v0.0.7
OpenTable is the first binary table in a file. HDUs that hold no table are stepped over: the primary array, images, and anything else the standard sizes. Files with no table are refused, and so is a table whose columns this package does not read.
func (*Table) Column ¶ added in v0.0.7
Column is the column of a name. It refuses a name the table lacks.