qfitsdumper Struct Reference

qfits dumper control object More...

#include <qfits_image.h>

List of all members.

Public Attributes

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).


Member Data Documentation

Pointer to input double pixel buffer

Referenced by qfits_pixdump().

Pointer to input float pixel buffer

Referenced by qfits_pixdump().

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

Referenced by qfits_pixdump().

Pointer to input integer pixel buffer

Referenced by qfits_pixdump().

Number of pixels in the buffer to dump

Referenced by qfits_pixdump().

Requested BITPIX in output FITS file

Referenced by qfits_pixdump().

Buffer type: PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE

Referenced by qfits_pixdump().


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

Generated on 11 Feb 2011 for C Standard Library Extensions by  doxygen 1.6.1