IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2009, 5:48:09 PM (17 years ago)
Author:
Paul Price
Message:

Doing our best to cope when working with skycells on the edge of the FoV --- e.g., the PSF is not necessarily defined in the centre of the image. If the model or moments aren't good, then don't use the source to fit the PSF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmReadoutFake.c

    r23955 r23960  
    8282
    8383    int numSources = sources->n;          // Number of stars
    84 
    85     float flux0 = NAN;                  // Flux for central intensity of 1.0
    86     if (normalisePeak) {
    87         pmModel *fakeModel = pmModelFromPSFforXY(psf, (float)numCols / 2.0, (float)numRows / 2.0,
    88                                                  1.0); // Fake model, with central intensity of 1.0
    89         psAssert(fakeModel, "failed to generate model: should this be an error or not?");
    90 
    91         if (circularise && !circulariseModel(fakeModel)) {
    92             psError(PS_ERR_UNKNOWN, false, "Unable to circularise PSF model.");
    93             psFree(fakeModel);
    94             return false;
    95         }
    96 
    97         flux0 = fakeModel->modelFlux(fakeModel->params); // Flux for central intensity of 1.0
    98         psFree(fakeModel);
    99     }
    100 
    10184    for (int i = 0; i < numSources; i++) {
    10285        pmSource *source = sources->data[i]; // Source of interest
     
    120103
    121104        float flux = powf(10.0, -0.4 * source->psfMag); // Flux of source
     105
    122106        if (normalisePeak) {
    123             flux /= flux0;
     107            // Normalise flux
     108            pmModel *normModel = pmModelFromPSFforXY(psf, x, y, 1.0); // Model for normalisation
     109            if (!normModel || (normModel->flags & MODEL_MASK)) {
     110                psFree(normModel);
     111                continue;
     112            }
     113            if (circularise && !circulariseModel(normModel)) {
     114                psError(PS_ERR_UNKNOWN, false, "Unable to circularise PSF model.");
     115                psFree(normModel);
     116                return false;
     117            }
     118
     119            flux /= normModel->modelFlux(normModel->params);
     120            psFree(normModel);
    124121        }
    125122
Note: See TracChangeset for help on using the changeset viewer.