IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13335


Ignore:
Timestamp:
May 10, 2007, 9:48:35 AM (19 years ago)
Author:
magnier
Message:

adding PM_MODEL_OP_NOISE

Location:
trunk/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModel.h

    r13034 r13335  
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-04-26 01:20:29 $
     7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-05-10 19:48:35 $
    99 *
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333    PM_MODEL_OP_RES0    = 0x02,
    3434    PM_MODEL_OP_RES1    = 0x04,
    35     PM_MODEL_OP_FULL   = 0x07,
     35    PM_MODEL_OP_FULL    = 0x07,
    3636    PM_MODEL_OP_SKY     = 0x08,
    37     PM_MODEL_OP_CENTER = 0x10,
     37    PM_MODEL_OP_CENTER  = 0x10,
    3838    PM_MODEL_OP_NORM    = 0x20,
     39    PM_MODEL_OP_NOISE   = 0x40,
    3940} pmModelOpMode;
    4041
  • trunk/psModules/src/objects/pmSource.c

    r13034 r13335  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-04-26 01:20:29 $
     8 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-05-10 19:48:35 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    799799        }
    800800
     801        psF32 **target = source->pixels->data.F32;
     802        if (mode & PM_MODEL_OP_NOISE) {
     803          target = source->noise->data.F32;
     804        }
     805
    801806        // XXX need to respect the source and model masks?
    802807        for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
     
    807812                float value = Io*source->modelFlux->data.F32[iy][ix];
    808813                if (add) {
    809                     source->pixels->data.F32[oy][ox] += value;
     814                    target[oy][ox] += value;
    810815                } else {
    811                     source->pixels->data.F32[oy][ox] -= value;
     816                    target[oy][ox] -= value;
    812817                }
    813818            }
     
    816821    }
    817822
     823    psImage *target = source->pixels;
     824    if (mode & PM_MODEL_OP_NOISE) {
     825        target = source->noise;
    818826    if (add) {
    819         status = pmModelAdd (source->pixels, source->maskObj, model, PM_MODEL_OP_FULL);
     827        status = pmModelAdd (target, source->maskObj, model, PM_MODEL_OP_FULL);
    820828    } else {
    821         status = pmModelSub (source->pixels, source->maskObj, model, PM_MODEL_OP_FULL);
     829        status = pmModelSub (target, source->maskObj, model, PM_MODEL_OP_FULL);
    822830    }
    823831
Note: See TracChangeset for help on using the changeset viewer.