IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9834


Ignore:
Timestamp:
Nov 3, 2006, 5:05:49 AM (20 years ago)
Author:
eugene
Message:

fixed formula for normalization error

Location:
trunk/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotEnsemblePSF.c

    r9813 r9834  
    141141    psSparse *sparse = psSparseAlloc (models->n, 100);
    142142    psVector *weight = psVectorAlloc (models->n, PS_TYPE_F32);
     143    psVector *errors = psVectorAlloc (models->n, PS_TYPE_F32);
    143144
    144145    for (int i = 0; i < models->n; i++) {
     
    150151        r = pmSourceCrossProduct (Mi, Mi, CONSTANT_PHOTOMETRIC_WEIGHTS);
    151152        weight->data.F32[i] = r;
     153
     154        // the formal error depends on the weighting scheme
     155        if (CONSTANT_PHOTOMETRIC_WEIGHTS) {
     156            float var = pmSourceCrossProduct (Mi, Mi, false);
     157            errors->data.F32[i] = 1.0 / sqrt(var);
     158        } else {
     159            errors->data.F32[i] = 1.0 / sqrt(r);
     160        }
    152161
    153162        psSparseMatrixElement (sparse, i, i, 1.0);
     
    200209        }
    201210        Fi->modelPSF->params->data.F32[PM_PAR_I0] = norm->data.F32[i];
    202         Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i]));
     211        // XXX I was using this before, but it is not strictly accurate
    203212        // XXX EAM : this factor of sqrt(2) makes the errors consistent, but I don't understand it
     213        // Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i]));
     214        Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = errors->data.F32[i];
    204215
    205216        // subtract object
     
    228239    psFree (norm);
    229240    psFree (weight);
     241    psFree (errors);
    230242
    231243    psLogMsg ("psphot.emsemble", 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot"));
  • trunk/psphot/src/psphotFindPeaks.c

    r9270 r9834  
    2929
    3030    // XXX make this a user-option?
    31     // psphotSaveImage (NULL, smooth_im, "imsmooth.fits");
    32     // psphotSaveImage (NULL, smooth_wt, "wtsmooth.fits");
     31    if (psTraceGetLevel("psphot") > 5) {
     32        psphotSaveImage (NULL, smooth_im, "imsmooth.fits");
     33        psphotSaveImage (NULL, smooth_wt, "wtsmooth.fits");
     34    }
    3335
    3436    psTimerStart ("psphot");
Note: See TracChangeset for help on using the changeset viewer.