IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12984


Ignore:
Timestamp:
Apr 24, 2007, 7:04:52 AM (19 years ago)
Author:
magnier
Message:

fixed bounding range, normalization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_02_branch/psModules/src/objects/pmSource.c

    r12980 r12984  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.25.4.5 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-04-24 03:15:27 $
     8 *  @version $Revision: 1.25.4.6 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-04-24 17:04:52 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    755755    // in some places (psphotEnsemble), we need a normalized version
    756756    // in others, we just want the model.  which is more commonly used?
     757    // modelFlux always has unity normalization (I0 = 1.0)
    757758    pmModelAdd (source->modelFlux, source->maskObj, model, PM_MODEL_OP_FULL | PM_MODEL_OP_NORM);
    758759    return true;
     
    779780        assert (dX >= 0);
    780781        assert (dY >= 0);
    781         assert (dX + source->modelFlux->numCols < source->pixels->numCols);
    782         assert (dY + source->modelFlux->numRows < source->pixels->numRows);
     782        assert (dX + source->modelFlux->numCols <= source->pixels->numCols);
     783        assert (dY + source->modelFlux->numRows <= source->pixels->numRows);
    783784       
    784         float Io = 1.0;
     785        // modelFlux has unity normalization
     786        float Io = model->params->data.F32[PM_PAR_I0];
    785787        if (mode & PM_MODEL_OP_NORM) {
    786             Io = 1.0 / model->params->data.F32[PM_PAR_I0];
     788            Io = 1.0;
     789        }
     790
     791        psU8 **mask = NULL;
     792        if (source->maskObj) {
     793            mask = source->maskObj->data.U8;
    787794        }
    788795
     
    792799            for (int ix = 0; ix < source->modelFlux->numCols; ix++) {
    793800                int ox = ix + dX;
     801                if (mask && mask[iy][ix]) continue;
    794802                float value = Io*source->modelFlux->data.F32[iy][ix];
    795803                if (add) {
Note: See TracChangeset for help on using the changeset viewer.