qfitsloader Struct Reference
qfits loader control object.
More...
#include <qfits.h>
Detailed Description
qfits loader control object.
This structure serves two purposes: input and output for the qfits pixel loading facility. To request pixels from a FITS file, you need to allocate (statically or dynamically) such a structure and fill up the input fields (filename, xtension number, etc.) to specify the pixels you want from the file.
Before performing the actual load, you must pass the initialized structure to qfitsloader_init() which will check whether the operation is feasible or not (check its returned value).
If the operation was deemed feasible, you can proceed to load the pixels, passing the same structure to qfits_loadpix() which will fill up the output fields of the struct. Notice that a pixel buffer will have been allocated (through malloc or mmap) and placed into the structure. You need to call free() on this pointer when you are done with it, typically in the image or cube destructor.
The qfitsloader_init() function is also useful to probe a FITS file for useful informations, like getting the size of images in the file, the pixel depth, or data offset.
Example of a code that prints out various informations about a plane to load, without actually loading it:
int main(int argc, char * argv[])
{
qfitsloader ql ;
ql.filename = argv[1] ;
ql.xtnum = 0 ;
ql.pnum = 0 ;
if (qfitsloader_init(&ql)!=0) {
printf("cannot read info about %s\n", argv[1]);
return -1 ;
}
printf( "file : %s\n"
"xtnum : %d\n"
"pnum : %d\n"
"# xtensions : %d\n"
"size X : %d\n"
"size Y : %d\n"
"planes : %d\n"
"bitpix : %d\n"
"datastart : %d\n"
"datasize : %d\n"
"bscale : %g\n"
"bzero : %g\n",
ql.filename,
ql.xtnum,
ql.pnum,
ql.exts,
ql.lx,
ql.ly,
ql.np,
ql.bitpix,
ql.seg_start,
ql.seg_size,
ql.bscale,
ql.bzero);
return 0 ;
}
Field Documentation
|
Private field to see if structure has been initialized |
|
output: BITPIX for this extension |
double qfitsloader::bscale
|
|
|
output: BSCALE found for this extension |
double qfitsloader::bzero
|
|
|
output: BZERO found for this extension |
double * qfitsloader::dbuf
|
|
|
output: Pointer to pixel buffer loaded as double values |
|
output: Total number of extensions found in file |
float * qfitsloader::fbuf
|
|
|
output: Pointer to pixel buffer loaded as float values |
char * qfitsloader::filename
|
|
|
input: Name of the file you want to read pixels from |
|
output: Pointer to pixel buffer loaded as integer values |
|
output: Size in X of the requested plane |
|
output: Size in Y of the requested plane |
|
input: Guarantee file copy or allow file mapping |
|
output: Number of planes present in this extension |
|
input: Index of the plane you want, from 0 to np-1 |
|
input: Pixel type you want (PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE) |
int qfitsloader::seg_size
|
|
|
output: Size of the data segment (in bytes) for your request |
int qfitsloader::seg_start
|
|
|
output: Start of the data segment (in bytes) for your request |
|
input: xtension number you want to read |
The documentation for this struct was generated from the following file: