IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38376


Ignore:
Timestamp:
Jun 5, 2015, 9:09:14 AM (11 years ago)
Author:
bills
Message:

Add recipe value SAVE.INPUT.SOURCES.HEADER which tells pmReadoutReadObjects to
save a copy of the fits header for the input file on readout->analysis.
This will be used by psphotStack -updatemode to obtain results from the original
psphotStack run that are needed for the upate and for its the output cmf file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r37964 r38376  
    10541054        }
    10551055
     1056        bool saveSourcesHeader = psMetadataLookupBool(&status, recipe, "SAVE.INPUT.SOURCES.HEADER");;
    10561057        // advance to the IMAGE HEADER extension
    1057         if (hdu->header == NULL) {
     1058        if (saveSourcesHeader || hdu->header == NULL) {
    10581059            // if the IMAGE header does not exist, we have no data for this view
    10591060            if (!psFitsMoveExtNameClean (file->fits, headname)) {
    1060                 readout->data_exists = false;
     1061                if (hdu->header == NULL) {
     1062                    readout->data_exists = false;
     1063                }
    10611064                psFree (headname);
    10621065                psFree (dataname);
     
    10641067                return true;
    10651068            }
    1066             hdu->header = psFitsReadHeader (NULL, file->fits);
     1069            psMetadata *sourcesHeader = psFitsReadHeader (NULL, file->fits);
     1070            // Save the hdu header for the sources on readout->analysis.
     1071            // psphotStack uses this in updateMode
     1072            psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "INPUT.SOURCES.HEADER",
     1073                PS_DATA_UNKNOWN | PS_META_REPLACE, "fits header from input sources file", sourcesHeader);
     1074            if (hdu->header == NULL) {
     1075                hdu->header = sourcesHeader;
     1076            } else {
     1077                psFree(sourcesHeader);
     1078            }
    10671079        }
    10681080
Note: See TracChangeset for help on using the changeset viewer.