IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36241


Ignore:
Timestamp:
Oct 26, 2013, 2:57:09 PM (13 years ago)
Author:
eugene
Message:

add pcm->poissonErrors; if not(poissonErrors), set variance to a constant in pmPCM_Minimize.c

Location:
branches/eam_branches/ipp-20130904/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot/src/psphotExtendedSourceFits.c

    r36198 r36241  
    141141    fitOptions->chisqConvergence = chisqConvergence;
    142142    fitOptions->isInteractive    = isInteractive;
     143
     144    // use poissonian errors or local-sky errors
     145    fitOptions->poissonErrors = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_POISSON");
     146    if (!status) fitOptions->poissonErrors = true;
    143147
    144148    // maskVal is used to test for rejected pixels, and must include markVal
  • branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c

    r36218 r36241  
    102102    fitOptions->mode           = PM_SOURCE_FIT_EXT_AND_SKY;
    103103    fitOptions->covarFactor    = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix
     104
     105    // Poisson or Constant weight for chisq tests?
     106    fitOptions->poissonErrors = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_POISSON");
     107    if (!status) fitOptions->poissonErrors = true;
    104108
    105109    // source analysis is done in S/N order (brightest first)
     
    284288    float YM = 0.0;
    285289    float MM = 0.0;
    286     bool usePoisson = true;
     290    bool usePoisson = pcm->poissonErrors;
    287291
    288292    for (int iy = 0; iy < source->pixels->numRows; iy++) {
     
    316320    float dIo = sqrt (1.0 / MM);
    317321    float Chisq = (YY - 2 * Io * YM + Io * Io * MM) / (float) nPix;
     322    // NOTE : if !poissonErrors, Chisq is not really the chisq, but is scaled by the flux.
    318323
    319324    pcm->modelConv->params->data.F32[PM_PAR_I0] = Io;
Note: See TracChangeset for help on using the changeset viewer.