C Standard Library Extensions
6.2.0
|
Functions | |
int | qfitsloader_init (qfitsloader *ql) |
Initialize a qfitsloader control object. More... | |
int | qfits_loadpix (qfitsloader *ql) |
Load a pixel buffer for one complete image. More... | |
int | qfits_loadpix_window (qfitsloader *ql, int llx, int lly, int urx, int ury) |
Load a pixel buffer for one image window. More... | |
int | qfits_pixdump (qfitsdumper *qd) |
Dump a pixel buffer to an output FITS file in append mode. More... | |
int qfits_loadpix | ( | qfitsloader * | ql | ) |
Load a pixel buffer for one complete image.
ql | Allocated and initialized qfitsloader control object. |
References qfitsloader::lx, qfitsloader::ly, and qfits_loadpix_window().
int qfits_loadpix_window | ( | qfitsloader * | ql, |
int | llx, | ||
int | lly, | ||
int | urx, | ||
int | ury | ||
) |
Load a pixel buffer for one image window.
ql | Allocated and initialized qfitsloader control object. |
llx | |
lly | Position of the window (start with (1,1)) |
urx | |
ury |
This function performs a load of a pixel buffer into memory. It expects an allocated and initialized qfitsloader object in input. See qfitsloader_init() about initializing the object.
This function will fill up the ibuf/fbuf/dbuf field, depending on the requested pixel type (resp. int, float or double).
If llx lly urx and ury do not specify the whole image, ql->map must be 0, we do not want to mmap a file an load only a part of it.
References qfitsloader::_init, qfitsloader::bitpix, qfitsloader::bscale, qfitsloader::bzero, qfitsloader::dbuf, qfitsloader::fbuf, qfitsloader::filename, qfitsloader::ibuf, qfitsloader::lx, qfitsloader::ly, qfitsloader::map, qfitsloader::pnum, qfitsloader::ptype, and qfitsloader::seg_start.
Referenced by qfits_loadpix().
int qfits_pixdump | ( | qfitsdumper * | qd | ) |
Dump a pixel buffer to an output FITS file in append mode.
qd | qfitsdumper control object. |
This function takes in input a qfitsdumper control object. This object must be allocated beforehand and contain valid references to the data to save, and how to save it.
The minimum fields to fill are:
One of the following fields must point to the corresponding pixel buffer:
This is a fairly low-level function, in the sense that it does not check that the output file already contains a proper header or even that the file it is appending to is indeed a FITS file. It will convert the pixel buffer to the requested BITPIX type and append the data to the file, without padding with zeros. See qfits_zeropad() about padding.
If the given output file name is "STDOUT" (all caps), the dump will be performed to stdout.
References qfitsdumper::dbuf, qfitsdumper::fbuf, qfitsdumper::filename, qfitsdumper::ibuf, qfitsdumper::npix, qfitsdumper::out_ptype, and qfitsdumper::ptype.
int qfitsloader_init | ( | qfitsloader * | ql | ) |
Initialize a qfitsloader control object.
ql | qfitsloader object to initialize. |
This function expects a qfitsloader object with a number of input fields correctly filled in. The minimum fields to set are:
You can go ahead with these fields only if you only want to get file information for this plane in this extension. If you want to later load the plane, you must additionally fill the 'ptype' field to a correct value (PTYPE_INT, PTYPE_FLOAT, PTYPE_DOUBLE) before calling qfits_loadpix() so that it knows which conversion to perform.
This function is basically a probe sent on a FITS file to ask qfits if loading these data would be Ok or not. The actual loading is performed by qfits_loadpix() afterwards.
References qfitsloader::_init, qfitsloader::bitpix, qfitsloader::bscale, qfitsloader::bzero, qfitsloader::exts, qfitsloader::filename, qfitsloader::lx, qfitsloader::ly, qfitsloader::np, qfitsloader::pnum, qfitsloader::ptype, qfits_get_datinfo(), qfits_header_destroy(), qfits_header_getint(), qfits_header_getstr(), qfits_header_readext(), qfits_is_fits(), qfits_pretty_string(), qfits_query_n_ext(), qfitsloader::seg_size, qfitsloader::seg_start, and qfitsloader::xtnum.