IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 14, 2013, 6:11:12 AM (13 years ago)
Author:
eugene
Message:

major rework of psphotStack sequence : ignore the CNV images, use the RAW image for detection and all analysis, measure radial apertures on RAW (copied to OUT), then smooth the RAW to the target fwhm, measure radial apertures, etc

File:
1 edited

Legend:

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

    r36086 r36119  
    2222
    2323    pmFPAview *view = pmFPAviewAlloc (0);
    24     pmFPAfile *inputRaw = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW");
    25     pmFPAfile *inputCnv = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.CNV");
    26     pmFPAfile *input = inputRaw ? inputRaw : inputCnv;
     24    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW");
    2725
    2826    if (!input) {
     
    3230
    3331    psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
    34     bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW");
    35     if (useRaw && inputRaw == NULL) {
    36         psLogMsg ("psphot", 1, "PSPHOT.STACK.USE.RAW set but no raw input.");
    37         useRaw = false;
    38     }
    39 
    40     bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES");
    41     bool match_psfs = radial_apertures;
    42     bool needConvolved = radial_apertures || !useRaw;
    43     if (!needConvolved) {
    44         pmFPAfileActivate (config->files, false, "PSPHOT.STACK.INPUT.CNV");
    45         pmFPAfileActivate (config->files, false, "PSPHOT.STACK.MASK.CNV");
    46         pmFPAfileActivate (config->files, false, "PSPHOT.STACK.VARIANCE.CNV");
    47         pmFPAfileActivate (config->files, false, "PSPHOT.STACK.PSF.CNV");
    48     }
    4932
    5033    // just load the full set of images up front except for EXPNUM which we defer
    5134    pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.RAW");
    52     pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.CNV");
    5335    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot.");
    5436
     
    7153                psMemDump("load");
    7254
    73                 if (match_psfs) {
    74                     // Generate the 1st PSF-matched image set (larger target PSFs are generated by smoothing this image)
    75                     if (!psphotStackMatchPSFs (config, view)) {
    76                         psError(psErrorCodeLast(), false, "failure in psphotStackMatchPSFs for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    77                         psFree (view);
    78                         return false;
    79                     }
    80                 } else {
    81                     if (!psphotStackAllocateOutput (config, view, recipe)) {
    82                         psError(psErrorCodeLast(), false, "failure in psphotStackAllocateOutput for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    83                         psFree (view);
    84                         return false;
    85                     }
     55                if (!psphotStackAllocateOutput (config, view, recipe)) {
     56                    psError(psErrorCodeLast(), false, "failure in psphotStackAllocateOutput for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     57                    psFree (view);
     58                    return false;
    8659                }
    8760                psMemDump("stackmatch");
     
    12699
    127100    // Load the appropriate EXPNUM image
    128     pmFPAfileActivate (config->files, true, useRaw ? "PSPHOT.STACK.EXPNUM.RAW" : "PSPHOT.STACK.EXPNUM.CNV");
     101    pmFPAfileActivate (config->files, true, "PSPHOT.STACK.EXPNUM.RAW");
    129102
    130103    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa EXPNUM in psphot.");
     
    146119                if (! readout->data_exists) { continue; }
    147120
    148                 if (!psphotSetNFrames (config, view, useRaw ? inputRaw->name : inputCnv->name)) ESCAPE ("failed to setNFrames.");
     121                if (!psphotSetNFrames (config, view, input->name)) ESCAPE ("failed to setNFrames.");
    149122            }
    150123        }
     
    167140bool UpdateHeadersForReadout (pmConfig *config, pmFPAview *view) {
    168141
    169     psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
    170     bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW");
    171 
    172142    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    173143
     
    179149        psAssert (output, "missing file?");
    180150
    181         pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    182         pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest
    183         pmFPAfile *input = useRaw ? inputRaw : inputCnv;
     151        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    184152        psAssert (input, "missing input file");
    185153
     
    205173        psAssert (output, "missing file?");
    206174
    207         pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    208         pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest
    209         pmFPAfile *input = inputRaw ? inputRaw : inputCnv;
     175        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    210176        psAssert (input, "missing input file");
    211177
     
    242208        psAssert (output, "missing file?");
    243209
    244         pmFPAfile *inputRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    245         pmFPAfile *inputCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", i); // File of interest
    246         pmFPAfile *input = inputRaw ? inputRaw : inputCnv;
     210        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", i); // File of interest
    247211        psAssert (input, "missing input file");
    248212
Note: See TracChangeset for help on using the changeset viewer.