qfits loader control object More...
#include <qfits_image.h>
Public Attributes | |
int | _init |
char * | filename |
int | xtnum |
int | pnum |
int | ptype |
int | map |
int | exts |
int | lx |
int | ly |
int | np |
int | bitpix |
int | seg_start |
int | seg_size |
double | bscale |
double | bzero |
int * | ibuf |
float * | fbuf |
double * | dbuf |
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 ; }
Private field to see if structure has been initialized
Referenced by qfits_loadpix_window(), and qfitsloader_init().
output: BITPIX for this extension
Referenced by qfits_loadpix_window(), and qfitsloader_init().
double qfitsloader::bscale |
output: BSCALE found for this extension
Referenced by qfits_loadpix_window(), and qfitsloader_init().
double qfitsloader::bzero |
output: BZERO found for this extension
Referenced by qfits_loadpix_window(), and qfitsloader_init().
double* qfitsloader::dbuf |
output: Pointer to pixel buffer loaded as double values
Referenced by qfits_loadpix_window().
output: Total number of extensions found in file
Referenced by qfitsloader_init().
float* qfitsloader::fbuf |
output: Pointer to pixel buffer loaded as float values
Referenced by qfits_loadpix_window().
char* qfitsloader::filename |
input: Name of the file you want to read pixels from
Referenced by qfits_loadpix_window(), and qfitsloader_init().
int* qfitsloader::ibuf |
output: Pointer to pixel buffer loaded as integer values
Referenced by qfits_loadpix_window().
int qfitsloader::lx |
output: Size in X of the requested plane
Referenced by qfits_loadpix(), qfits_loadpix_window(), and qfitsloader_init().
int qfitsloader::ly |
output: Size in Y of the requested plane
Referenced by qfits_loadpix(), qfits_loadpix_window(), and qfitsloader_init().
int qfitsloader::map |
input: Guarantee file copy or allow file mapping
Referenced by qfits_loadpix_window().
int qfitsloader::np |
output: Number of planes present in this extension
Referenced by qfitsloader_init().
input: Index of the plane you want, from 0 to np-1
Referenced by qfits_loadpix_window(), and qfitsloader_init().
input: Pixel type you want (PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE)
Referenced by qfits_loadpix_window(), and qfitsloader_init().
output: Size of the data segment (in bytes) for your request
Referenced by qfitsloader_init().
output: Start of the data segment (in bytes) for your request
Referenced by qfits_loadpix_window(), and qfitsloader_init().
input: xtension number you want to read
Referenced by qfitsloader_init().