IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2010, 1:55:26 PM (16 years ago)
Author:
eugene
Message:

working on psphotStack psf matching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c

    r27883 r27884  
    6464bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) {
    6565
    66     // find the currently selected readout
    67     pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest
    68     psAssert (fileRaw, "missing file?");
     66    pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index);
     67    if (!fileSrc) {
     68        psError(PSPHOT_ERR_CONFIG, false, "desired convolution source is missing");
     69        return false;
     70    }
    6971
    70     pmFPAfile *fileCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest
    71     psAssert (fileCnv, "missing file?");
     72    pmFPAfile *fileOut = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.IMAGE", index); // File of interest
     73    psAssert (fileOut, "missing output file?");
    7274
    73     pmReadout *readoutRaw = pmFPAviewThisReadout(view, fileRaw->fpa);
    74     psAssert (readoutRaw, "missing readout?");
     75    pmReadout *readoutSrc = pmFPAviewThisReadout(view, fileSrc->fpa);
     76    psAssert (readoutSrc, "missing readout?");
    7577
    76     pmReadout *readoutCnv = pmFPAviewThisReadout(view, fileCnv->fpa);
    77     psAssert (readoutCnv, "missing readout?");
     78    pmReadout *readoutOut = pmFPAviewThisReadout(view, fileOut->fpa);
     79    if (readoutOut == NULL) {
     80        readoutOut = pmFPAGenerateReadout(config, view, "PSPHOT.STACK.OUTPUT.IMAGE", fileSrc->fpa, NULL, 0);
     81        psAssert (readoutOut, "missing readout?");
     82    }
    7883
    7984    // set NAN pixels to 'SAT'
    8085    psImageMaskType maskVal = pmConfigMaskGet("SAT", config);
    81     if (!pmReadoutMaskNonfinite(readoutRaw, maskVal)) {
     86    if (!pmReadoutMaskNonfinite(readoutSrc, maskVal)) {
    8287        psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout.");
    8388        return false;
     
    8691    // Image Matching (PSFs or just flux)
    8792    if (options->convolve) {
    88         matchKernel(config, readoutCnv, readoutRaw, options, index);
    89         saveMatchData(readoutCnv, options, index);
     93        matchKernel(config, readoutOut, readoutSrc, options, index);
     94        saveMatchData(readoutOut, options, index);
    9095        // renormKernel(readoutCnv, options, index);
    9196    } else {
     
    97102    }
    98103
    99     rescaleData(readoutCnv, config, options, index);
     104    rescaleData(readoutOut, config, options, index);
    100105
    101     dumpImage(readoutCnv, readoutRaw, index, "convolved");
     106    dumpImage(readoutOut, readoutSrc, index, "convolved");
    102107
    103108    return true;
Note: See TracChangeset for help on using the changeset viewer.