- Timestamp:
- Sep 27, 2009, 10:23:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psModules/src/objects/pmSource.c
r25354 r25588 933 933 if (model == NULL) return false; // model must be defined 934 934 935 bool addNoise = mode & PM_MODEL_OP_NOISE; 936 935 937 if (source->modelFlux) { 936 938 // add in the pixels from the modelFlux image … … 954 956 955 957 psF32 **target = source->pixels->data.F32; 956 if ( mode & PM_MODEL_OP_NOISE) {957 // XXX need to scale by the gain... 958 if (addNoise) { 959 // when adding noise, we assume the shape and Io have been modified 958 960 target = source->variance->data.F32; 959 961 } 960 962 961 // XXX need to respect the source and model masks?962 963 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { 963 964 int oy = iy + dY; … … 973 974 } 974 975 } 976 if (!addNoise) { 977 if (add) { 978 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 979 } else { 980 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 981 } 982 } 975 983 return true; 976 984 } 977 985 978 986 psImage *target = source->pixels; 979 if ( mode & PM_MODEL_OP_NOISE) {987 if (addNoise) { 980 988 target = source->variance; 981 989 } 982 990 983 if (add) { 984 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 985 } else { 986 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 991 if (!addNoise) { 992 if (add) { 993 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 994 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 995 } else { 996 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 997 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 998 } 987 999 } 988 1000
Note:
See TracChangeset
for help on using the changeset viewer.
