IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18439


Ignore:
Timestamp:
Jul 9, 2008, 10:08:59 AM (18 years ago)
Author:
eugene
Message:

updates to markVal

File:
1 edited

Legend:

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

    r14655 r18439  
    44bool psphotResidPSF (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf) {
    55
    6   psTimerStart ("psphot");
     6    psTimerStart ("psphot");
    77
    8   for (int i = 0; i < sources->n; i++) {
    9     pmSource *source = sources->data[i];
     8    // bit-mask to mark pixels not used in analysis
     9    psMaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");
     10    assert (markVal);
    1011
    11     // only use the psf stars to build the residual model
    12     if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue;
     12    for (int i = 0; i < sources->n; i++) {
     13        pmSource *source = sources->data[i];
    1314
    14     if (source->mode & PM_SOURCE_MODE_SATSTAR) {
    15         Xo = source->moments->x;
    16         Yo = source->moments->y;
    17         Io = source->peak->flux;
    18     } else {
    19         Xo = source->peak->xf;
    20         Yo = source->peak->yf;
    21         Io = source->peak->flux;
     15        // only use the psf stars to build the residual model
     16        if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue;
     17
     18        if (source->mode & PM_SOURCE_MODE_SATSTAR) {
     19            Xo = source->moments->x;
     20            Yo = source->moments->y;
     21            Io = source->peak->flux;
     22        } else {
     23            Xo = source->peak->xf;
     24            Yo = source->peak->yf;
     25            Io = source->peak->flux;
     26        }
     27
     28        // set PSF parameters for this model (apply 2D shape model)
     29        pmModel *modelPSF = pmModelFromPSFforXY (psf, Xo, Yo, Io);
     30
     31        // XXX need to define the guess flux?
     32        // set the fit radius based on the object flux limit and the model
     33        psphotCheckRadiusPSF (readout, source, modelPSF, markVal);
     34
     35        // set the source PSF model
     36        source->modelPSF = modelPSF;
    2237    }
    23 
    24     // set PSF parameters for this model (apply 2D shape model)
    25     pmModel *modelPSF = pmModelFromPSFforXY (psf, Xo, Yo, Io);
    26 
    27     // XXX need to define the guess flux?
    28     // set the fit radius based on the object flux limit and the model
    29     psphotCheckRadiusPSF (readout, source, modelPSF);
    30 
    31     // set the source PSF model
    32     source->modelPSF = modelPSF;
    33   }
    34   psLogMsg ("psphot.models", 4, "built models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot"));
    35   return true;
     38    psLogMsg ("psphot.models", 4, "built models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot"));
     39    return true;
    3640}
    3741
Note: See TracChangeset for help on using the changeset viewer.