qfitsdumper Struct Reference

qfits dumper control object. More...

#include <qfits.h>


Data Fields

char* filename
int npix
int ptype
int* ibuf
float* fbuf
double* dbuf
int out_ptype


Detailed Description

qfits dumper control object.

This structure offers various control parameters to dump a pixel buffer to a FITS file. The buffer will be dumped as requested to the requested file in append mode. Of course, the requested file must be writeable for the operation to succeed.

The following example demonstrates how to save a linear ramp sized 100x100 to a FITS file with BITPIX=16. Notice that this code only dumps the pixel buffer, no header information is provided in this case.

    int   i, j ;
    int * ibuf ;
    qfitsdumper qd ;

    // Fill a buffer with 100x100 int pixels
    ibuf = malloc(100 * 100 * sizeof(int));
    for (j=0 ; j<100 ; j++) {
        for (i=0 ; i<100 ; i++) {
            ibuf[i+j*100] = i+j ;
        }
    }

    qd.filename  = "out.fits" ;     // Output file name
    qd.npix      = 100 * 100 ;      // Number of pixels
    qd.ptype     = PTYPE_INT ;      // Input buffer type
    qd.ibuf      = ibuf ;           // Set buffer pointer
    qd.out_ptype = BPP_16_SIGNED ;  // Save with BITPIX=16

    // Dump buffer to file (error checking omitted for clarity)
    qfits_pixdump(&qd);

    free(ibuf);

If the provided output file name is "STDOUT" (all capitals), the function will dump the pixels to the stdout steam (usually the console, could have been re-directed).


Field Documentation

double * qfitsdumper::dbuf
 

Pointer to input double pixel buffer

float * qfitsdumper::fbuf
 

Pointer to input float pixel buffer

char * qfitsdumper::filename
 

Name of the file to dump to, "STDOUT" to dump to stdout

int * qfitsdumper::ibuf
 

Pointer to input integer pixel buffer

int qfitsdumper::npix
 

Number of pixels in the buffer to dump

int qfitsdumper::out_ptype
 

Requested BITPIX in output FITS file

int qfitsdumper::ptype
 

Buffer type: PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE


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