Logo Search packages:      
Sourcecode: qfits version File versions  Download package

qfitsloader Struct Reference

#include <qfits_image.h>

List of all members.

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",
    return 0 ;

Definition at line 150 of file qfits_image.h.

Public Attributes

int _init
int bitpix
double bscale
double bzero
double * dbuf
int exts
float * fbuf
char * filename
int * ibuf
int lx
int ly
int map
int np
int pnum
int ptype
int seg_size
int seg_start
int xtnum

The documentation for this struct was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index