cfitsio  3390
Functions
getkey.c File Reference
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <ctype.h>
#include <stddef.h>
#include "fitsio2.h"
Include dependency graph for getkey.c:

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)
 

Function Documentation

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.

Parameters
[in]fptrFITS file pointer
[in]exclude_commif TRUE, exclude commentary keywords
[in]exclistlist of excluded keyword names
[in]nexcnumber of names in exclist
[out]headerreturned header string
[out]nkeysreturned number of 80-char keywords
[in,out]statuserror status

Here is the call graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]tdimstrTDIMn keyword value string. e.g. (10,10)
[in]colnumnumber of the column
[in]maxdimmaximum no. of dimensions to read;
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]tdimstrTDIMn keyword value string. e.g. (10,10)
[in]colnumnumber of the column
[in]maxdimmaximum no. of dimensions to read;
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int fffree ( void *  value,
int *  status 
)

Free the memory that was previously allocated by CFITSIO, such as by ffgkls or fits_hdr2str

Parameters
[in]valuepointer to keyword value
[in,out]statuserror 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.

Parameters
[in]fptrFITS file pointer
[out]valuecontinued string value
[out]commcontinued comment string
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgcrd ( fitsfile fptr,
const char *  name,
char *  card,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]namename of keyword to read
[out]cardkeyword card
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxfieldmaximum no. of columns to read;
[out]naxis2number of rows in the table
[out]tfieldsnumber of columns in the table
[out]ttypename of each column
[out]tformTFORMn value for each column
[out]tunitTUNITn value for each column
[out]extnmvalue of EXTNAME keyword, if any
[out]pcountvalue of PCOUNT keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxfieldmaximum no. of columns to read;
[out]naxis2number of rows in the table
[out]tfieldsnumber of columns in the table
[out]ttypename of each column
[out]tformTFORMn value for each column
[out]tunitTUNITn value for each column
[out]extnmvalue of EXTNAME keyword, if any
[out]pcountvalue of PCOUNT keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxdimmaximum no. of dimensions to read;
[out]simpledoes file conform to FITS standard? 1/0
[out]bitpixnumber of bits per data value pixel
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[out]pcountnumber of group parameters (usually 0)
[out]gcountnumber of random groups (usually 1 or 0)
[out]extendmay FITS file haave extensions?
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxdimmaximum no. of dimensions to read;
[out]simpledoes file conform to FITS standard? 1/0
[out]bitpixnumber of bits per data value pixel
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[out]pcountnumber of group parameters (usually 0)
[out]gcountnumber of random groups (usually 1 or 0)
[out]extendmay FITS file haave extensions?
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[out]nexistnumber of existing keywords in header
[out]nmoreposition of next keyword to be read
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[out]nexistnumber of existing keywords in header
[out]nmorehow many more keywords will fit
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxfieldmaximum no. of columns to read;
[out]naxis1length of table row in bytes
[out]naxis2number of rows in the table
[out]tfieldsnumber of columns in the table
[out]ttypename of each column
[out]tbcolbyte offset in row to each column
[out]tformvalue of TFORMn keyword for each column
[out]tunitvalue of TUNITn keyword for each column
[out]extnmvalue of EXTNAME keyword, if any
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxfieldmaximum no. of columns to read;
[out]naxis1length of table row in bytes
[out]naxis2number of rows in the table
[out]tfieldsnumber of columns in the table
[out]ttypename of each column
[out]tbcolbyte offset in row to each column
[out]tformvalue of TFORMn keyword for each column
[out]tunitvalue of TUNITn keyword for each column
[out]extnmvalue of EXTNAME keyword, if any
[in,out]statuserror status

Here is the call graph for this function:

int ffgkey ( fitsfile fptr,
const char *  keyname,
char *  keyval,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]keyvalkeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkls ( fitsfile fptr,
const char *  keyname,
char **  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuepointer to keyword value
[out]commkeyword comment (may be NULL)
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]cardkeyword card
[out]namename of the keyword
[out]lengthlength of the keyword name
[in,out]statuserror status

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynameroot name of keywords to read
[in]nstartstarting index number
[in]nmaxmaximum number of keywords to return
[out]valuearray of pointers to keyword values
[out]nfoundnumber of values that were returned
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgksl ( fitsfile fptr,
const char *  keyname,
int *  length,
int *  status 
)

Get the length of the keyword value string. This routine explicitly supports the CONTINUE convention for long string values.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]lengthlength of the string value
[in,out]statuserror status

Here is the call graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]datatypedatatype of the value
[in]keynamename of keyword to read
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkyc ( fitsfile fptr,
const char *  keyname,
float *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value (real,imag)
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkyd ( fitsfile fptr,
const char *  keyname,
double *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkye ( fitsfile fptr,
const char *  keyname,
float *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkyj ( fitsfile fptr,
const char *  keyname,
long *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkyjj ( fitsfile fptr,
const char *  keyname,
LONGLONG value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkyl ( fitsfile fptr,
const char *  keyname,
int *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[in]valuekeyword value
[in]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkym ( fitsfile fptr,
const char *  keyname,
double *  value,
char *  comm,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]valuekeyword value (real,imag)
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]nkeynumber of the keyword to read
[out]keynamename of the keyword
[out]valuekeyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgkys ( fitsfile fptr,
const char *  keyname,
char *  value,
char *  comm,
int *  status 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]ivalueinteger part of keyword value
[out]fractionfractional part of keyword value
[out]commkeyword comment
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgnky ( fitsfile fptr,
char *  card,
int *  status 
)

read the next keyword from the header - used internally by cfitsio

Parameters
[in]fptrFITS file pointer
[out]cardcard string
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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 '#').

Parameters
[in]fptrFITS file pointer
[in]inclistlist of included keyword names
[in]nincnumber of names in inclist
[in]exclistlist of excluded keyword names
[in]nexcnumber of names in exclist
[out]cardfirst matching keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]maxdimmaximum no. of dimensions to read;
[out]simpledoes file conform to FITS standard? 1/0
[out]bitpixnumber of bits per data value pixel
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[out]pcountnumber of group parameters (usually 0)
[out]gcountnumber of random groups (usually 1 or 0)
[out]extendmay FITS file haave extensions?
[out]bscalearray pixel linear scaling factor
[out]bzeroarray pixel linear scaling zero point
[out]blankvalue used to represent undefined pixels
[out]nspacenumber of blank keywords prior to END
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]nrecnumber of keyword to read
[out]cardkeyword card
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[in]firstcharfirst character of string to return
[in]maxcharmaximum length of string to return (string will be null terminated)
[out]valuepointer to keyword value
[out]valuelentotal 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]commkeyword comment (may be NULL)
[in,out]statuserror status

Here is the call graph for this function:

int ffgstr ( fitsfile fptr,
const char *  string,
char *  card,
int *  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.

Parameters
[in]fptrFITS file pointer
[in]string
[out]card
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
[in]fptrFITS file pointer
[in]colnumnumber of the column to read
[in]maxdimmaximum no. of dimensions to read;
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
[in]fptrFITS file pointer
[in]colnumnumber of the column to read
[in]maxdimmaximum no. of dimensions to read;
[out]naxisnumber of axes in the data array
[out]naxeslength of each data axis
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]numkeynumber of the keyword to read
[in]nameexpected name of the keyword
[out]valueinteger value of the keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgtknjj ( fitsfile fptr,
int  numkey,
char *  name,
LONGLONG 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.

Parameters
[in]fptrFITS file pointer
[in]numkeynumber of the keyword to read
[in]nameexpected name of the keyword
[out]valueinteger value of the keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[out]rowlenlength of a table row, in bytes
[out]nrowsnumber of rows in the table
[out]pcountvalue of PCOUNT keyword
[out]tfieldsnumber of fields in the table
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffgunt ( fitsfile fptr,
const char *  keyname,
char *  unit,
int *  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

Parameters
[in]fptrFITS file pointer
[in]keynamename of keyword to read
[out]unitkeyword units
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffh2st ( fitsfile fptr,
char **  header,
int *  status 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]exclude_commif TRUE, exclude commentary keywords
[in]exclistlist of excluded keyword names
[in]nexcnumber of names in exclist
[out]headerreturned header string
[out]nkeysreturned number of 80-char keywords
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffmaky ( fitsfile fptr,
int  nrec,
int *  status 
)
Parameters
[in]fptrFITS file pointer
[in]nrecone-based keyword number to move to
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

int ffmrky ( fitsfile fptr,
int  nmove,
int *  status 
)
Parameters
[in]fptrFITS file pointer
[in]nmoverelative number of keywords to move
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]fptrFITS file pointer
[in]numkeynumber of the keyword to read
[in]nameexpected name of the keyword
[in]valueexpected value of the keyword
[in,out]statuserror status

Here is the call graph for this function:

Here is the caller graph for this function: