Example #1
0
/**************************************************************************************
** INDI is asking us to add any FITS keywords to the FITS header
***************************************************************************************/
void INovaCCD::addFITSKeywords(fitsfile *fptr, INDI::CCDChip *targetChip)
{
    // Let's first add parent keywords
    INDI::CCD::addFITSKeywords(fptr, targetChip);

    // Add temperature to FITS header
    int status = 0;
    double gain =  CameraPropertiesN[CCD_GAIN_N].value;
    double blkLvl = CameraPropertiesN[CCD_BLACKLEVEL_N].value;
    fits_update_key_s(fptr, TDOUBLE, "GAIN", &gain, "CCD Gain", &status);
    fits_update_key_s(fptr, TDOUBLE, "BLACKLEVEL", &blkLvl, "CCD Black Level", &status);
    fits_write_date(fptr, &status);

}
Example #2
0
void QSICCD::addFITSKeywords(fitsfile *fptr, CCDChip *targetChip)
{

    INDI::CCD::addFITSKeywords(fptr, targetChip);

    int status=0;
    double electronsPerADU;

    try
    {
        QSICam.get_ElectronsPerADU(&electronsPerADU);
    } catch (std::runtime_error& err)
    {
            DEBUGF(INDI::Logger::DBG_ERROR, "get_ElectronsPerADU failed. %s.", err.what());
            return;
    }

    fits_update_key_s(fptr, TDOUBLE, "EPERADU", &electronsPerADU, "Electrons per ADU", &status);
}
Example #3
0
void GPhotoCCD::addFITSKeywords(fitsfile *fptr, CCDChip *targetChip)
{

    INDI::CCD::addFITSKeywords(fptr, targetChip);

    int status=0;

    if (mIsoSP.nsp > 0)
    {

        ISwitch *onISO = IUFindOnSwitch(&mIsoSP);
        if (onISO)
        {
            int isoSpeed=-1;
            isoSpeed = atoi(onISO->label);
            if (isoSpeed > 0)
                fits_update_key_s(fptr, TUINT, "ISOSPEED", &isoSpeed, "ISO Speed", &status);
        }

    }
}
Example #4
0
void QSICCD::addFITSKeywords(fitsfile *fptr, INDI::CCDChip *targetChip)
{
    INDI::CCD::addFITSKeywords(fptr, targetChip);

    int status = 0;
    double electronsPerADU;

    try
    {
        QSICam.get_ElectronsPerADU(&electronsPerADU);
    }
    catch (std::runtime_error &err)
    {
        DEBUGF(INDI::Logger::DBG_ERROR, "get_ElectronsPerADU failed. %s.", err.what());
        return;
    }

    // 2017-09-17 JM: electronsPerADU is wrong in auto mode. So we have to change it manually here.
    if (IUFindOnSwitchIndex(&GainSP) == GAIN_AUTO && PrimaryCCD.getBinX() > 1)
        electronsPerADU = 1.1;

    fits_update_key_s(fptr, TDOUBLE, "EPERADU", &electronsPerADU, "Electrons per ADU", &status);
}
Example #5
0
void INDI::CCD::addFITSKeywords(fitsfile *fptr, CCDChip *targetChip)
{
    int status=0;
    char frame_s[32];
    char dev_name[32];
    char exp_start[32];
    double min_val, max_val;
    double exposureDuration;
    double pixSize1,pixSize2;
    unsigned int xbin, ybin;

    getMinMax(&min_val, &max_val, targetChip);

    xbin = targetChip->getBinX();
    ybin = targetChip->getBinY();


    switch (targetChip->getFrameType())
    {
      case CCDChip::LIGHT_FRAME:
        strcpy(frame_s, "Light");
    break;
      case CCDChip::BIAS_FRAME:
        strcpy(frame_s, "Bias");
    break;
      case CCDChip::FLAT_FRAME:
        strcpy(frame_s, "Flat Field");
    break;
      case CCDChip::DARK_FRAME:
        strcpy(frame_s, "Dark");
    break;
    }

    exposureDuration = targetChip->getExposureDuration();

    pixSize1 = targetChip->getPixelSizeX();
    pixSize2 = targetChip->getPixelSizeY();

    strncpy(dev_name, getDeviceName(), 32);
    strncpy(exp_start, targetChip->getExposureStartTime(), 32);

    fits_update_key_s(fptr, TDOUBLE, "EXPTIME", &(exposureDuration), "Total Exposure Time (s)", &status);

    if(targetChip->getFrameType() == CCDChip::DARK_FRAME)
        fits_update_key_s(fptr, TDOUBLE, "DARKTIME", &(exposureDuration), "Total Exposure Time (s)", &status);

    fits_update_key_s(fptr, TDOUBLE, "PIXSIZE1", &(pixSize1), "Pixel Size 1 (microns)", &status);
    fits_update_key_s(fptr, TDOUBLE, "PIXSIZE2", &(pixSize2), "Pixel Size 2 (microns)", &status);
    fits_update_key_s(fptr, TUINT, "XBINNING", &(xbin) , "Binning factor in width", &status);
    fits_update_key_s(fptr, TUINT, "YBINNING", &(ybin), "Binning factor in height", &status);
    fits_update_key_s(fptr, TSTRING, "FRAME", frame_s, "Frame Type", &status);
    fits_update_key_s(fptr, TDOUBLE, "DATAMIN", &min_val, "Minimum value", &status);
    fits_update_key_s(fptr, TDOUBLE, "DATAMAX", &max_val, "Maximum value", &status);
    fits_update_key_s(fptr, TSTRING, "INSTRUME", dev_name, "CCD Name", &status);
    fits_update_key_s(fptr, TSTRING, "DATE-OBS", exp_start, "UTC start date of observation", &status);

    //fits_write_date(fptr, &status);
}