IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32313


Ignore:
Timestamp:
Sep 5, 2011, 8:47:53 AM (15 years ago)
Author:
eugene
Message:

make linear stack match linear fit (but we no longer use it anyway)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psphot/src/psphotFitSourcesLinearStack.c

    r31452 r32313  
    6464          // turn this bit off and turn it on again if we keep this source
    6565          source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT;
     66
     67          // skip non-astronomical objects (very likely defects)
     68          if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
     69          if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
     70
     71          // do not include CRs in the full ensemble fit
     72          if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue;
     73
     74          // do not include MOMENTS_FAILURES in the fit
     75          if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue;
     76
     77          if (final) {
     78              if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) continue;
     79          } else {
     80              // if (source->mode & PM_SOURCE_MODE_BLEND) continue;
     81          }
    6682
    6783          // generate model for sources without, or skip if we can't
     
    8399          }
    84100
    85           source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
     101          bool isPSF = false;
     102          pmModel *model = pmSourceGetModel (&isPSF, source);
     103
     104          // clear the 'mark' pixels and remask on the fit aperture
     105          psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
     106          psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, model->fitRadius, "OR", markVal);
     107
     108          // we call this function multiple times. for the first time, we have only PSF models for all objects
     109          // the second time has extended sources.  If we ever fit the PSF model, we should raise this bit
     110          source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
     111          if (isPSF) {
     112              source->mode |= PM_SOURCE_MODE_PSFMODEL;
     113          }         
    86114          psArrayAdd (fitSources, 100, source);
    87115        }
     
    166194        model->params->data.F32[PM_PAR_I0] = norm->data.F32[i];
    167195        model->dparams->data.F32[PM_PAR_I0] = errors->data.F32[i];
     196
     197        // clear the 'mark' pixels so the subtraction covers the full window
     198        psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    168199
    169200        // subtract object
     
    190221    psFree (errors);
    191222
    192     psLogMsg ("psphot.ensemble", PS_LOG_INFO, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear"));
     223    psLogMsg ("psphot.ensemble", PS_LOG_WARN, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear"));
    193224    return true;
    194225}
Note: See TracChangeset for help on using the changeset viewer.