SetAdditionalFITSKeys()

Discussion in 'Scripting and Programming' started by kylin, Dec 8, 2016.

  1. kylin

    kylin Standard User

    Joined:
    Dec 8, 2016
    Messages:
    1
    Hello,

    I am new to this forum and scripting for an SBIG camera. Currently, I am working with an ST-i connected to a Mac.

    I have no problem taking images and saving them as FITS so far. However, when it comes to adding more information to the FITS header, I need some help.

    The problem is when I try to use SetAdditionalFITSKeys() and then reading it back with GetAdditionalFITSKeys() from an instance of the CSBIGImg class (pImg1 in the example below), it worked well the first time. However, once I issued the second command, it overwrites the previous one.

    The most relevant code fragments from my .cpp file:
    char fitsdate[50];
    char fitsserial[50];

    sprintf(fitsserial, "CCD_SN = %s\t / serial no.\n", gcir2.serialNumber);
    cout << "Adding Camera serial number to FITS file: " << fitsserial << endl;
    pImg1->SetAdditionalFITSKeys(fitsserial);
    cout << "Reading back serial: " << pImg1->GetAdditionalFITSKeys() << endl;
    pImg1->GetFormattedImageInfo(fitsinfo, false);
    cout << fitsinfo << endl;

    strftime(fitsdate, 50, "DATE-NEW= %Y%m%d_%H%M%S\t/ FILENAME TIME STRING\n", timeinfogmt);
    cout << "Adding date to FITS file: " << fitsdate << endl;
    pImg1->SetAdditionalFITSKeys(fitsdate);
    cout << "Reading back date: " << pImg1->GetAdditionalFITSKeys() << endl;
    pImg1->GetFormattedImageInfo(fitsinfo, false);
    cout << fitsinfo << endl;​


    Really appreciate it if anyone can provide some comments.

    - KYLin
     

Share This Page