C Standard Library Extensions
6.2.0
|
Functions | |
qfits_header * | qfits_header_read (const char *filename) |
Read a FITS header from a file to an internal structure. More... | |
qfits_header * | qfits_header_read_hdr (const char *filename) |
Read a FITS header from a 'hdr' file. More... | |
qfits_header * | qfits_header_read_hdr_string (const unsigned char *hdr_str, int nb_char) |
Read a FITS header from a 'hdr' string. More... | |
qfits_header * | qfits_header_readext (const char *filename, int xtnum) |
Read an extension header from a FITS file. More... | |
void | qfits_zeropad (const char *filename) |
Pad an existing file with zeros to a multiple of 2880. More... | |
int | qfits_is_fits (const char *filename) |
Identify if a file is a FITS file. More... | |
int | qfits_get_hdrinfo (const char *filename, int xtnum, int *seg_start, int *seg_size) |
Retrieve offset to start and size of a header in a FITS file. More... | |
int | qfits_get_datinfo (const char *filename, int xtnum, int *seg_start, int *seg_size) |
Retrieve offset to start and size of a data section in a file. More... | |
int qfits_get_datinfo | ( | const char * | filename, |
int | xtnum, | ||
int * | seg_start, | ||
int * | seg_size | ||
) |
Retrieve offset to start and size of a data section in a file.
filename | Name of the file to examine. |
xtnum | Extension number (0 for main). |
seg_start | Segment start in bytes (output). |
seg_size | Segment size in bytes (output). |
This function retrieves the two most important informations about a data section in a FITS file: the offset to its beginning, and the size of the section in bytes. Both values are returned in the passed pointers to ints. It is Ok to pass NULL for any pointer if you do not want to retrieve the associated value.
You must provide an extension number for the header, 0 meaning the main header in the file.
References qfits_query().
Referenced by qfits_table_open(), and qfitsloader_init().
int qfits_get_hdrinfo | ( | const char * | filename, |
int | xtnum, | ||
int * | seg_start, | ||
int * | seg_size | ||
) |
Retrieve offset to start and size of a header in a FITS file.
filename | Name of the file to examine |
xtnum | Extension number (0 for main) |
seg_start | Segment start in bytes (output) |
seg_size | Segment size in bytes (output) |
This function retrieves the two most important informations about a header in a FITS file: the offset to its beginning, and the size of the header in bytes. Both values are returned in the passed pointers to ints. It is Ok to pass NULL for any pointer if you do not want to retrieve the associated value.
You must provide an extension number for the header, 0 meaning the main header in the file.
References qfits_query().
Referenced by qfits_header_readext(), qfits_query_card(), qfits_query_ext(), and qfits_replace_card().
qfits_header* qfits_header_read | ( | const char * | filename | ) |
Read a FITS header from a file to an internal structure.
filename | Name of the file to be read |
This function parses a FITS (main) header, and returns an allocated qfits_header object. The qfits_header object contains a linked-list of key "tuples". A key tuple contains:
Direct access to the structure is not foreseen, use accessor functions in fits_h.h
Value, comment, and original line might be NULL pointers.
References qfits_header_readext().
qfits_header* qfits_header_read_hdr | ( | const char * | filename | ) |
Read a FITS header from a 'hdr' file.
filename | Name of the file to be read |
This function parses a 'hdr' file, and returns an allocated qfits_header object. A hdr file is an ASCII format were the header is written with a carriage return after each line. The command dfits typically displays a hdr file.
References qfits_getcomment(), qfits_getkey(), qfits_getvalue(), qfits_header_append(), qfits_header_destroy(), and qfits_header_new().
qfits_header* qfits_header_read_hdr_string | ( | const unsigned char * | hdr_str, |
int | nb_char | ||
) |
Read a FITS header from a 'hdr' string.
hdr_str | String containing the hdr file |
nb_char | Number of characters in the string |
This function parses a 'hdr' string, and returns an allocated qfits_header object.
References qfits_getcomment(), qfits_getkey(), qfits_getvalue(), qfits_header_append(), qfits_header_destroy(), and qfits_header_new().
qfits_header* qfits_header_readext | ( | const char * | filename, |
int | xtnum | ||
) |
Read an extension header from a FITS file.
filename | Name of the FITS file to read |
xtnum | Extension number to read, starting from 0. |
Strictly similar to qfits_header_read() but reads headers from extensions instead. If the requested xtension is 0, this function returns the main header.
Returns NULL in case of error.
References qfits_get_hdrinfo(), qfits_getcomment(), qfits_getkey(), qfits_getvalue(), qfits_header_append(), qfits_header_destroy(), qfits_header_new(), and qfits_query_n_ext().
Referenced by qfits_header_read(), and qfitsloader_init().
int qfits_is_fits | ( | const char * | filename | ) |
Identify if a file is a FITS file.
filename | name of the file to check |
Returns 1 if the file name looks like a valid FITS file. Returns 0 else. If the file does not exist, returns -1.
Referenced by qfits_table_open(), and qfitsloader_init().
void qfits_zeropad | ( | const char * | filename | ) |
Pad an existing file with zeros to a multiple of 2880.
filename | Name of the file to pad. |
This function simply pads an existing file on disk with enough zeros for the file size to reach a multiple of 2880, as required by FITS.