IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23167


Ignore:
Timestamp:
Mar 3, 2009, 5:33:29 PM (17 years ago)
Author:
Paul Price
Message:

Add software version to header.

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r23156 r23167  
    1919psString        psphotVersionLong(void);
    2020bool            psphotVersionHeader(psMetadata *header);
     21bool            psphotVersionHeaderFull(psMetadata *header);
    2122
    2223bool            psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
  • trunk/psphot/src/psphotImageLoop.c

    r21458 r23167  
    2626
    2727    pmFPAview *view = pmFPAviewAlloc (0);
     28    pmHDU *lastHDU = NULL;              // Last HDU updated
    2829
    2930    // files associated with the science image
     
    6465                psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    6566                if (! readout->data_exists) { continue; }
     67
     68                // Update the header
     69                {
     70                    pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
     71                    if (hdu && hdu != lastHDU) {
     72                        psphotVersionHeaderFull(hdu->header);
     73                        lastHDU = hdu;
     74                    }
     75                }
    6676
    6777                // run the actual photometry analysis on this chip/cell/readout
  • trunk/psphot/src/psphotVersion.c

    r23161 r23167  
    7575    return true;
    7676}
     77
     78
     79bool psphotVersionHeaderFull(psMetadata *header)
     80{
     81    PS_ASSERT_METADATA_NON_NULL(header, false);
     82
     83    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
     84    psString timeString = psTimeToISO(time); // The time in an ISO string
     85    psFree(time);
     86    psString history = NULL;               // History string
     87    psStringAppend(&history, "ppImage at %s", timeString);
     88    psFree(timeString);
     89    psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history);
     90    psFree(history);
     91
     92    psLibVersionHeader(header);
     93    psModulesVersionHeader(header);
     94    psphotVersionHeader(header);
     95
     96    return true;
     97}
Note: See TracChangeset for help on using the changeset viewer.