IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 22, 2011, 5:08:37 PM (15 years ago)
Author:
eugene
Message:

allow pcm fitting with a 1d gauss instead of full convolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmPCMdata.c

    r31451 r31926  
    4141#include "pmPCMdata.h"
    4242
     43# define USE_DELTA_PSF 0
     44# define USE_1D_GAUSS 1
     45
    4346static void pmPCMdataFree (pmPCMdata *pcm) {
    4447
     
    8891    pcm->constraint = NULL;
    8992    pcm->nDOF = 0;
     93
     94    // full convolution with the PSF is expensive.  if we have to save time, we can do a 1D
     95    // convolution with a Gaussian approximation to the kernel
     96    pcm->use1Dgauss = false;
     97    pcm->nsigma = 3.0;
     98    pcm->sigma = 1.0; // this should be set to something sensible when the psf is known
    9099
    91100    return pcm;
     
    257266    pcm->nDOF = nPix - nParams;
    258267
     268# if (USE_1D_GAUSS)
     269    pmModel *modelPSF = source->modelPSF;
     270    psAssert (modelPSF, "psf model must be defined");
     271   
     272    psEllipseShape shape;
     273    psEllipseAxes axes;
     274
     275    shape.sx  = modelPSF->params->data.F32[PM_PAR_SXX];
     276    shape.sy  = modelPSF->params->data.F32[PM_PAR_SYY];
     277    shape.sxy = modelPSF->params->data.F32[PM_PAR_SXY];
     278    axes = psEllipseShapeToAxes (shape, 20.0);
     279   
     280    float FWHM_MAJOR = 2*modelPSF->modelRadius (modelPSF->params, 0.5*modelPSF->params->data.F32[PM_PAR_I0]);
     281    float FWHM_MINOR = FWHM_MAJOR * (axes.minor / axes.major);
     282
     283    pcm->use1Dgauss = true;
     284    pcm->sigma = 0.5 * (FWHM_MAJOR + FWHM_MINOR) / 2.35;
     285    pcm->nsigma = 2.0;
     286# endif
     287
    259288    return pcm;
    260289}
Note: See TracChangeset for help on using the changeset viewer.