GetHeader
Returns the FITS header as an array of C character strings.
Syntax
char** GetHeader( *keyCount );
Parameters
int* keyCount
An integer pointer that returns the number of keys in the header.
Returns
char** - Pointer to an array of C character strings.
Required Headers
CFitsFile.h
Namespace
arc
Throws
std::runtime_error
Remarks
The user application should not free the returned pointer. This will be handled automatically by the class.
Example
        // This code demonstrates how to compare two existing
        // 16-bit FITS files.

        #include <iostream>
        #include "CFitsFile.h"

        using namespace std;
        using namespace arc;

        int main()
        {
	        try
	        {
		        CFitsFile cFits( "Image.fit", 512, 600 );
		        cFits.GenerateTestData();

		        int keyCount = 0;
		        char **pHeader = cFits.GetHeader( &keyCount );

		        for ( int i=0; i<keyCount; i++ )
			        cout << "pHeader[ " << i << " ]: " << pHeader[ i ] << endl;
	        }
	        catch ( std::runtime_error &e )
	        {
		        cerr << "( CFitsFile Error ): " << e.what() << endl;
	        }
	    }

        OUTPUT:
        pHeader[ 0 ]: SIMPLE  =  T / file does conform to FITS standard
        pHeader[ 1 ]: BITPIX  =  16 / number of bits per data pixel
        pHeader[ 2 ]: NAXIS   =  2 / number of data axes
        pHeader[ 3 ]: NAXIS1  =  600 / length of data axis 1
        pHeader[ 4 ]: NAXIS2  =  512 / length of data axis 2
        pHeader[ 5 ]: EXTEND  =  T / FITS dataset may contain extensions
        pHeader[ 6 ]: COMMENT    FITS (Flexible Image Transport System)
        pHeader[ 7 ]: BZERO   =  32768 / offset data range to that of unsigned short
        pHeader[ 8 ]: BSCALE  =  1 / default scaling factor

© Astronomical Research Cameras, Inc.