UpdateKeyword
Updates an existing 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 UpdateKeyword( 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 update a string
        // keyword with a new value. Updates the OBJECT
        // keyword with a new value ( "NGC4565" ).

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

        using namespace std;
        using namespace arc;

        int main()
        {
            try {
                CFitsFile cFits( "Image.fit" );
 
                cFits.UpdateKeyword( "OBJECT",
                                     "NGC4565",
                                     CFitsFile::FITS_STRING_KEY,
                                     NULL );
            }
            catch ( std::exception &e )
            {
                cerr << "Exception Occurred: " << e.what() << endl;
            }
        }

© Astronomical Research Cameras, Inc.