IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32704


Ignore:
Timestamp:
Nov 18, 2011, 11:14:36 AM (14 years ago)
Author:
eugene
Message:

make sure the psphot output headers are copied to the output container

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotStackImageLoop.c

    r32348 r32704  
    1010bool UpdateHeadersForFPA (pmConfig *config, pmFPAview *view);
    1111bool UpdateHeadersForChip (pmConfig *config, pmFPAview *view);
     12bool UpdateHeadersForReadout (pmConfig *config, pmFPAview *view);
    1213
    1314bool psphotStackImageLoop (pmConfig *config) {
     
    6667                    return false;
    6768                }
     69
     70                UpdateHeadersForReadout(config, view);
     71
    6872                psMemDump("psphot");
    6973            }
     
    101105}
    102106
     107bool UpdateHeadersForReadout (pmConfig *config, pmFPAview *view) {
     108
     109    psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
     110    bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW");
     111
     112    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
     113
     114    // loop over the available readouts
     115    for (int i = 0; i < num; i++) {
     116
     117        // find the currently selected readout
     118        pmFPAfile *output = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.IMAGE", i); // File of interest
     119        psAssert (output, "missing file?");
     120
     121        pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
     122        pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest
     123        pmFPAfile *input = useRaw ? inputRaw : inputCnv;
     124        psAssert (input, "missing input file");
     125
     126        // just copy the input headers to the output headers, then update version info
     127        pmReadout *inReadout = pmFPAviewThisReadout(view, input->fpa); ///< Chip in the input
     128        pmReadout *outReadout = pmFPAviewThisReadout(view, output->fpa); ///< Chip in the output
     129
     130        psMetadata *header = psMetadataLookupPtr (NULL, inReadout->analysis, "PSPHOT.HEADER");
     131        psMetadataAdd (outReadout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER",  PS_DATA_METADATA, "header stats", header);
     132    }
     133    return true;
     134}
     135
    103136bool UpdateHeadersForChip (pmConfig *config, pmFPAview *view) {
    104137
Note: See TracChangeset for help on using the changeset viewer.