IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23309


Ignore:
Timestamp:
Mar 12, 2009, 3:23:37 PM (17 years ago)
Author:
Paul Price
Message:

Adding route for pre-calculated kernel using new function, pmSubtractionMatchPrecalc.

Location:
trunk/ppSub/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubCamera.c

    r23299 r23309  
    180180
    181181    // Convolved input image
    182     defineOutputFile(config, input, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE);
    183     defineOutputFile(config, input, "PPSUB.INPUT.CONV.MASK", PM_FPA_FILE_MASK);
     182    pmFPAfile *inConvImage = defineOutputFile(config, input, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE);
     183    pmFPAfile *inConvMask = defineOutputFile(config, input, "PPSUB.INPUT.CONV.MASK", PM_FPA_FILE_MASK);
     184    if (!inConvImage || !inConvMask) {
     185        psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     186        return false;
     187    }
    184188    if (inVar) {
    185         defineOutputFile(config, input, "PPSUB.INPUT.CONV.VARIANCE", PM_FPA_FILE_VARIANCE);
     189        pmFPAfile *inConvVar = defineOutputFile(config, input, "PPSUB.INPUT.CONV.VARIANCE",
     190                                                PM_FPA_FILE_VARIANCE);
     191        if (!inConvVar) {
     192            psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     193            return false;
     194        }
    186195    }
    187196
    188197    // Convolved ref image
    189     defineOutputFile(config, input, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE);
    190     defineOutputFile(config, input, "PPSUB.REF.CONV.MASK", PM_FPA_FILE_MASK);
     198    pmFPAfile *refConvImage = defineOutputFile(config, input, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE);
     199    pmFPAfile *refConvMask = defineOutputFile(config, input, "PPSUB.REF.CONV.MASK", PM_FPA_FILE_MASK);
     200    if (!refConvImage || !refConvMask) {
     201        psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     202        return false;
     203    }
    191204    if (refVar) {
    192         defineOutputFile(config, input, "PPSUB.REF.CONV.VARIANCE", PM_FPA_FILE_VARIANCE);
     205        pmFPAfile *refConvVar = defineOutputFile(config, input, "PPSUB.REF.CONV.VARIANCE",
     206                                                 PM_FPA_FILE_VARIANCE);
     207        if (!refConvVar) {
     208            psError(PS_ERR_UNKNOWN, false, "Unable to define output files");
     209            return false;
     210        }
    193211    }
    194212
  • trunk/ppSub/src/ppSubMatchPSFs.c

    r23235 r23309  
    4848
    4949    bool mdok;                          // Status of MD lookup
     50
     51    // Load pre-calculated kernel, if available
     52    pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNEL"); // RO with kernel
    5053
    5154    // Sources in image, used for stamps: these must be loaded from previous analysis stages
     
    134137
    135138    // Match the PSFs
    136     if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing, threshold,
    137                             sources, stampsName, type, size, order, widths, orders, inner, ringsOrder,
    138                             binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, sys,
    139                             maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) {
    140         psError(PS_ERR_UNKNOWN, false, "Unable to match images.");
    141         return false;
     139    if (kernelRO) {
     140        if (!pmSubtractionMatchPrecalc(inConv, refConv, inRO, refRO, kernelRO->analysis,
     141                                       stride, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac)) {
     142            psError(PS_ERR_UNKNOWN, false, "Unable to convolve images.");
     143            return false;
     144        }
     145    } else {
     146        if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing,
     147                                threshold, sources, stampsName, type, size, order, widths, orders, inner,
     148                                ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter,
     149                                rej, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) {
     150            psError(PS_ERR_UNKNOWN, false, "Unable to match images.");
     151            return false;
     152        }
    142153    }
    143154
Note: See TracChangeset for help on using the changeset viewer.