IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:34:39 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201 (substantially changes to the kernel matching code; updates to pmDetection container, added pmPattern, etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmPSFEnvelope.c

    r25754 r26893  
    6565                     int radius,        // Radius of each PSF
    6666                     const char *modelName,// Name of PSF model to use
    67                      int xOrder, int yOrder // Order for PSF variation fit
     67                     int xOrder, int yOrder, // Order for PSF variation fit
     68                     psImageMaskType maskVal
    6869                     )
    6970{
     
    154155            pmModelClassSetLimits(PM_MODEL_LIMITS_IGNORE);
    155156            pmModel *model = pmModelFromPSFforXY(psf, numCols / 2.0, numRows / 2.0, PEAK_FLUX); // Test model
    156             model->modelSetLimits(PM_MODEL_LIMITS_STRICT);
    157             for (int j = 0; j < model->params->n && goodPSF; j++) {
    158                 if (!model->modelLimits(PS_MINIMIZE_PARAM_MIN, j, model->params->data.F32, NULL) ||
    159                     !model->modelLimits(PS_MINIMIZE_PARAM_MAX, j, model->params->data.F32, NULL)) {
    160                     goodPSF = false;
     157            if (!model) {
     158                goodPSF = false;
     159            } else {
     160                model->modelSetLimits(PM_MODEL_LIMITS_STRICT);
     161                for (int j = 0; j < model->params->n && goodPSF; j++) {
     162                    if (!model->modelLimits(PS_MINIMIZE_PARAM_MIN, j, model->params->data.F32, NULL) ||
     163                        !model->modelLimits(PS_MINIMIZE_PARAM_MAX, j, model->params->data.F32, NULL)) {
     164                        goodPSF = false;
     165                    }
    161166                }
    162             }
    163             psFree(model);
     167                psFree(model);
     168            }
    164169            if (!goodPSF) {
    165170                psWarning("PSF %d is bad --- not including in envelope calculation.", i);
     
    360365
    361366        // measure the source moments: tophat windowing, no pixel S/N cutoff
    362         if (!pmSourceMoments(source, maxRadius, 0.0, 1.0)) {
     367        // XXX probably should be passing the maskVal to this function so we can pass it along here...
     368        if (!pmSourceMoments(source, maxRadius, 0.0, 1.0, maskVal)) {
    363369            // Can't do anything about it; limp along as best we can
    364370            psErrorClear();
Note: See TracChangeset for help on using the changeset viewer.