IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 3, 2009, 4:39:36 PM (17 years ago)
Author:
Paul Price
Message:

Moving in some stuff from pap_branch_20081216 to set the image and source identifiers in FITS files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmHDU.c

    r21183 r21279  
    243243    return hduWrite(hdu, hdu->weights, hdu->masks, maskVal, fits);
    244244}
     245
     246bool pmHDUWriteIdentifiers(pmHDU *hdu, psS64 imageId, psS64 sourceId)
     247{
     248    PS_ASSERT_PTR_NON_NULL(hdu, false);
     249
     250    // XXX Get header keyword name from camera configuration
     251
     252    psMetadataAddS64(hdu->header, PS_LIST_TAIL, "IMAGEID", PS_META_REPLACE, "Image identifier", imageId);
     253    psMetadataAddS64(hdu->header, PS_LIST_TAIL, "SOURCEID", PS_META_REPLACE, "Source identifier", sourceId);
     254    return true;
     255}
     256
     257bool pmHDUReadIdentifiers(psS64 *imageId, psS64 *sourceId, const pmHDU *hdu)
     258{
     259    PS_ASSERT_PTR_NON_NULL(hdu, false);
     260
     261    // XXX Get header keyword name from camera configuration
     262
     263    bool imageOK, sourceOK;             // Status of MD lookups
     264    *imageId = psMetadataLookupS64(&imageOK, hdu->header, "IMAGEID");
     265    *sourceId = psMetadataLookupS64(&sourceOK, hdu->header, "SOURCEID");
     266
     267    return imageOK && sourceOK;
     268}
Note: See TracChangeset for help on using the changeset viewer.