WriteKeyword
Writes a FITS keyword to an existing FITS file. The keyword must be valid or an exception will be thrown. For list of valid FITS keywords, see: Keyword Doc #1 or Keyword Doc #2
Syntax
void WriteKeyword( key, keyVal, valType, comment );
Parameters
char* key
Keyword to update.
void* keyVal
The value associated with the key. The type is specified by the valType parameter.
int valType
The type for the keyword value. Can be one of the following class integer values:

FITS_STRING_KEY
FITS_INTEGER_KEY
FITS_DOUBLE_KEY
FITS_LOGICAL_KEY
FITS_COMMENT_KEY
FITS_HISTORY_KEY
FITS_DATE_KEY
char* comment
A comment that will be put in the FITS comment portion of the FITS keyword. Comments that are too long will be truncated.
Returns
None
Required Headers
CFitsFile.h
Namespace
arc
Throws
std::runtime_error
Remarks
None
Example
        // This code demonstrates how to write a string
        // keyword to the FITS header.

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

        using namespace std;
        using namespace arc;

        int main()
        {
            try {
                CFitsFile cFits( "Image.fit" );
 
                cFits.WriteKeyword( "OBJECT",
                                    "NGC4565",
                                    CFitsFile::FITS_STRING_KEY,
                                    NULL );

                cFits.WriteKeyword( "OBSERVER",
                                    "Ivana Tinkle",
                                    CFitsFile::FITS_STRING_KEY,
                                    "observer who acquired the data" );
            }
            catch ( std::exception &e )
            {
                cerr << "Exception Occurred: " << e.what() << endl;
            }
        }

© Astronomical Research Cameras, Inc.