IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2005, 3:49:21 PM (21 years ago)
Author:
eugene
Message:

rework with masks and noise array

File:
1 edited

Legend:

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

    r4129 r4216  
    4646}
    4747
    48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName) {
     48pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS) {
    4949 
    5050    int Nflt = 0;
     
    5858        psSource *source = test->sources->data[i];
    5959        psModel  *model  = pmSourceModelGuess (source, test->modelType);
    60 
     60        x = source->peak->x;
     61        y = source->peak->y;
     62
     63        // set temporary object mask and fit object
    6164        // fit model as FLT, not PSF (mask & skip poor fits)
    62         if (!pmSourceFitModel (source, model, false)) {
     65        psImageKeepCircle (source->mask, x, y, RADIUS, OR, 0x80);
     66        status = pmSourceFitModel (source, model, false);
     67        psImageKeepCircle (source->mask, x, y, RADIUS, AND, 0x7f);
     68
     69        if (!status) {
    6370          test->mask->data.U8[i] = 1;
    6471          continue;
     
    96103        psModel  *modelPSF = psModelFromPSF (modelFLT, test->psf); // set shape for this model
    97104
    98         // fit model as PSF, not FLT (skip poor fits)
    99         if (!pmSourceFitModel (source, modelPSF, true)) {
     105        psImageKeepCircle (source->mask, RADIUS, OR, 0x80);
     106        status = pmSourceFitModel (source, modelPSF, true);
     107        psImageKeepCircle (source->mask, RADIUS, AND, 0x7f);
     108
     109        // skip poor fits
     110        if (!status) {
    100111          test->mask->data.U8[i] = 1;
    101112          continue;
     
    224235}
    225236
    226 // this was an attempt to measure ap-fit using image stats.  it was giving
    227 // strangely wrong answers. 
    228 # if (0)
    229         psImage  *pixels = psImageCopy (NULL, source->pixels, source->pixels->type.type);
    230         pixels->col0 = source->pixels->col0;
    231         pixels->row0 = source->pixels->row0;
    232         // psImageCopy does not retain the parent offset
    233         // this copy is relative to the parent array.
    234 
    235         pmSourceSubModel (pixels, source->mask, model, false);
    236 
    237         // use a robust statistic or not?
    238         psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN);
    239         psImageStats (stats, pixels, NULL, 0);
    240         // psImageStats (stats, pixels, source->mask, 0);
    241         // XXX this should be the SUM, but we don't have such a statistic
    242         // XXX given the mask, we need stat functions to return Npixels used
    243 # endif
Note: See TracChangeset for help on using the changeset viewer.