cfitsio
3390
|
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <ctype.h>
#include <stddef.h>
#include "fitsio2.h"
Functions | |
int | ffghsp (fitsfile *fptr, int *nexist, int *nmore, int *status) |
int | ffghps (fitsfile *fptr, int *nexist, int *position, int *status) |
int | ffnchk (fitsfile *fptr, int *status) |
int | ffmaky (fitsfile *fptr, int nrec, int *status) |
int | ffmrky (fitsfile *fptr, int nmove, int *status) |
int | ffgnky (fitsfile *fptr, char *card, int *status) |
int | ffgnxk (fitsfile *fptr, char **inclist, int ninc, char **exclist, int nexc, char *card, int *status) |
int | ffgky (fitsfile *fptr, int datatype, const char *keyname, void *value, char *comm, int *status) |
int | ffgkey (fitsfile *fptr, const char *keyname, char *keyval, char *comm, int *status) |
int | ffgrec (fitsfile *fptr, int nrec, char *card, int *status) |
int | ffgcrd (fitsfile *fptr, const char *name, char *card, int *status) |
int | ffgstr (fitsfile *fptr, const char *string, char *card, int *status) |
int | ffgknm (char *card, char *name, int *length, int *status) |
int | ffgunt (fitsfile *fptr, const char *keyname, char *unit, int *status) |
int | ffgkys (fitsfile *fptr, const char *keyname, char *value, char *comm, int *status) |
int | ffgksl (fitsfile *fptr, const char *keyname, int *length, int *status) |
int | ffgkls (fitsfile *fptr, const char *keyname, char **value, char *comm, int *status) |
int | ffgsky (fitsfile *fptr, const char *keyname, int firstchar, int maxchar, char *value, int *valuelen, char *comm, int *status) |
int | fffree (void *value, int *status) |
int | ffgcnt (fitsfile *fptr, char *value, char *comm, int *status) |
int | ffgkyl (fitsfile *fptr, const char *keyname, int *value, char *comm, int *status) |
int | ffgkyj (fitsfile *fptr, const char *keyname, long *value, char *comm, int *status) |
int | ffgkyjj (fitsfile *fptr, const char *keyname, LONGLONG *value, char *comm, int *status) |
int | ffgkye (fitsfile *fptr, const char *keyname, float *value, char *comm, int *status) |
int | ffgkyd (fitsfile *fptr, const char *keyname, double *value, char *comm, int *status) |
int | ffgkyc (fitsfile *fptr, const char *keyname, float *value, char *comm, int *status) |
int | ffgkym (fitsfile *fptr, const char *keyname, double *value, char *comm, int *status) |
int | ffgkyt (fitsfile *fptr, const char *keyname, long *ivalue, double *fraction, char *comm, int *status) |
int | ffgkyn (fitsfile *fptr, int nkey, char *keyname, char *value, char *comm, int *status) |
int | ffgkns (fitsfile *fptr, const char *keyname, int nstart, int nmax, char *value[], int *nfound, int *status) |
int | ffgknl (fitsfile *fptr, const char *keyname, int nstart, int nmax, int *value, int *nfound, int *status) |
int | ffgknj (fitsfile *fptr, const char *keyname, int nstart, int nmax, long *value, int *nfound, int *status) |
int | ffgknjj (fitsfile *fptr, const char *keyname, int nstart, int nmax, LONGLONG *value, int *nfound, int *status) |
int | ffgkne (fitsfile *fptr, const char *keyname, int nstart, int nmax, float *value, int *nfound, int *status) |
int | ffgknd (fitsfile *fptr, const char *keyname, int nstart, int nmax, double *value, int *nfound, int *status) |
int | ffgtdm (fitsfile *fptr, int colnum, int maxdim, int *naxis, long naxes[], int *status) |
int | ffgtdmll (fitsfile *fptr, int colnum, int maxdim, int *naxis, LONGLONG naxes[], int *status) |
int | ffdtdm (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, int *naxis, long naxes[], int *status) |
int | ffdtdmll (fitsfile *fptr, char *tdimstr, int colnum, int maxdim, int *naxis, LONGLONG naxes[], int *status) |
int | ffghpr (fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, long naxes[], long *pcount, long *gcount, int *extend, int *status) |
int | ffghprll (fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, LONGLONG naxes[], long *pcount, long *gcount, int *extend, int *status) |
int | ffghtb (fitsfile *fptr, int maxfield, long *naxis1, long *naxis2, int *tfields, char **ttype, long *tbcol, char **tform, char **tunit, char *extnm, int *status) |
int | ffghtbll (fitsfile *fptr, int maxfield, LONGLONG *naxis1, LONGLONG *naxis2, int *tfields, char **ttype, LONGLONG *tbcol, char **tform, char **tunit, char *extnm, int *status) |
int | ffghbn (fitsfile *fptr, int maxfield, long *naxis2, int *tfields, char **ttype, char **tform, char **tunit, char *extnm, long *pcount, int *status) |
int | ffghbnll (fitsfile *fptr, int maxfield, LONGLONG *naxis2, int *tfields, char **ttype, char **tform, char **tunit, char *extnm, LONGLONG *pcount, int *status) |
int | ffgphd (fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, LONGLONG naxes[], long *pcount, long *gcount, int *extend, double *bscale, double *bzero, LONGLONG *blank, int *nspace, int *status) |
int | ffgttb (fitsfile *fptr, LONGLONG *rowlen, LONGLONG *nrows, LONGLONG *pcount, long *tfields, int *status) |
int | ffgtkn (fitsfile *fptr, int numkey, char *name, long *value, int *status) |
int | ffgtknjj (fitsfile *fptr, int numkey, char *name, LONGLONG *value, int *status) |
int | fftkyn (fitsfile *fptr, int numkey, char *name, char *value, int *status) |
int | ffh2st (fitsfile *fptr, char **header, int *status) |
int | ffhdr2str (fitsfile *fptr, int exclude_comm, char **exclist, int nexc, char **header, int *nkeys, int *status) |
int | ffcnvthdr2str (fitsfile *fptr, int exclude_comm, char **exclist, int nexc, char **header, int *nkeys, int *status) |
int ffcnvthdr2str | ( | fitsfile * | fptr, |
int | exclude_comm, | ||
char ** | exclist, | ||
int | nexc, | ||
char ** | header, | ||
int * | nkeys, | ||
int * | status | ||
) |
Same as ffhdr2str, except that if the input HDU is a tile compressed image (stored in a binary table) then it will first convert that header back to that of a normal uncompressed FITS image before concatenating the header keyword records.
[in] | fptr | FITS file pointer |
[in] | exclude_comm | if TRUE, exclude commentary keywords |
[in] | exclist | list of excluded keyword names |
[in] | nexc | number of names in exclist |
[out] | header | returned header string |
[out] | nkeys | returned number of 80-char keywords |
[in,out] | status | error status |
int ffdtdm | ( | fitsfile * | fptr, |
char * | tdimstr, | ||
int | colnum, | ||
int | maxdim, | ||
int * | naxis, | ||
long | naxes[], | ||
int * | status | ||
) |
decode the TDIMnnn keyword to get the dimensionality of a column. Check that the value is legal and consistent with the TFORM value. If colnum = 0, then the validity checking is disabled.
[in] | fptr | FITS file pointer |
[in] | tdimstr | TDIMn keyword value string. e.g. (10,10) |
[in] | colnum | number of the column |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[in,out] | status | error status |
int ffdtdmll | ( | fitsfile * | fptr, |
char * | tdimstr, | ||
int | colnum, | ||
int | maxdim, | ||
int * | naxis, | ||
LONGLONG | naxes[], | ||
int * | status | ||
) |
decode the TDIMnnn keyword to get the dimensionality of a column. Check that the value is legal and consistent with the TFORM value.
[in] | fptr | FITS file pointer |
[in] | tdimstr | TDIMn keyword value string. e.g. (10,10) |
[in] | colnum | number of the column |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[in,out] | status | error status |
int fffree | ( | void * | value, |
int * | status | ||
) |
Free the memory that was previously allocated by CFITSIO, such as by ffgkls or fits_hdr2str
[in] | value | pointer to keyword value |
[in,out] | status | error status |
int ffgcnt | ( | fitsfile * | fptr, |
char * | value, | ||
char * | comm, | ||
int * | status | ||
) |
Attempt to read the next keyword, returning the string value if it is a continuation of the previous string keyword value. This uses the HEASARC convention for continuing long string values over multiple keywords. Each continued string is terminated with a backslash character, and the continuation follows on the next keyword which must have the name CONTINUE without an equal sign in column 9 of the card. If the next card is not a continuation, then the returned value string will be null.
[in] | fptr | FITS file pointer |
[out] | value | continued string value |
[out] | comm | continued comment string |
[in,out] | status | error status |
Read (get) the named keyword, returning the entire keyword card up to 80 characters long. The returned card value is null terminated with any trailing blank characters removed.
If the input name contains wild cards ('?' matches any single char and '*' matches any sequence of chars, # matches any string of decimal digits) then the search ends once the end of header is reached and does not automatically resume from the top of the header.
[in] | fptr | FITS file pointer |
[in] | name | name of keyword to read |
[out] | card | keyword card |
[in,out] | status | error status |
int ffghbn | ( | fitsfile * | fptr, |
int | maxfield, | ||
long * | naxis2, | ||
int * | tfields, | ||
char ** | ttype, | ||
char ** | tform, | ||
char ** | tunit, | ||
char * | extnm, | ||
long * | pcount, | ||
int * | status | ||
) |
Get keywords from the Header of the BiNary table: Check that the keywords conform to the FITS standard and return the parameters which describe the table.
[in] | fptr | FITS file pointer |
[in] | maxfield | maximum no. of columns to read; |
[out] | naxis2 | number of rows in the table |
[out] | tfields | number of columns in the table |
[out] | ttype | name of each column |
[out] | tform | TFORMn value for each column |
[out] | tunit | TUNITn value for each column |
[out] | extnm | value of EXTNAME keyword, if any |
[out] | pcount | value of PCOUNT keyword |
[in,out] | status | error status |
int ffghbnll | ( | fitsfile * | fptr, |
int | maxfield, | ||
LONGLONG * | naxis2, | ||
int * | tfields, | ||
char ** | ttype, | ||
char ** | tform, | ||
char ** | tunit, | ||
char * | extnm, | ||
LONGLONG * | pcount, | ||
int * | status | ||
) |
Get keywords from the Header of the BiNary table: Check that the keywords conform to the FITS standard and return the parameters which describe the table.
[in] | fptr | FITS file pointer |
[in] | maxfield | maximum no. of columns to read; |
[out] | naxis2 | number of rows in the table |
[out] | tfields | number of columns in the table |
[out] | ttype | name of each column |
[out] | tform | TFORMn value for each column |
[out] | tunit | TUNITn value for each column |
[out] | extnm | value of EXTNAME keyword, if any |
[out] | pcount | value of PCOUNT keyword |
[in,out] | status | error status |
int ffghpr | ( | fitsfile * | fptr, |
int | maxdim, | ||
int * | simple, | ||
int * | bitpix, | ||
int * | naxis, | ||
long | naxes[], | ||
long * | pcount, | ||
long * | gcount, | ||
int * | extend, | ||
int * | status | ||
) |
Get keywords from the Header of the PRimary array: Check that the keywords conform to the FITS standard and return the parameters which determine the size and structure of the primary array or IMAGE extension.
[in] | fptr | FITS file pointer |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | simple | does file conform to FITS standard? 1/0 |
[out] | bitpix | number of bits per data value pixel |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[out] | pcount | number of group parameters (usually 0) |
[out] | gcount | number of random groups (usually 1 or 0) |
[out] | extend | may FITS file haave extensions? |
[in,out] | status | error status |
int ffghprll | ( | fitsfile * | fptr, |
int | maxdim, | ||
int * | simple, | ||
int * | bitpix, | ||
int * | naxis, | ||
LONGLONG | naxes[], | ||
long * | pcount, | ||
long * | gcount, | ||
int * | extend, | ||
int * | status | ||
) |
Get keywords from the Header of the PRimary array: Check that the keywords conform to the FITS standard and return the parameters which determine the size and structure of the primary array or IMAGE extension.
[in] | fptr | FITS file pointer |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | simple | does file conform to FITS standard? 1/0 |
[out] | bitpix | number of bits per data value pixel |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[out] | pcount | number of group parameters (usually 0) |
[out] | gcount | number of random groups (usually 1 or 0) |
[out] | extend | may FITS file haave extensions? |
[in,out] | status | error status |
int ffghps | ( | fitsfile * | fptr, |
int * | nexist, | ||
int * | position, | ||
int * | status | ||
) |
return the number of existing keywords and the position of the next keyword that will be read.
[in] | fptr | FITS file pointer |
[out] | nexist | number of existing keywords in header |
[out] | nmore | position of next keyword to be read |
[in,out] | status | error status |
int ffghsp | ( | fitsfile * | fptr, |
int * | nexist, | ||
int * | nmore, | ||
int * | status | ||
) |
returns the number of existing keywords (not counting the END keyword) and the number of more keyword that will fit in the current header without having to insert more FITS blocks.
[in] | fptr | FITS file pointer |
[out] | nexist | number of existing keywords in header |
[out] | nmore | how many more keywords will fit |
[in,out] | status | error status |
int ffghtb | ( | fitsfile * | fptr, |
int | maxfield, | ||
long * | naxis1, | ||
long * | naxis2, | ||
int * | tfields, | ||
char ** | ttype, | ||
long * | tbcol, | ||
char ** | tform, | ||
char ** | tunit, | ||
char * | extnm, | ||
int * | status | ||
) |
Get keywords from the Header of the ASCII TaBle: Check that the keywords conform to the FITS standard and return the parameters which describe the table.
[in] | fptr | FITS file pointer |
[in] | maxfield | maximum no. of columns to read; |
[out] | naxis1 | length of table row in bytes |
[out] | naxis2 | number of rows in the table |
[out] | tfields | number of columns in the table |
[out] | ttype | name of each column |
[out] | tbcol | byte offset in row to each column |
[out] | tform | value of TFORMn keyword for each column |
[out] | tunit | value of TUNITn keyword for each column |
[out] | extnm | value of EXTNAME keyword, if any |
[in,out] | status | error status |
int ffghtbll | ( | fitsfile * | fptr, |
int | maxfield, | ||
LONGLONG * | naxis1, | ||
LONGLONG * | naxis2, | ||
int * | tfields, | ||
char ** | ttype, | ||
LONGLONG * | tbcol, | ||
char ** | tform, | ||
char ** | tunit, | ||
char * | extnm, | ||
int * | status | ||
) |
Get keywords from the Header of the ASCII TaBle: Check that the keywords conform to the FITS standard and return the parameters which describe the table.
[in] | fptr | FITS file pointer |
[in] | maxfield | maximum no. of columns to read; |
[out] | naxis1 | length of table row in bytes |
[out] | naxis2 | number of rows in the table |
[out] | tfields | number of columns in the table |
[out] | ttype | name of each column |
[out] | tbcol | byte offset in row to each column |
[out] | tform | value of TFORMn keyword for each column |
[out] | tunit | value of TUNITn keyword for each column |
[out] | extnm | value of EXTNAME keyword, if any |
[in,out] | status | error status |
Read (get) the named keyword, returning the keyword value and comment. The value is just the literal string of characters in the value field of the keyword. In the case of a string valued keyword, the returned value includes the leading and closing quote characters. The value may be up to 70 characters long, and the comment may be up to 72 characters long. If the keyword has no value (no equal sign in column 9) then a null value is returned.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | keyval | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
This is the original routine for reading long string keywords that use the CONTINUE keyword convention. In 2016 a new routine called ffgsky / fits_read_string_key was added, which may provide a more convenient user interface for most applications.
Get Keyword with possible Long String value: Read (get) the named keyword, returning the value and comment. The returned value string may be arbitrarily long (by using the HEASARC convention for continuing long string values over multiple keywords) so this routine allocates the required memory for the returned string value. It is up to the calling routine to free the memory once it is finished with the value string. The returned comment string may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | pointer to keyword value |
[out] | comm | keyword comment (may be NULL) |
[in,out] | status | error status |
int ffgknd | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
double * | value, | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
int ffgkne | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
float * | value, | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
int ffgknj | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
long * | value, | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
int ffgknjj | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
LONGLONG * | value, | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
int ffgknl | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
int * | value, | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive. The returned value = 1 if the keyword is true, else = 0 if false.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
int ffgknm | ( | char * | card, |
char * | name, | ||
int * | length, | ||
int * | status | ||
) |
Return the name of the keyword, and the name length. This supports the ESO HIERARCH convention where keyword names may be > 8 characters long.
[in] | card | keyword card |
[out] | name | name of the keyword |
[out] | length | length of the keyword name |
[in,out] | status | error status |
int ffgkns | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | nstart, | ||
int | nmax, | ||
char * | value[], | ||
int * | nfound, | ||
int * | status | ||
) |
Read (get) an indexed array of keywords with index numbers between NSTART and (NSTART + NMAX -1) inclusive. This routine does NOT support the HEASARC long string convention.
[in] | fptr | FITS file pointer |
[in] | keyname | root name of keywords to read |
[in] | nstart | starting index number |
[in] | nmax | maximum number of keywords to return |
[out] | value | array of pointers to keyword values |
[out] | nfound | number of values that were returned |
[in,out] | status | error status |
Get the length of the keyword value string. This routine explicitly supports the CONTINUE convention for long string values.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | length | length of the string value |
[in,out] | status | error status |
int ffgky | ( | fitsfile * | fptr, |
int | datatype, | ||
const char * | keyname, | ||
void * | value, | ||
char * | comm, | ||
int * | status | ||
) |
Read (get) the keyword value and comment from the FITS header. Reads a keyword value with the datatype specified by the 2nd argument.
[in] | fptr | FITS file pointer |
[in] | datatype | datatype of the value |
[in] | keyname | name of keyword to read |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The keyword must have a complex value. No implicit data conversion will be performed.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value (real,imag) |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The value will be implicitly converted to a double if it not already of this datatype. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The value will be implicitly converted to a float if it not already of this datatype. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The value will be implicitly converted to a (long) integer if it not already of this datatype. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The value will be implicitly converted to a (long) integer if it not already of this datatype. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The returned value = 1 if the keyword is true, else = 0 if false. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[in] | value | keyword value |
[in] | comm | keyword comment |
[in,out] | status | error status |
Read (get) the named keyword, returning the value and comment. The keyword must have a complex value. No implicit data conversion will be performed.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | value | keyword value (real,imag) |
[out] | comm | keyword comment |
[in,out] | status | error status |
int ffgkyn | ( | fitsfile * | fptr, |
int | nkey, | ||
char * | keyname, | ||
char * | value, | ||
char * | comm, | ||
int * | status | ||
) |
Read (get) the nkey-th keyword returning the keyword name, value and comment. The value is just the literal string of characters in the value field of the keyword. In the case of a string valued keyword, the returned value includes the leading and closing quote characters. The value may be up to 70 characters long, and the comment may be up to 72 characters long. If the keyword has no value (no equal sign in column 9) then a null value is returned. If comm = NULL, then do not return the comment string.
[in] | fptr | FITS file pointer |
[in] | nkey | number of the keyword to read |
[out] | keyname | name of the keyword |
[out] | value | keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
int ffgkyt | ( | fitsfile * | fptr, |
const char * | keyname, | ||
long * | ivalue, | ||
double * | fraction, | ||
char * | comm, | ||
int * | status | ||
) |
Read (get) the named keyword, returning the value and comment. The integer and fractional parts of the value are returned in separate variables, to allow more numerical precision to be passed. This effectively passes a 'triple' precision value, with a 4-byte integer and an 8-byte fraction. The comment may be up to 69 characters long.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | ivalue | integer part of keyword value |
[out] | fraction | fractional part of keyword value |
[out] | comm | keyword comment |
[in,out] | status | error status |
int ffgnky | ( | fitsfile * | fptr, |
char * | card, | ||
int * | status | ||
) |
read the next keyword from the header - used internally by cfitsio
[in] | fptr | FITS file pointer |
[out] | card | card string |
[in,out] | status | error status |
int ffgnxk | ( | fitsfile * | fptr, |
char ** | inclist, | ||
int | ninc, | ||
char ** | exclist, | ||
int | nexc, | ||
char * | card, | ||
int * | status | ||
) |
Return the next keyword that matches one of the names in inclist but does not match any of the names in exclist. The search goes from the current position to the end of the header, only. Wild card characters may be used in the name lists ('*', '?' and '#').
[in] | fptr | FITS file pointer |
[in] | inclist | list of included keyword names |
[in] | ninc | number of names in inclist |
[in] | exclist | list of excluded keyword names |
[in] | nexc | number of names in exclist |
[out] | card | first matching keyword |
[in,out] | status | error status |
int ffgphd | ( | fitsfile * | fptr, |
int | maxdim, | ||
int * | simple, | ||
int * | bitpix, | ||
int * | naxis, | ||
LONGLONG | naxes[], | ||
long * | pcount, | ||
long * | gcount, | ||
int * | extend, | ||
double * | bscale, | ||
double * | bzero, | ||
LONGLONG * | blank, | ||
int * | nspace, | ||
int * | status | ||
) |
Get the Primary HeaDer parameters. Check that the keywords conform to the FITS standard and return the parameters which determine the size and structure of the primary array or IMAGE extension.
[in] | fptr | FITS file pointer |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | simple | does file conform to FITS standard? 1/0 |
[out] | bitpix | number of bits per data value pixel |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[out] | pcount | number of group parameters (usually 0) |
[out] | gcount | number of random groups (usually 1 or 0) |
[out] | extend | may FITS file haave extensions? |
[out] | bscale | array pixel linear scaling factor |
[out] | bzero | array pixel linear scaling zero point |
[out] | blank | value used to represent undefined pixels |
[out] | nspace | number of blank keywords prior to END |
[in,out] | status | error status |
int ffgrec | ( | fitsfile * | fptr, |
int | nrec, | ||
char * | card, | ||
int * | status | ||
) |
Read (get) the nrec-th keyword, returning the entire keyword card up to 80 characters long. The first keyword in the header has nrec = 1, not 0. The returned card value is null terminated with any trailing blank characters removed. If nrec = 0, then this routine simply moves the current header pointer to the top of the header.
[in] | fptr | FITS file pointer |
[in] | nrec | number of keyword to read |
[out] | card | keyword card |
[in,out] | status | error status |
int ffgsky | ( | fitsfile * | fptr, |
const char * | keyname, | ||
int | firstchar, | ||
int | maxchar, | ||
char * | value, | ||
int * | valuelen, | ||
char * | comm, | ||
int * | status | ||
) |
Read and return the value of the specified string-valued keyword.
This new routine was added in 2016 to provide a more convenient user interface than the older ffgkls routine.
Read a string keyword, returning up to 'naxchars' characters of the value starting with the 'firstchar' character. The input 'value' string must be allocated at least 1 char bigger to allow for the terminating null character.
This routine may be used to read continued string keywords that use the CONTINUE keyword convention, as well as normal string keywords that are contained within a single header record.
This routine differs from the ffkls routine in that it does not internally allocate memory for the returned value string, and consequently the calling routine does not need to call fffree to free the memory.
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[in] | firstchar | first character of string to return |
[in] | maxchar | maximum length of string to return (string will be null terminated) |
[out] | value | pointer to keyword value |
[out] | valuelen | total length of the keyword value string The returned 'value' string may only contain a piece of the total string, depending on the value of firstchar and maxchar |
[out] | comm | keyword comment (may be NULL) |
[in,out] | status | error status |
Read (get) the next keyword record that contains the input character string, returning the entire keyword card up to 80 characters long. The returned card value is null terminated with any trailing blank characters removed.
[in] | fptr | FITS file pointer |
[in] | string | |
[out] | card | |
[in,out] | status | error status |
int ffgtdm | ( | fitsfile * | fptr, |
int | colnum, | ||
int | maxdim, | ||
int * | naxis, | ||
long | naxes[], | ||
int * | status | ||
) |
read and parse the TDIMnnn keyword to get the dimensionality of a column
[in] | fptr | FITS file pointer |
[in] | colnum | number of the column to read |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[in,out] | status | error status |
int ffgtdmll | ( | fitsfile * | fptr, |
int | colnum, | ||
int | maxdim, | ||
int * | naxis, | ||
LONGLONG | naxes[], | ||
int * | status | ||
) |
read and parse the TDIMnnn keyword to get the dimensionality of a column
[in] | fptr | FITS file pointer |
[in] | colnum | number of the column to read |
[in] | maxdim | maximum no. of dimensions to read; |
[out] | naxis | number of axes in the data array |
[out] | naxes | length of each data axis |
[in,out] | status | error status |
int ffgtkn | ( | fitsfile * | fptr, |
int | numkey, | ||
char * | name, | ||
long * | value, | ||
int * | status | ||
) |
test that keyword number NUMKEY has the expected name and get the integer value of the keyword. Return an error if the keyword name does not match the input name, or if the value of the keyword is not a positive integer.
[in] | fptr | FITS file pointer |
[in] | numkey | number of the keyword to read |
[in] | name | expected name of the keyword |
[out] | value | integer value of the keyword |
[in,out] | status | error status |
test that keyword number NUMKEY has the expected name and get the integer value of the keyword. Return an error if the keyword name does not match the input name, or if the value of the keyword is not a positive integer.
[in] | fptr | FITS file pointer |
[in] | numkey | number of the keyword to read |
[in] | name | expected name of the keyword |
[out] | value | integer value of the keyword |
[in,out] | status | error status |
int ffgttb | ( | fitsfile * | fptr, |
LONGLONG * | rowlen, | ||
LONGLONG * | nrows, | ||
LONGLONG * | pcount, | ||
long * | tfields, | ||
int * | status | ||
) |
Get and Test TaBle; Test that this is a legal ASCII or binary table and get some keyword values. We assume that the calling routine has already tested the 1st keyword of the extension to ensure that this is really a table extension.
[in] | fptr | FITS file pointer |
[out] | rowlen | length of a table row, in bytes |
[out] | nrows | number of rows in the table |
[out] | pcount | value of PCOUNT keyword |
[out] | tfields | number of fields in the table |
[in,out] | status | error status |
Read (get) the units string from the comment field of the existing keyword. This routine uses a local FITS convention (not defined in the official FITS standard) in which the units are enclosed in square brackets following the '/' comment field delimiter, e.g.:
KEYWORD = 12 / [kpc] comment string goes here
[in] | fptr | FITS file pointer |
[in] | keyname | name of keyword to read |
[out] | unit | keyword units |
[in,out] | status | error status |
int ffh2st | ( | fitsfile * | fptr, |
char ** | header, | ||
int * | status | ||
) |
int ffhdr2str | ( | fitsfile * | fptr, |
int | exclude_comm, | ||
char ** | exclist, | ||
int | nexc, | ||
char ** | header, | ||
int * | nkeys, | ||
int * | status | ||
) |
read header keywords into a long string of chars. This routine allocates memory for the string, so the calling routine must eventually free the memory when it is not needed any more. If exclude_comm is TRUE, then all the COMMENT, HISTORY, and <blank> keywords will be excluded from the output string of keywords. Any other list of keywords to be excluded may be specified with the exclist parameter.
[in] | fptr | FITS file pointer |
[in] | exclude_comm | if TRUE, exclude commentary keywords |
[in] | exclist | list of excluded keyword names |
[in] | nexc | number of names in exclist |
[out] | header | returned header string |
[out] | nkeys | returned number of 80-char keywords |
[in,out] | status | error status |
int ffmaky | ( | fitsfile * | fptr, |
int | nrec, | ||
int * | status | ||
) |
[in] | fptr | FITS file pointer |
[in] | nrec | one-based keyword number to move to |
[in,out] | status | error status |
int ffmrky | ( | fitsfile * | fptr, |
int | nmove, | ||
int * | status | ||
) |
[in] | fptr | FITS file pointer |
[in] | nmove | relative number of keywords to move |
[in,out] | status | error status |
int ffnchk | ( | fitsfile * | fptr, |
int * | status | ||
) |
function returns the position of the first null character (ASCII 0), if any, in the current header. Null characters are illegal, but the other CFITSIO routines that read the header will not detect this error, because the null gets interpreted as a normal end of string character.
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int fftkyn | ( | fitsfile * | fptr, |
int | numkey, | ||
char * | name, | ||
char * | value, | ||
int * | status | ||
) |
test that keyword number NUMKEY has the expected name and the expected value string.
[in] | fptr | FITS file pointer |
[in] | numkey | number of the keyword to read |
[in] | name | expected name of the keyword |
[in] | value | expected value of the keyword |
[in,out] | status | error status |