IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18788


Ignore:
Timestamp:
Jul 30, 2008, 12:15:15 PM (18 years ago)
Author:
Paul Price
Message:

Work out maximum "valid" radius (for S/N ~ 1; which is what's used by
the moment calculator) and use that for moments.

File:
1 edited

Legend:

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

    r18611 r18788  
    110110    psImageInit(envelope, SKY_VALUE);
    111111    pmReadout *fakeRO = pmReadoutAlloc(NULL); // Fake readout
     112    float maxRadius = 0.0;              // Maximum radius of sources
    112113    for (int i = 0; i < inputs->n; i++) {
    113114        pmPSF *psf = inputs->data[i];   // PSF of interest
     
    142143            psFree(subImage);
    143144            psFree(subEnv);
     145
     146            // Get the radius
     147            pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source
     148            float srcRadius = model->modelRadius(model->params, WEIGHT_VAL); // Radius for source
     149            if (srcRadius > maxRadius) {
     150                maxRadius = srcRadius;
     151            }
     152            psFree(model);
    144153        }
    145154
     
    234243        source->maskObj = NULL;
    235244
    236         if (!pmSourceDefinePixels(source, readout, x, y, (float)radius)) {
     245        if (!pmSourceDefinePixels(source, readout, x, y, maxRadius)) {
    237246            psError(PS_ERR_UNKNOWN, false, "Unable to define pixels for source.");
    238247            psFree(readout);
     
    241250        }
    242251
    243         if (!pmSourceMoments(source, radius)) {
     252        if (!pmSourceMoments(source, maxRadius)) {
    244253            psError(PS_ERR_UNKNOWN, false, "Unable to measure moments for source.");
    245254            psFree(readout);
     
    255264    options->poissonErrorsParams = true;
    256265    options->stats = psStatsAlloc(PSF_STATS);
    257     options->radius = radius;
     266    options->radius = maxRadius;
    258267    options->psfTrendMode = PM_TREND_MAP;
    259268    options->psfTrendNx = xOrder;
Note: See TracChangeset for help on using the changeset viewer.