IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11170


Ignore:
Timestamp:
Jan 18, 2007, 6:52:40 PM (19 years ago)
Author:
eugene
Message:

allow objects to lack moments (use peak values as needed -- must be a PSF)

File:
1 edited

Legend:

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

    r10803 r11170  
    1616    if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
    1717
     18    // XXX if a source is faint, it will not have moments measured.
     19    // it must be modelled as a PSF.  In this case, we need to use
     20    // the peak centroid to get the coordinates and get the peak flux
     21    // from the image?
     22
    1823    // use the source moments, etc to guess basic model parameters
    1924    pmModel *modelEXT = pmSourceModelGuess (source, psf->type);
    20     if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    21       modelEXT->params->data.F32[PM_PAR_XPOS] = source->moments->x;
    22       modelEXT->params->data.F32[PM_PAR_YPOS] = source->moments->y;
     25   
     26    // XXX put this in a function of its own..
     27    if (modelEXT == NULL) {
     28        modelEXT = pmModelAlloc(psf->type);
     29        psF32 *PAR = modelEXT->params->data.F32;
     30        PAR[PM_PAR_SKY]  = 0;
     31        // XXX get this from the image pixels
     32        PAR[PM_PAR_I0]   = source->peak->flux;
     33        PAR[PM_PAR_XPOS] = source->peak->xf;
     34        PAR[PM_PAR_YPOS] = source->peak->yf;
    2335    } else {
    24       modelEXT->params->data.F32[PM_PAR_XPOS] = source->peak->xf;
    25       modelEXT->params->data.F32[PM_PAR_YPOS] = source->peak->yf;
     36        // these valuse are set in pmSourceModelGuess, should this rule be in there as well?
     37        if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
     38            modelEXT->params->data.F32[PM_PAR_XPOS] = source->moments->x;
     39            modelEXT->params->data.F32[PM_PAR_YPOS] = source->moments->y;
     40        } else {
     41            modelEXT->params->data.F32[PM_PAR_XPOS] = source->peak->xf;
     42            modelEXT->params->data.F32[PM_PAR_YPOS] = source->peak->yf;
     43        }
    2644    }
    2745
Note: See TracChangeset for help on using the changeset viewer.