cfitsio
3390
|
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <errno.h>
#include <stddef.h>
#include <locale.h>
#include "fitsio2.h"
Macros | |
#define | errmsgsiz 25 |
#define | ESMARKER 27 /* Escape character is used as error stack marker */ |
Escape character is used as error stack marker. More... | |
#define | DelAll 1 /* delete all messages on the error stack */ |
delete all messages on the error stack More... | |
#define | DelMark 2 /* delete newest messages back to and including marker */ |
delete newest messages back to and including marker More... | |
#define | DelNewest 3 /* delete the newest message from the stack */ |
delete the newest message from the stack More... | |
#define | GetMesg 4 /* pop and return oldest message, ignoring marks */ |
pop and return oldest message, ignoring marks More... | |
#define | PutMesg 5 /* add a new message to the stack */ |
add a new message to the stack More... | |
#define | PutMark 6 /* add a marker to the stack */ |
add a marker to the stack More... | |
Functions | |
float | ffvers (float *version) |
int | ffflnm (fitsfile *fptr, char *filename, int *status) |
int | ffflmd (fitsfile *fptr, int *filemode, int *status) |
void | ffgerr (int status, char *errtext) |
void | ffpmsg (const char *err_message) |
void | ffpmrk (void) |
int | ffgmsg (char *err_message) |
void | ffcmsg (void) |
void | ffcmrk (void) |
void | ffxmsg (int action, char *errmsg) |
int | ffpxsz (int datatype) |
int | fftkey (const char *keyword, int *status) |
int | fftrec (char *card, int *status) |
void | ffupch (char *string) |
int | ffmkky (const char *keyname, char *value, const char *comm, char *card, int *status) |
int | ffmkey (fitsfile *fptr, const char *card, int *status) |
int | ffkeyn (const char *keyroot, int value, char *keyname, int *status) |
int | ffnkey (int value, const char *keyroot, char *keyname, int *status) |
int | ffpsvc (char *card, char *value, char *comm, int *status) |
int | ffgthd (char *tmplt, char *card, int *hdtype, int *status) |
int | fits_translate_keyword (char *inrec, char *outrec, char *patterns[][2], int npat, int n_value, int n_offset, int n_range, int *pat_num, int *i, int *j, int *m, int *n, int *status) |
int | fits_translate_keywords (fitsfile *infptr, fitsfile *outfptr, int firstkey, char *patterns[][2], int npat, int n_value, int n_offset, int n_range, int *status) |
int | fits_copy_pixlist2image (fitsfile *infptr, fitsfile *outfptr, int firstkey, int naxis, int *colnum, int *status) |
int | fits_translate_pixkeyword (char *inrec, char *outrec, char *patterns[][2], int npat, int naxis, int *colnum, int *pat_num, int *i, int *j, int *n, int *m, int *l, int *status) |
int | ffasfm (char *tform, int *dtcode, long *twidth, int *decimals, int *status) |
int | ffbnfm (char *tform, int *dtcode, long *trepeat, long *twidth, int *status) |
int | ffbnfmll (char *tform, int *dtcode, LONGLONG *trepeat, long *twidth, int *status) |
void | ffcfmt (char *tform, char *cform) |
void | ffcdsp (char *tform, char *cform) |
int | ffgcno (fitsfile *fptr, int casesen, char *templt, int *colnum, int *status) |
int | ffgcnn (fitsfile *fptr, int casesen, char *templt, char *colname, int *colnum, int *status) |
void | ffcmps (char *templt, char *colname, int casesen, int *match, int *exact) |
int | ffgtcl (fitsfile *fptr, int colnum, int *typecode, long *repeat, long *width, int *status) |
int | ffgtclll (fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, LONGLONG *width, int *status) |
int | ffeqty (fitsfile *fptr, int colnum, int *typecode, long *repeat, long *width, int *status) |
int | ffeqtyll (fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, LONGLONG *width, int *status) |
int | ffgncl (fitsfile *fptr, int *ncols, int *status) |
int | ffgnrw (fitsfile *fptr, long *nrows, int *status) |
int | ffgnrwll (fitsfile *fptr, LONGLONG *nrows, int *status) |
int | ffgacl (fitsfile *fptr, int colnum, char *ttype, long *tbcol, char *tunit, char *tform, double *tscal, double *tzero, char *tnull, char *tdisp, int *status) |
int | ffgbcl (fitsfile *fptr, int colnum, char *ttype, char *tunit, char *dtype, long *repeat, double *tscal, double *tzero, long *tnull, char *tdisp, int *status) |
int | ffgbclll (fitsfile *fptr, int colnum, char *ttype, char *tunit, char *dtype, LONGLONG *repeat, double *tscal, double *tzero, LONGLONG *tnull, char *tdisp, int *status) |
int | ffghdn (fitsfile *fptr, int *chdunum) |
int | ffghadll (fitsfile *fptr, LONGLONG *headstart, LONGLONG *datastart, LONGLONG *dataend, int *status) |
int | ffghof (fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend, int *status) |
int | ffghad (fitsfile *fptr, long *headstart, long *datastart, long *dataend, int *status) |
int | ffrhdu (fitsfile *fptr, int *hdutype, int *status) |
int | ffpinit (fitsfile *fptr, int *status) |
int | ffainit (fitsfile *fptr, int *status) |
int | ffbinit (fitsfile *fptr, int *status) |
int | ffgabc (int tfields, char **tform, int space, long *rowlen, long *tbcol, int *status) |
int | ffgtbc (fitsfile *fptr, LONGLONG *totalwidth, int *status) |
int | ffgtbp (fitsfile *fptr, char *name, char *value, int *status) |
int | ffgcprll (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, LONGLONG nelem, int writemode, double *scale, double *zero, char *tform, long *twidth, int *tcode, int *maxelem, LONGLONG *startpos, LONGLONG *elemnum, long *incre, LONGLONG *repeat, LONGLONG *rowlen, int *hdutype, LONGLONG *tnull, char *snull, int *status) |
int | fftheap (fitsfile *fptr, LONGLONG *heapsz, LONGLONG *unused, LONGLONG *overlap, int *valid, int *status) |
int | ffcmph (fitsfile *fptr, int *status) |
int | ffgdes (fitsfile *fptr, int colnum, LONGLONG rownum, long *length, long *heapaddr, int *status) |
int | ffgdesll (fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG *length, LONGLONG *heapaddr, int *status) |
int | ffgdess (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, long *length, long *heapaddr, int *status) |
int | ffgdessll (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, LONGLONG *length, LONGLONG *heapaddr, int *status) |
int | ffpdes (fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG length, LONGLONG heapaddr, int *status) |
int | ffchdu (fitsfile *fptr, int *status) |
int | ffuptf (fitsfile *fptr, int *status) |
int | ffrdef (fitsfile *fptr, int *status) |
int | ffhdef (fitsfile *fptr, int morekeys, int *status) |
int | ffwend (fitsfile *fptr, int *status) |
int | ffpdfl (fitsfile *fptr, int *status) |
int | ffchfl (fitsfile *fptr, int *status) |
int | ffcdfl (fitsfile *fptr, int *status) |
int | ffcrhd (fitsfile *fptr, int *status) |
int | ffdblk (fitsfile *fptr, long nblocks, int *status) |
int | ffghdt (fitsfile *fptr, int *exttype, int *status) |
int | fits_is_reentrant (void) |
int | fits_is_compressed_image (fitsfile *fptr, int *status) |
int | ffgipr (fitsfile *infptr, int maxaxis, int *bitpix, int *naxis, long *naxes, int *status) |
int | ffgiprll (fitsfile *infptr, int maxaxis, int *bitpix, int *naxis, LONGLONG *naxes, int *status) |
int | ffgidt (fitsfile *fptr, int *imgtype, int *status) |
int | ffgiet (fitsfile *fptr, int *imgtype, int *status) |
int | ffgidm (fitsfile *fptr, int *naxis, int *status) |
int | ffgisz (fitsfile *fptr, int nlen, long *naxes, int *status) |
int | ffgiszll (fitsfile *fptr, int nlen, LONGLONG *naxes, int *status) |
int | ffmahd (fitsfile *fptr, int hdunum, int *exttype, int *status) |
int | ffmrhd (fitsfile *fptr, int hdumov, int *exttype, int *status) |
int | ffmnhd (fitsfile *fptr, int exttype, char *hduname, int hduver, int *status) |
int | ffthdu (fitsfile *fptr, int *nhdu, int *status) |
int | ffgext (fitsfile *fptr, int hdunum, int *exttype, int *status) |
int | ffiblk (fitsfile *fptr, long nblock, int headdata, int *status) |
int | ffgkcl (char *tcard) |
int | ffdtyp (const char *cval, char *dtype, int *status) |
int | ffinttyp (char *cval, int *dtype, int *negative, int *status) |
int | ffc2x (const char *cval, char *dtype, long *ival, int *lval, char *sval, double *dval, int *status) |
int | ffc2xx (const char *cval, char *dtype, LONGLONG *ival, int *lval, char *sval, double *dval, int *status) |
int | ffc2i (const char *cval, long *ival, int *status) |
int | ffc2j (const char *cval, LONGLONG *ival, int *status) |
int | ffc2l (const char *cval, int *lval, int *status) |
int | ffc2r (const char *cval, float *fval, int *status) |
int | ffc2d (const char *cval, double *dval, int *status) |
int | ffc2ii (const char *cval, long *ival, int *status) |
int | ffc2jj (const char *cval, LONGLONG *ival, int *status) |
int | ffc2ll (const char *cval, int *lval, int *status) |
int | ffc2s (const char *instr, char *outstr, int *status) |
int | ffc2rr (const char *cval, float *fval, int *status) |
int | ffc2dd (const char *cval, double *dval, int *status) |
Variables | |
int | STREAM_DRIVER = 0 |
struct lconv * | lcxxx |
#define DelAll 1 /* delete all messages on the error stack */ |
delete all messages on the error stack
#define DelMark 2 /* delete newest messages back to and including marker */ |
delete newest messages back to and including marker
#define DelNewest 3 /* delete the newest message from the stack */ |
delete the newest message from the stack
#define errmsgsiz 25 |
#define ESMARKER 27 /* Escape character is used as error stack marker */ |
Escape character is used as error stack marker.
#define GetMesg 4 /* pop and return oldest message, ignoring marks */ |
pop and return oldest message, ignoring marks
#define PutMark 6 /* add a marker to the stack */ |
add a marker to the stack
#define PutMesg 5 /* add a new message to the stack */ |
add a new message to the stack
int ffainit | ( | fitsfile * | fptr, |
int * | status | ||
) |
initialize the parameters defining the structure of an ASCII table
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffasfm | ( | char * | tform, |
int * | dtcode, | ||
long * | twidth, | ||
int * | decimals, | ||
int * | status | ||
) |
parse the ASCII table TFORM column format to determine the data type, the field width, and number of decimal places (if relevant)
[in] | tform | format code from the TFORMn keyword |
[out] | dtcode | numerical datatype code |
[out] | twidth | width of the field, in chars |
[out] | decimals | number of decimal places (F, E, D format) |
[in,out] | status | error status |
int ffbinit | ( | fitsfile * | fptr, |
int * | status | ||
) |
initialize the parameters defining the structure of a binary table
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffbnfm | ( | char * | tform, |
int * | dtcode, | ||
long * | trepeat, | ||
long * | twidth, | ||
int * | status | ||
) |
parse the binary table TFORM column format to determine the data type, repeat count, and the field width (if it is an ASCII (A) field)
[in] | tform | format code from the TFORMn keyword |
[out] | dtcode | numerical datatype code |
[out] | trepeat | repeat count of the field |
[out] | twidth | width of the field, in chars |
[in,out] | status | error status |
int ffbnfmll | ( | char * | tform, |
int * | dtcode, | ||
LONGLONG * | trepeat, | ||
long * | twidth, | ||
int * | status | ||
) |
parse the binary table TFORM column format to determine the data type, repeat count, and the field width (if it is an ASCII (A) field)
[in] | tform | format code from the TFORMn keyword |
[out] | dtcode | numerical datatype code |
[out] | trepeat | repeat count of the field |
[out] | twidth | width of the field, in chars |
[in,out] | status | error status |
int ffc2d | ( | const char * | cval, |
double * | dval, | ||
int * | status | ||
) |
convert formatted string to a double value, doing implicit datatype conversion if necessary
[in] | cval | string representation of the value |
[out] | dval | numerical value of the input string |
[in,out] | status | error status |
int ffc2dd | ( | const char * | cval, |
double * | dval, | ||
int * | status | ||
) |
convert null-terminated formatted string to a double value
[in] | cval | string representation of the value |
[out] | dval | numerical value of the input string |
[in,out] | status | error status |
int ffc2i | ( | const char * | cval, |
long * | ival, | ||
int * | status | ||
) |
convert formatted string to an integer value, doing implicit datatype conversion if necessary.
[in] | cval | string representation of the value |
[out] | ival | numerical value of the input string |
[in,out] | status | error status |
int ffc2ii | ( | const char * | cval, |
long * | ival, | ||
int * | status | ||
) |
convert null-terminated formatted string to an integer value
[in] | cval | string representation of the value |
[out] | ival | numerical value of the input string |
[in,out] | status | error status |
convert formatted string to a LONGLONG integer value, doing implicit datatype conversion if necessary.
[in] | cval | string representation of the value |
[out] | ival | numerical value of the input string |
[in,out] | status | error status |
convert null-terminated formatted string to an long long integer value
[in] | cval | string representation of the value |
[out] | ival | numerical value of the input string |
[in,out] | status | error status |
int ffc2l | ( | const char * | cval, |
int * | lval, | ||
int * | status | ||
) |
convert formatted string to a logical value, doing implicit datatype conversion if necessary
[in] | cval | string representation of the value |
[out] | lval | numerical value of the input string |
[in,out] | status | error status |
int ffc2ll | ( | const char * | cval, |
int * | lval, | ||
int * | status | ||
) |
convert null-terminated formatted string to a logical value
[in] | cval | string representation of the value: T or F |
[out] | lval | numerical value of the input string: 1 or 0 |
[in,out] | status | error status |
int ffc2r | ( | const char * | cval, |
float * | fval, | ||
int * | status | ||
) |
convert formatted string to a real float value, doing implicit datatype conversion if necessary
[in] | cval | string representation of the value |
[out] | fval | numerical value of the input string |
[in,out] | status | error status |
int ffc2rr | ( | const char * | cval, |
float * | fval, | ||
int * | status | ||
) |
convert null-terminated formatted string to a float value
[in] | cval | string representation of the value |
[out] | fval | numerical value of the input string |
[in,out] | status | error status |
int ffc2s | ( | const char * | instr, |
char * | outstr, | ||
int * | status | ||
) |
convert an input quoted string to an unquoted string by removing the leading and trailing quote character. Also, replace any pairs of single quote characters with just a single quote character (FITS used a pair of single quotes to represent a literal quote character within the string).
[in] | instr | null terminated quoted input string |
[out] | outstr | null terminated output string without quotes |
[in,out] | status | error status |
int ffc2x | ( | const char * | cval, |
char * | dtype, | ||
long * | ival, | ||
int * | lval, | ||
char * | sval, | ||
double * | dval, | ||
int * | status | ||
) |
high level routine to convert formatted character string to its intrinsic data type
[in] | cval | formatted string representation of the value |
[out] | dtype | datatype code: C, L, F, I or X Only one of the 5 pointer value will be defined, depending on datatype |
[out] | ival | integer value |
[out] | lval | logical value |
[out] | sval | string value |
[out] | dval | double value |
[in,out] | status | error status |
int ffc2xx | ( | const char * | cval, |
char * | dtype, | ||
LONGLONG * | ival, | ||
int * | lval, | ||
char * | sval, | ||
double * | dval, | ||
int * | status | ||
) |
high level routine to convert formatted character string to its intrinsic data type
[in] | cval | formatted string representation of the value |
[out] | dtype | datatype code: C, L, F, I or X Only one of the 5 pointer value will be defined, depending on datatype |
[out] | ival | integer value |
[out] | lval | logical value |
[out] | sval | string value |
[out] | dval | double value |
[in,out] | status | error status |
int ffcdfl | ( | fitsfile * | fptr, |
int * | status | ||
) |
void ffcdsp | ( | char * | tform, |
char * | cform | ||
) |
convert the FITS TDISPn display format into the equivalent C format suitable for use in a printf statement.
tform | value of an ASCII table TFORMn keyword |
cform | equivalent format code in C language syntax |
void ffcfmt | ( | char * | tform, |
char * | cform | ||
) |
convert the FITS format string for an ASCII Table extension column into the equivalent C format string that can be used in a printf statement, after the values have been read as a double.
tform | value of an ASCII table TFORMn keyword |
cform | equivalent format code in C language syntax |
int ffchdu | ( | fitsfile * | fptr, |
int * | status | ||
) |
close the current HDU. If we have write access to the file, then:
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffchfl | ( | fitsfile * | fptr, |
int * | status | ||
) |
Check Header Fill values
Check that the header unit is correctly filled with blanks from the END card to the end of the current FITS 2880-byte block Translated ftchfl into C by Peter Wilson, Oct. 1997
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffcmph | ( | fitsfile * | fptr, |
int * | status | ||
) |
compress the binary table heap by reordering the contents heap and recovering any unused space
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
void ffcmps | ( | char * | templt, |
char * | colname, | ||
int | casesen, | ||
int * | match, | ||
int * | exact | ||
) |
compare the template to the string and test if they match. The strings are limited to 68 characters or less (the max. length of a FITS string keyword value. This routine reports whether the two strings match and whether the match is exact or involves wildcards.
This algorithm is very similar to the way unix filename wildcards work except that this first treats a wild card as a literal character when looking for a match. If there is no literal match, then it interpretes it as a wild card. So the template 'AB*DE' is considered to be an exact rather than a wild card match to the string 'AB*DE'. The '#' wild card in the template string will match any consecutive string of decimal digits in the colname.
[in] | templt | input template (may have wildcards) |
[in] | colname | full column name up to 68 + 1 chars long |
[in] | casesen | case sensitive string comparison? 1=yes |
[out] | match | do template and colname match? 1=yes |
[out] | exact) | do strings exactly match, or wildcards |
void ffcmrk | ( | void | ) |
erase newest messages in the error stack, stopping if a marker is found. The marker is also erased in this case.
void ffcmsg | ( | void | ) |
erase all messages in the error stack
int ffcrhd | ( | fitsfile * | fptr, |
int * | status | ||
) |
int ffdblk | ( | fitsfile * | fptr, |
long | nblocks, | ||
int * | status | ||
) |
Delete the specified number of 2880-byte blocks from the end of the CHDU by shifting all following extensions up this number of blocks.
[in] | fptr | FITS file pointer |
[in] | nblocks | number of 2880-byte blocks to delete |
[in,out] | status | error status |
int ffdtyp | ( | const char * | cval, |
char * | dtype, | ||
int * | status | ||
) |
determine implicit datatype of input string. This assumes that the string conforms to the FITS standard for keyword values, so may not detect all invalid formats.
[in] | cval | formatted string representation of the value |
[out] | dtype | datatype code: C, L, F, I, or X |
[in,out] | status | error status |
int ffeqty | ( | fitsfile * | fptr, |
int | colnum, | ||
int * | typecode, | ||
long * | repeat, | ||
long * | width, | ||
int * | status | ||
) |
Get the 'equivalent' table column type.
This routine is similar to the ffgtcl routine (which returns the physical datatype of the column, as stored in the FITS file) except that if the TSCALn and TZEROn keywords are defined for the column, then it returns the 'equivalent' datatype. Thus, if the column is defined as '1I' (short integer) this routine may return the type as 'TUSHORT' or as 'TFLOAT' depending on the TSCALn and TZEROn values.
Returns the datatype code of the column, as well as the vector repeat count and (if it is an ASCII character column) the width of the field or a unit string within the field. This supports the TFORMn = 'rAw' syntax for specifying arrays of substrings, so if TFORMn = '60A12' then repeat = 60 and width = 12.
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | typecode | datatype code (21 = short, etc) |
[out] | repeat | repeat count of field |
[out] | width | if ASCII, width of field or unit string |
[in,out] | status | error status |
int ffeqtyll | ( | fitsfile * | fptr, |
int | colnum, | ||
int * | typecode, | ||
LONGLONG * | repeat, | ||
LONGLONG * | width, | ||
int * | status | ||
) |
Get the 'equivalent' table column type.
This routine is similar to the ffgtcl routine (which returns the physical datatype of the column, as stored in the FITS file) except that if the TSCALn and TZEROn keywords are defined for the column, then it returns the 'equivalent' datatype. Thus, if the column is defined as '1I' (short integer) this routine may return the type as 'TUSHORT' or as 'TFLOAT' depending on the TSCALn and TZEROn values.
Returns the datatype code of the column, as well as the vector repeat count and (if it is an ASCII character column) the width of the field or a unit string within the field. This supports the TFORMn = 'rAw' syntax for specifying arrays of substrings, so if TFORMn = '60A12' then repeat = 60 and width = 12.
[in] | fptr | file pointer |
[in] | colnum | column number |
[out] | typecode | datatype code (21 = short, etc) |
[out] | repeat | repeat count of field |
[out] | width | if ASCII, width of field or unit string |
[in,out] | status | error status |
int ffflmd | ( | fitsfile * | fptr, |
int * | filemode, | ||
int * | status | ||
) |
return the access mode of the FITS file
[in] | fptr | FITS file pointer |
[out] | filemode | open mode of the file |
[in,out] | status | error status |
int ffflnm | ( | fitsfile * | fptr, |
char * | filename, | ||
int * | status | ||
) |
return the name of the FITS file
[in] | fptr | FITS file pointer |
[out] | filename | name of the file |
[in,out] | status | error status |
int ffgabc | ( | int | tfields, |
char ** | tform, | ||
int | space, | ||
long * | rowlen, | ||
long * | tbcol, | ||
int * | status | ||
) |
calculate the starting byte offset of each column of an ASCII table and the total length of a row, in bytes. The input space value determines how many blank spaces to leave between each column (1 is recommended).
[in] | tfields | number of columns in the table |
[in] | tform | value of TFORMn keyword for each column |
[in] | space | number of spaces to leave between cols |
[out] | rowlen | total width of a table row |
[out] | tbcol | starting byte in row for each column |
[in,out] | status | error status |
int ffgacl | ( | fitsfile * | fptr, |
int | colnum, | ||
char * | ttype, | ||
long * | tbcol, | ||
char * | tunit, | ||
char * | tform, | ||
double * | tscal, | ||
double * | tzero, | ||
char * | tnull, | ||
char * | tdisp, | ||
int * | status | ||
) |
get ASCII column keyword values
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | ttype | TTYPEn keyword value |
[out] | tbcol | TBCOLn keyword value |
[out] | tunit | TUNITn keyword value |
[out] | tform | TFORMn keyword value |
[out] | tscal | TSCALn keyword value |
[out] | tzero | TZEROn keyword value |
[out] | tnull | TNULLn keyword value |
[out] | tdisp | TDISPn keyword value |
[in,out] | status | error status |
int ffgbcl | ( | fitsfile * | fptr, |
int | colnum, | ||
char * | ttype, | ||
char * | tunit, | ||
char * | dtype, | ||
long * | repeat, | ||
double * | tscal, | ||
double * | tzero, | ||
long * | tnull, | ||
char * | tdisp, | ||
int * | status | ||
) |
get BINTABLE column keyword values
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | ttype | TTYPEn keyword value |
[out] | tunit | TUNITn keyword value |
[out] | dtype | datatype char: I, J, E, D, etc. |
[out] | repeat | vector column repeat count |
[out] | tscal | TSCALn keyword value |
[out] | tzero | TZEROn keyword value |
[out] | tnull | TNULLn keyword value integer cols only |
[out] | tdisp | TDISPn keyword value |
[in,out] | status | error status |
int ffgbclll | ( | fitsfile * | fptr, |
int | colnum, | ||
char * | ttype, | ||
char * | tunit, | ||
char * | dtype, | ||
LONGLONG * | repeat, | ||
double * | tscal, | ||
double * | tzero, | ||
LONGLONG * | tnull, | ||
char * | tdisp, | ||
int * | status | ||
) |
get BINTABLE column keyword values
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | ttype | TTYPEn keyword value |
[out] | tunit | TUNITn keyword value |
[out] | dtype | datatype char: I, J, E, D, etc. |
[out] | repeat | vector column repeat count |
[out] | tscal | TSCALn keyword value |
[out] | tzero | TZEROn keyword value |
[out] | tnull | TNULLn keyword value integer cols only |
[out] | tdisp | TDISPn keyword value |
[in,out] | status | error status |
int ffgcnn | ( | fitsfile * | fptr, |
int | casesen, | ||
char * | templt, | ||
char * | colname, | ||
int * | colnum, | ||
int * | status | ||
) |
Return the full column name and column number of the next column whose TTYPEn keyword value matches the input template string. The template may contain the * and ? wildcards. Status = 237 is returned if the match is not unique. If so, one may call this routine again with input status=237 to get the next match. A status value of 219 is returned when there are no more matching columns.
[in] | fptr | FITS file pointer |
[in] | casesen | case sensitive string comparison? 0=no |
[in] | templt | input name of column (w/wildcards) |
[out] | colname | full column name up to 68 + 1 chars long |
[out] | colnum | number of the named column; 1=first col |
[in,out] | status | error status |
int ffgcno | ( | fitsfile * | fptr, |
int | casesen, | ||
char * | templt, | ||
int * | colnum, | ||
int * | status | ||
) |
Determine the column number corresponding to an input column name. The first column of the table = column 1; This supports the * and ? wild cards in the input template.
[in] | fptr | FITS file pionter |
[in] | casesen | case sensitive string comparison? 0=no |
[in] | templt | input name of column (w/wildcards) |
[out] | colnum | number of the named column; 1=first col |
[in,out] | status | error status |
int ffgcprll | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | firstrow, | ||
LONGLONG | firstelem, | ||
LONGLONG | nelem, | ||
int | writemode, | ||
double * | scale, | ||
double * | zero, | ||
char * | tform, | ||
long * | twidth, | ||
int * | tcode, | ||
int * | maxelem, | ||
LONGLONG * | startpos, | ||
LONGLONG * | elemnum, | ||
long * | incre, | ||
LONGLONG * | repeat, | ||
LONGLONG * | rowlen, | ||
int * | hdutype, | ||
LONGLONG * | tnull, | ||
char * | snull, | ||
int * | status | ||
) |
Get Column PaRameters, and test starting row and element numbers for validity. This is a workhorse routine that is call by nearly every other routine that reads or writes to FITS files.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | firstrow | first row (1 = 1st row of table) |
[in] | firstelem | first element within vector (1 = 1st) |
[in] | nelem | number of elements to read or write |
[in] | writemode | = 1 if writing data, = 0 if reading data If = 2, then writing data, but don't modify the returned values of repeat and incre. If = -1, then reading data in reverse direction. |
[out] | scale | FITS scaling factor (TSCALn keyword value) |
[out] | zero | FITS scaling zero pt (TZEROn keyword value) |
[out] | tform | ASCII column format: value of TFORMn keyword |
[out] | twidth | width of ASCII column (characters) |
[out] | tcode | column datatype code: I*4=41, R*4=42, etc |
[out] | maxelem | max number of elements that fit in buffer |
[out] | startpos | offset in file to starting row & column |
[out] | elemnum | starting element number ( 0 = 1st element) |
[out] | incre | byte offset between elements within a row |
[out] | repeat | number of elements in a row (vector column) |
[out] | rowlen | length of a row, in bytes |
[out] | hdutype | HDU type: 0, 1, 2 = primary, table, bintable |
[out] | tnull | null value for integer columns |
[out] | snull | null value for ASCII table columns |
[in,out] | status | error status |
int ffgdes | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | rownum, | ||
long * | length, | ||
long * | heapaddr, | ||
int * | status | ||
) |
get (read) the variable length vector descriptor from the table.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | rownum | row number (1 = 1st row of table) |
[in] | length | number of elements in the row |
[in] | heapaddr | heap pointer to the data |
[in] | status | error status |
int ffgdesll | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | rownum, | ||
LONGLONG * | length, | ||
LONGLONG * | heapaddr, | ||
int * | status | ||
) |
get (read) the variable length vector descriptor from the binary table. This is similar to ffgdes, except it supports the full 8-byte range of the length and offset values in 'Q' columns, as well as 'P' columns.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | rownum | row number (1 = 1st row of table) |
[out] | length | number of elements in the row |
[out] | heapaddr | heap pointer to the data |
[in,out] | *status | error status |
int ffgdess | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | firstrow, | ||
LONGLONG | nrows, | ||
long * | length, | ||
long * | heapaddr, | ||
int * | status | ||
) |
get (read) a range of variable length vector descriptors from the table.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | firstrow | first row (1 = 1st row of table) |
[in] | nrows | number or rows to read |
[out] | length | number of elements in the row |
[out] | heapaddr | heap pointer to the data |
[in,out] | status | error status |
int ffgdessll | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | firstrow, | ||
LONGLONG | nrows, | ||
LONGLONG * | length, | ||
LONGLONG * | heapaddr, | ||
int * | status | ||
) |
get (read) a range of variable length vector descriptors from the table.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | firstrow | first row (1 = 1st row of table) |
[in] | nrows | number or rows to read |
[out] | length | number of elements in the row |
[out] | heapaddr | heap pointer to the data |
[in,out] | status | error status |
void ffgerr | ( | int | status, |
char * | errtext | ||
) |
Return a short descriptive error message that corresponds to the input error status value. The message may be up to 30 characters long, plus the terminating null character.
[in] | status | error status value |
[out] | errtext | error message (max 30 char long + null) |
int ffgext | ( | fitsfile * | fptr, |
int | hdunum, | ||
int * | exttype, | ||
int * | status | ||
) |
Get Extension. Move to the specified extension and initialize the HDU structure.
[in] | fptr | FITS file pointer |
[in] | hdunum | no. of HDU to move get (0 based) |
[out] | exttype | type of extension, 0, 1, or 2 |
[in,out] | status | error status |
int ffghad | ( | fitsfile * | fptr, |
long * | headstart, | ||
long * | datastart, | ||
long * | dataend, | ||
int * | status | ||
) |
Return the address (= byte offset) in the FITS file to the beginning of the current HDU, the beginning of the data unit, and the end of the data unit.
[in] | fptr | FITS file pointer |
[out] | headstart | byte offset to beginning of CHDU |
[out] | datastart | byte offset to beginning of next HDU |
[out] | dataend | byte offset to beginning of next HDU |
[in,out] | status | error status |
int ffghadll | ( | fitsfile * | fptr, |
LONGLONG * | headstart, | ||
LONGLONG * | datastart, | ||
LONGLONG * | dataend, | ||
int * | status | ||
) |
Return the address (= byte offset) in the FITS file to the beginning of the current HDU, the beginning of the data unit, and the end of the data unit.
[in] | fptr | FITS file pointer |
[out] | headstart | byte offset to beginning of CHDU |
[out] | datastart | byte offset to beginning of next HDU |
[out] | dataend | byte offset to beginning of next HDU |
[in,out] | status | error status |
int ffghdn | ( | fitsfile * | fptr, |
int * | chdunum | ||
) |
Return the number of the Current HDU in the FITS file. The primary array is HDU number 1. Note that this is one of the few cfitsio routines that does not return the error status value as the value of the function.
[in] | fptr | FITS file pointer |
[out] | chdunum | number of the CHDU; 1 = primary array |
int ffghdt | ( | fitsfile * | fptr, |
int * | exttype, | ||
int * | status | ||
) |
Return the type of the CHDU. This returns the 'logical' type of the HDU, not necessarily the physical type, so in the case of a compressed image stored in a binary table, this will return the type as an Image, not a binary table.
[in] | fptr | FITS file pointer |
[out] | exttype | type of extension, 0, 1, or 2 for IMAGE_HDU, ASCII_TBL, or BINARY_TBL |
[in,out] | status | error status |
Return the address (= byte offset) in the FITS file to the beginning of the current HDU, the beginning of the data unit, and the end of the data unit.
[in] | fptr | FITS file pointer |
[out] | headstart | byte offset to beginning of CHDU |
[out] | datastart | byte offset to beginning of next HDU |
[out] | dataend | byte offset to beginning of next HDU |
[in,out] | status | error status |
int ffgidm | ( | fitsfile * | fptr, |
int * | naxis, | ||
int * | status | ||
) |
Get the dimension of the image (= NAXIS keyword for normal image, or ZNAXIS for a compressed image) These values are cached for faster access.
[in] | fptr | FITS file pointer |
[out] | naxis | image dimension (NAXIS value) |
[in,out] | status | error status |
int ffgidt | ( | fitsfile * | fptr, |
int * | imgtype, | ||
int * | status | ||
) |
Get the datatype of the image (= BITPIX keyword for normal image, or ZBITPIX for a compressed image)
[in] | fptr | FITS file pointer |
[out] | imgtype | image data type |
[in,out] | status | error status |
int ffgiet | ( | fitsfile * | fptr, |
int * | imgtype, | ||
int * | status | ||
) |
Get the effective datatype of the image (= BITPIX keyword for normal image, or ZBITPIX for a compressed image)
[in] | fptr | FITS file pointer |
[out] | imgtype | image data type |
[in,out] | status | error status |
int ffgipr | ( | fitsfile * | infptr, |
int | maxaxis, | ||
int * | bitpix, | ||
int * | naxis, | ||
long * | naxes, | ||
int * | status | ||
) |
get the datatype and size of the input image
[in] | infptr | FITS file pointer |
[in] | maxaxis | max number of axes to return |
[out] | bitpix | image data type |
[out] | naxis | image dimension (NAXIS value) |
[out] | naxes | size of image dimensions |
[in,out] | status | error status |
int ffgiprll | ( | fitsfile * | infptr, |
int | maxaxis, | ||
int * | bitpix, | ||
int * | naxis, | ||
LONGLONG * | naxes, | ||
int * | status | ||
) |
get the datatype and size of the input image
[in] | infptr | FITS file pointer |
[in] | maxaxis | max number of axes to return |
[out] | bitpix | image data type |
[out] | naxis | image dimension (NAXIS value) |
[out] | naxes | size of image dimensions |
[in,out] | status | error status |
int ffgisz | ( | fitsfile * | fptr, |
int | nlen, | ||
long * | naxes, | ||
int * | status | ||
) |
Get the size of the image dimensions (= NAXISn keywords for normal image, or ZNAXISn for a compressed image) These values are cached for faster access.
[in] | fptr | FITS file pointer |
[in] | nlen | number of axes to return |
[out] | naxes | size of image dimensions |
[in,out] | status | error status |
Get the size of the image dimensions (= NAXISn keywords for normal image, or ZNAXISn for a compressed image)
[in] | fptr | FITS file pointer |
[in] | nlen | number of axes to return |
[out] | naxes | size of image dimensions |
[in,out] | status | error status |
int ffgkcl | ( | char * | tcard | ) |
Return the type classification of the input header record
TYP_STRUC_KEY: SIMPLE, BITPIX, NAXIS, NAXISn, EXTEND, BLOCKED, GROUPS, PCOUNT, GCOUNT, END XTENSION, TFIELDS, TTYPEn, TBCOLn, TFORMn, THEAP, and the first 4 COMMENT keywords in the primary array that define the FITS format.
TYP_CMPRS_KEY: The keywords used in the compressed image format ZIMAGE, ZCMPTYPE, ZNAMEn, ZVALn, ZTILEn, ZBITPIX, ZNAXISn, ZSCALE, ZZERO, ZBLANK, EXTNAME = 'COMPRESSED_IMAGE' ZSIMPLE, ZTENSION, ZEXTEND, ZBLOCKED, ZPCOUNT, ZGCOUNT ZQUANTIZ, ZDITHER0
TYP_SCAL_KEY: BSCALE, BZERO, TSCALn, TZEROn
TYP_NULL_KEY: BLANK, TNULLn
TYP_DIM_KEY: TDIMn
TYP_RANG_KEY: TLMINn, TLMAXn, TDMINn, TDMAXn, DATAMIN, DATAMAX
TYP_UNIT_KEY: BUNIT, TUNITn
TYP_DISP_KEY: TDISPn
TYP_HDUID_KEY: EXTNAME, EXTVER, EXTLEVEL, HDUNAME, HDUVER, HDULEVEL
TYP_CKSUM_KEY CHECKSUM, DATASUM
TYP_WCS_KEY: Primary array: WCAXES, CTYPEn, CUNITn, CRVALn, CRPIXn, CROTAn, CDELTn CDj_is, PVj_ms, LONPOLEs, LATPOLEs
Pixel list: TCTYPn, TCTYns, TCUNIn, TCUNns, TCRVLn, TCRVns, TCRPXn, TCRPks, TCDn_k, TCn_ks, TPVn_m, TPn_ms, TCDLTn, TCROTn
Bintable vector: jCTYPn, jCTYns, jCUNIn, jCUNns, jCRVLn, jCRVns, iCRPXn, iCRPns, jiCDn, jiCDns, jPVn_m, jPn_ms, jCDLTn, jCROTn
TYP_REFSYS_KEY: EQUINOXs, EPOCH, MJD-OBSs, RADECSYS, RADESYSs
TYP_COMM_KEY: COMMENT, HISTORY, (blank keyword)
TYP_CONT_KEY: CONTINUE
TYP_USER_KEY: all other keywords
int ffgmsg | ( | char * | err_message | ) |
get oldest message from error stack, ignoring markers
int ffgncl | ( | fitsfile * | fptr, |
int * | ncols, | ||
int * | status | ||
) |
Get the number of columns in the table (= TFIELDS keyword)
[in] | fptr | FITS file pointer |
[out] | ncols | number of columns in the table |
[in,out] | status | error status |
int ffgnrw | ( | fitsfile * | fptr, |
long * | nrows, | ||
int * | status | ||
) |
Get the number of rows in the table (= NAXIS2 keyword)
[in] | fptr | FITS file pointer |
[out] | nrows | number of rows in the table |
[in,out] | status | error status |
Get the number of rows in the table (= NAXIS2 keyword)
[in] | fptr | FITS file pointer |
[out] | nrows | number of rows in the table |
[in,out] | status | error status |
calculate the starting byte offset of each column of a binary table. Use the values of the datatype code and repeat counts in the column structure. Return the total length of a row, in bytes.
[in] | fptr | FITS file pointer |
[out] | totalwidth | total width of a table row |
[in,out] | status | error status |
int ffgtbp | ( | fitsfile * | fptr, |
char * | name, | ||
char * | value, | ||
int * | status | ||
) |
Get TaBle Parameter. The input keyword name begins with the letter T. Test if the keyword is one of the table column definition keywords of an ASCII or binary table. If so, decode it and update the value in the structure.
[in] | fptr | FITS file pointer |
[in] | name | name of the keyword |
[in] | value | value string of the keyword |
[in,out] | status | error status |
int ffgtcl | ( | fitsfile * | fptr, |
int | colnum, | ||
int * | typecode, | ||
long * | repeat, | ||
long * | width, | ||
int * | status | ||
) |
Get Type of table column. Returns the datatype code of the column, as well as the vector repeat count and (if it is an ASCII character column) the width of the field or a unit string within the field. This supports the TFORMn = 'rAw' syntax for specifying arrays of substrings, so if TFORMn = '60A12' then repeat = 60 and width = 12.
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | typecode | datatype code (21 = short, etc) |
[out] | repeat | repeat count of field |
[out] | width | if ASCII, width of field or unit string |
[in,out] | status | error status |
int ffgtclll | ( | fitsfile * | fptr, |
int | colnum, | ||
int * | typecode, | ||
LONGLONG * | repeat, | ||
LONGLONG * | width, | ||
int * | status | ||
) |
Get Type of table column. Returns the datatype code of the column, as well as the vector repeat count and (if it is an ASCII character column) the width of the field or a unit string within the field. This supports the TFORMn = 'rAw' syntax for specifying arrays of substrings, so if TFORMn = '60A12' then repeat = 60 and width = 12.
[in] | fptr | FITS file pointer |
[in] | colnum | column number |
[out] | typecode | datatype code (21 = short, etc) |
[out] | repeat | repeat count of field |
[out] | width | if ASCII, width of field or unit string |
[in,out] | status | error status |
int ffgthd | ( | char * | tmplt, |
char * | card, | ||
int * | hdtype, | ||
int * | status | ||
) |
'Get Template HeaDer' parse a template header line and create a formated character string which is suitable for appending to a FITS header
[in] | tmplt | input header template string |
[out] | card | returned FITS header record |
[out] | hdtype | how to interpreter the returned card string -2 = modify the name of a keyword; the old keyword name is returned starting at address chars[0]; the new name is returned starting at address char[40] (to be consistent with the Fortran version). Both names are null terminated. -1 = card contains the name of a keyword that is to be deleted 0 = append this keyword if it doesn't already exist, or modify the value if the keyword already exists. 1 = append this comment keyword ('HISTORY', 'COMMENT', or blank keyword name) 2 = this is the END keyword; do not write it to the header |
[in,out] | status | error status |
int ffhdef | ( | fitsfile * | fptr, |
int | morekeys, | ||
int * | status | ||
) |
based on the number of keywords which have already been written, plus the number of keywords to reserve space for, we then can define where the data unit should start (it must start at the beginning of a 2880-byte logical block).
This routine will only have any effect if the starting location of the data unit following the header is not already defined. In any case, it is always possible to add more keywords to the header even if the data has already been written. It is just more efficient to reserve the space in advance.
[in] | fptr | FITS file pointer |
[in] | morekeys | reserve space for this many keywords |
[in,out] | status | error status |
int ffiblk | ( | fitsfile * | fptr, |
long | nblock, | ||
int | headdata, | ||
int * | status | ||
) |
insert 2880-byte blocks at the end of the current header or data unit
[in] | fptr | FITS file pointer |
[in] | nblock | no. of blocks to insert |
[in] | headdata | insert where? 0=header, 1=data -1=beginning of file |
[in,out] | status | error status |
int ffinttyp | ( | char * | cval, |
int * | dtype, | ||
int * | negative, | ||
int * | status | ||
) |
determine implicit datatype of input integer string. This assumes that the string conforms to the FITS standard for integer keyword value, so may not detect all invalid formats.
[in] | cval | formatted string representation of the integer |
[out] | dtype | datatype code: TBYTE, TSHORT, TUSHORT, etc |
[out] | negative | is cval negative? |
[in,out] | status | error status |
int ffkeyn | ( | const char * | keyroot, |
int | value, | ||
char * | keyname, | ||
int * | status | ||
) |
Construct a keyword name string by appending the index number to the root. e.g., if root = "TTYPE" and value = 12 then keyname = "TTYPE12". Note: this allows keyword names longer than 8 characters.
[in] | keyroot | root string for keyword name keyword name |
[in] | value | index number to be appended to root name |
[out] | keyname | output root + index keyword name |
[in,out] | status | error status |
int ffmahd | ( | fitsfile * | fptr, |
int | hdunum, | ||
int * | exttype, | ||
int * | status | ||
) |
Move to Absolute Header Data unit. Move to the specified HDU and read the header to initialize the table structure. Note that extnum is one based, so the primary array is extnum = 1.
[in] | fptr | FITS file pointer |
[in] | hdunum | number of the HDU to move to |
[out] | exttype | type of extension, 0, 1, or 2 |
[in,out] | status | error status |
replace the previously read card (i.e. starting 80 bytes before the (fptr->Fptr)->nextkey position) with the contents of the input card.
[in] | fptr | FITS file pointer |
[in] | card | string value |
[in,out] | status | error status |
Make a complete FITS 80-byte keyword card from the input name, value and comment strings. Output card is null terminated without any trailing blanks.
[in] | keyname | keyword name |
[in] | value | keyword value |
[in] | comm | keyword comment |
[out] | card | constructed keyword card |
[in,out] | status | error status |
int ffmnhd | ( | fitsfile * | fptr, |
int | exttype, | ||
char * | hduname, | ||
int | hduver, | ||
int * | status | ||
) |
Move to the next HDU with a given extension type (IMAGE_HDU, ASCII_TBL, BINARY_TBL, or ANY_HDU), extension name (EXTNAME or HDUNAME keyword), and EXTVERS keyword values. If hduvers = 0, then move to the first HDU with the given type and name regardless of EXTVERS value. If no matching HDU is found in the file, then the current open HDU will remain unchanged.
[in] | fptr | FITS file pointer |
[in] | exttype | type of extension, 0, 1, or 2 |
[in] | hduname | desired EXTNAME value for the HDU |
[in] | hduver | desired EXTVERS value for the HDU |
[in,out] | status | error status |
int ffmrhd | ( | fitsfile * | fptr, |
int | hdumov, | ||
int * | exttype, | ||
int * | status | ||
) |
Move a Relative number of Header Data units. Offset to the specified extension and read the header to initialize the HDU structure.
[in] | fptr | FITS file pointer |
[in] | hdumov | rel. no. of HDUs to move by (+ or -) |
[out] | exttype | type of extension, 0, 1, or 2 |
[in,out] | status | error status |
int ffnkey | ( | int | value, |
const char * | keyroot, | ||
char * | keyname, | ||
int * | status | ||
) |
Construct a keyword name string by appending the root string to the index number. e.g., if root = "TTYPE" and value = 12 then keyname = "12TTYPE".
[in] | value | index number to be appended to root name |
[in] | keyroot | root string for keyword name |
[out] | keyname | output root + index keyword name |
[in,out] | status | error status |
int ffpdes | ( | fitsfile * | fptr, |
int | colnum, | ||
LONGLONG | rownum, | ||
LONGLONG | length, | ||
LONGLONG | heapaddr, | ||
int * | status | ||
) |
put (write) the variable length vector descriptor to the table.
[in] | fptr | FITS file pointer |
[in] | colnum | column number (1 = 1st column of table) |
[in] | rownum | row number (1 = 1st row of table) |
[in] | length | number of elements in the row |
[in] | heapaddr | heap pointer to the data |
[in,out] | status | error status |
int ffpdfl | ( | fitsfile * | fptr, |
int * | status | ||
) |
Write the Data Unit Fill values if they are not already correct. The fill values are used to fill out the last 2880 byte block of the HDU. Fill the data unit with zeros or blanks depending on the type of HDU from the end of the data to the end of the current FITS 2880 byte block
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffpinit | ( | fitsfile * | fptr, |
int * | status | ||
) |
initialize the parameters defining the structure of the primary array or an Image extension
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
void ffpmrk | ( | void | ) |
write a marker to the stack. It is then possible to pop only those messages following the marker off of the stack, leaving the previous messages unaffected.
The marker is ignored by the ffgmsg routine.
void ffpmsg | ( | const char * | err_message | ) |
put message on to error stack
int ffpsvc | ( | char * | card, |
char * | value, | ||
char * | comm, | ||
int * | status | ||
) |
ParSe the Value and Comment strings from the input header card string. If the card contains a quoted string value, the returned value string includes the enclosing quote characters. If comm = NULL, don't return the comment string.
[in] | card | FITS header card (nominally 80 bytes long) |
[out] | value | value string parsed from the card |
[out] | comm | comment string parsed from the card |
[in,out] | status | error status |
int ffpxsz | ( | int | datatype | ) |
return the number of bytes per pixel associated with the datatype
int ffrdef | ( | fitsfile * | fptr, |
int * | status | ||
) |
ReDEFine the structure of a data unit. This routine re-reads the CHDU header keywords to determine the structure and length of the current data unit. This redefines the start of the next HDU.
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int ffrhdu | ( | fitsfile * | fptr, |
int * | hdutype, | ||
int * | status | ||
) |
read the required keywords of the CHDU and initialize the corresponding structure elements that describe the format of the HDU
[in] | fptr | FITS file pointer |
[out] | hdutype | type of HDU |
[in,out] | status | error status |
int ffthdu | ( | fitsfile * | fptr, |
int * | nhdu, | ||
int * | status | ||
) |
Return the number of HDUs that currently exist in the file.
[in] | fptr | FITS file pointer |
[out] | nhdu | number of HDUs in the file |
[in,out] | status | error status |
int fftheap | ( | fitsfile * | fptr, |
LONGLONG * | heapsz, | ||
LONGLONG * | unused, | ||
LONGLONG * | overlap, | ||
int * | valid, | ||
int * | status | ||
) |
Tests the contents of the binary table variable length array heap. Returns the number of bytes that are currently not pointed to by any of the descriptors, and also the number of bytes that are pointed to by more than one descriptor. It returns valid = FALSE if any of the descriptors point to addresses that are out of the bounds of the heap.
[in] | fptr | |
[out] | heapsz | current size of the heap |
[out] | unused | no. of unused bytes in the heap |
[out] | overlap | no. of bytes shared by > 1 descriptors |
[out] | valid | are all the heap addresses valid? |
[in,out] | status | error status |
int fftkey | ( | const char * | keyword, |
int * | status | ||
) |
int fftrec | ( | char * | card, |
int * | status | ||
) |
Test that the keyword card conforms to the FITS standard. Must contain only printable ASCII characters;
[in] | card | keyword card to test |
[in,out] | status | error status |
void ffupch | ( | char * | string | ) |
convert string to upper case, in place.
int ffuptf | ( | fitsfile * | fptr, |
int * | status | ||
) |
Update the value of the TFORM keywords for the variable length array columns to make sure they all have the form 1Px(len) or Px(len) where 'len' is the maximum length of the vector in the table (e.g., '1PE(400)')
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
float ffvers | ( | float * | version | ) |
return the current version number of the FITSIO software
[in,out] | version | version number |
int ffwend | ( | fitsfile * | fptr, |
int * | status | ||
) |
write the END card and following fill (space chars) in the current header
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
void ffxmsg | ( | int | action, |
char * | errmsg | ||
) |
general routine to get, put, or clear the error message stack. Use a static array rather than allocating memory as needed for the error messages because it is likely to be more efficient and simpler to implement.
Action Code: DelAll 1 delete all messages on the error stack DelMark 2 delete messages back to and including the 1st marker DelNewest 3 delete the newest message from the stack GetMesg 4 pop and return oldest message, ignoring marks PutMesg 5 add a new message to the stack PutMark 6 add a marker to the stack
int fits_copy_pixlist2image | ( | fitsfile * | infptr, |
fitsfile * | outfptr, | ||
int | firstkey, | ||
int | naxis, | ||
int * | colnum, | ||
int * | status | ||
) |
Copy relevant keywords from the pixel list table header into a newly created primary array header. Convert names of keywords where appropriate. See fits_translate_pixkeyword() for the definitions.
Translation begins at header record number 'firstkey', and continues to the end of the header.
[in] | infptr | pointer to input HDU |
[in] | outfptr | pointer to output HDU |
[in] | firstkey | first HDU record number to start with |
[in] | naxis | number of axes in the image |
[in] | colnum | numbers of the columns to be binned |
[in,out] | status | error status |
int fits_is_compressed_image | ( | fitsfile * | fptr, |
int * | status | ||
) |
Returns TRUE if the CHDU is a compressed image, else returns zero.
[in] | fptr | FITS file pointer |
[in,out] | status | error status |
int fits_is_reentrant | ( | void | ) |
Was CFITSIO compiled with the -D_REENTRANT flag? 1 = yes, 0 = no. Note that specifying the -D_REENTRANT flag is required, but may not be sufficient, to ensure that CFITSIO can be safely used in a multi-threaded environoment.
int fits_translate_keyword | ( | char * | inrec, |
char * | outrec, | ||
char * | patterns[][2], | ||
int | npat, | ||
int | n_value, | ||
int | n_offset, | ||
int | n_range, | ||
int * | pat_num, | ||
int * | i, | ||
int * | j, | ||
int * | m, | ||
int * | n, | ||
int * | status | ||
) |
Translate a keyword name to a new name, based on a set of patterns. The user passes an array of patterns to be matched. Input pattern number i is pattern[i][0], and output pattern number i is pattern[i][1]. Keywords are matched against the input patterns. If a match is found then the keyword is re-written according to the output pattern.
Order is important. The first match is accepted. The fastest match will be made when templates with the same first character are grouped together.
Several characters have special meanings:
i,j - single digits, preserved in output template n - column number of one or more digits, preserved in output template m - generic number of one or more digits, preserved in output template a - coordinate designator, preserved in output template # - number of one or more digits ? - any character - only allowed in first character position, to match all keywords; only useful as last pattern in the list
i, j, n, and m are returned by the routine.
For example, the input pattern "iCTYPn" will match "1CTYP5" (if n_value is 5); the output pattern "CTYPEi" will be re-written as "CTYPE1". Notice that "i" is preserved.
The following output patterns are special
Special output pattern characters:
"-" - do not copy a keyword that matches the corresponding input pattern "+" - copy the input unchanged
The inrec string could be just the 8-char keyword name, or the entire 80-char header record. Characters 9 = 80 in the input string simply get appended to the translated keyword name.
If n_range = 0, then only keywords with 'n' equal to n_value will be considered as a pattern match. If n_range = +1, then all values of 'n' greater than or equal to n_value will be a match, and if -1, then values of 'n' less than or equal to n_value will match.
This routine was written by Craig Markwardt, GSFC
[in] | inrec | input string |
[out] | outrec | output converted string, or a null string if input does not match any of the patterns |
[in] | patterns | pointer to input / output string |
[in] | npat | number of templates passed |
[in] | n_value | base 'n' template value of interest |
[in] | n_offset | offset to be applied to the 'n' |
[in] | n_range | controls range of 'n' template |
[out] | pat_num | matched pattern number (0 based) or -1 |
[out] | i | value of i, if any, else 0 |
[out] | j | value of j, if any, else 0 |
[out] | m | value of m, if any, else 0 |
[out] | n | value of n, if any, else 0 |
[in,out] | status) | /* IO - error status |
*int fits_translate_keywords | ( | fitsfile * | infptr, |
fitsfile * | outfptr, | ||
int | firstkey, | ||
char * | patterns[][2], | ||
int | npat, | ||
int | n_value, | ||
int | n_offset, | ||
int | n_range, | ||
int * | status | ||
) |
Copy relevant keywords from the table header into the newly created primary array header. Convert names of keywords where appropriate. See fits_translate_keyword() for the definitions.
Translation begins at header record number 'firstkey', and continues to the end of the header.
This routine was written by Craig Markwardt, GSFC
[in] | infptr | pointer to input HDU |
[in] | outfptr | pointer to output HDU |
[in] | firstkey | first HDU record number to start with |
[in] | patterns | pointer to input / output keyword templates |
[in] | npat | number of templates passed |
[in] | n_value | base 'n' template value of interest |
[in] | n_offset | offset to be applied to the 'n' |
[in] | n_range | controls range of 'n' template |
[in,out] | status | error status |
int fits_translate_pixkeyword | ( | char * | inrec, |
char * | outrec, | ||
char * | patterns[][2], | ||
int | npat, | ||
int | naxis, | ||
int * | colnum, | ||
int * | pat_num, | ||
int * | i, | ||
int * | j, | ||
int * | n, | ||
int * | m, | ||
int * | l, | ||
int * | status | ||
) |
Translate a keyword name to a new name, based on a set of patterns. The user passes an array of patterns to be matched. Input pattern number i is pattern[i][0], and output pattern number i is pattern[i][1]. Keywords are matched against the input patterns. If a match is found then the keyword is re-written according to the output pattern.
Order is important. The first match is accepted. The fastest match will be made when templates with the same first character are grouped together.
Several characters have special meanings:
i,j - single digits, preserved in output template n, m - column number of one or more digits, preserved in output template k - generic number of one or more digits, preserved in output template a - coordinate designator, preserved in output template # - number of one or more digits ? - any character - only allowed in first character position, to match all keywords; only useful as last pattern in the list
i, j, n, and m are returned by the routine.
For example, the input pattern "iCTYPn" will match "1CTYP5" (if n_value is 5); the output pattern "CTYPEi" will be re-written as "CTYPE1". Notice that "i" is preserved.
The following output patterns are special
Special output pattern characters:
"-" - do not copy a keyword that matches the corresponding input pattern "+" - copy the input unchanged
The inrec string could be just the 8-char keyword name, or the entire 80-char header record. Characters 9 = 80 in the input string simply get appended to the translated keyword name.
If n_range = 0, then only keywords with 'n' equal to n_value will be considered as a pattern match. If n_range = +1, then all values of 'n' greater than or equal to n_value will be a match, and if -1, then values of 'n' less than or equal to n_value will match.
[in] | inrec | input string |
[out] | outrec | output converted string, or a null string if input does not match any of the patterns |
[in] | patterns | pointer to input / output string |
[in] | npat | number of templates passed |
[in] | naxis | number of columns to be binned |
[in] | colnum | numbers of the columns to be binned |
[out] | pat_num | matched pattern number (0 based) or |
[out] | i | |
[out] | j | |
[out] | n | |
[out] | m | |
[out] | l | |
[in,out] | status | error status |
struct lconv* lcxxx |
int STREAM_DRIVER = 0 |