C Standard Library Extensions: qfitsdumper Struct Reference

C Standard Library Extensions 6.2.0

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Members

Public Attributes
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

double* qfitsdumper::dbuf

Pointer to input double pixel buffer

Referenced by qfits_pixdump().

float* qfitsdumper::fbuf

Pointer to input float pixel buffer

Referenced by qfits_pixdump().

char* qfitsdumper::filename

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

Referenced by qfits_pixdump().

int* qfitsdumper::ibuf

Pointer to input integer pixel buffer

Referenced by qfits_pixdump().

int qfitsdumper::npix

Number of pixels in the buffer to dump

Referenced by qfits_pixdump().

int qfitsdumper::out_ptype

Requested BITPIX in output FITS file

Referenced by qfits_pixdump().

int qfitsdumper::ptype

Buffer type: PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE

Referenced by qfits_pixdump().

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

- qfits_image.h