IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2009, 3:09:08 PM (17 years ago)
Author:
Paul Price
Message:

Use strict limits on the model to throw out bad PSFs from the envelope calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/psModules/src/imcombine/pmPSFEnvelope.c

    r25491 r25561  
    110110        }
    111111    }
     112
     113    pmModelClassSetLimits(PM_MODEL_LIMITS_STRICT);
    112114
    113115    // Generate fake images with each PSF, and take the envelope
     
    149151        }
    150152
     153        // Test PSF
     154        {
     155            bool goodPSF = true;                                                                // Good PSF?
     156            pmModel *model = pmModelFromPSFforXY(psf, numCols / 2.0, numRows / 2.0, PEAK_FLUX); // Test model
     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;
     161                }
     162            }
     163            psFree(model);
     164            if (!goodPSF) {
     165                psWarning("PSF %d is bad --- not including in envelope calculation.", i);
     166                continue;
     167            }
     168        }
     169
    151170        pmResiduals *resid = psf->residuals;// PSF residuals
    152171        psf->residuals = NULL;
Note: See TracChangeset for help on using the changeset viewer.