- Timestamp:
- May 29, 2012, 4:55:13 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSource.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20111122/psModules merged: 33044,33085,33087,33096,33638
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120405/psModules/src/objects/pmSource.c
r33690 r33947 50 50 psFree(tmp->pixels); 51 51 psFree(tmp->variance); 52 psFree(tmp->modelVar); 52 53 psFree(tmp->maskObj); 53 54 psFree(tmp->maskView); … … 76 77 psFree (source->pixels); 77 78 psFree (source->variance); 79 psFree (source->modelVar); 78 80 psFree (source->maskObj); 79 81 psFree (source->maskView); … … 83 85 source->pixels = NULL; 84 86 source->variance = NULL; 87 source->modelVar = NULL; 85 88 source->maskObj = NULL; 86 89 source->maskView = NULL; … … 112 115 source->pixels = NULL; 113 116 source->variance = NULL; 117 source->modelVar = NULL; 114 118 source->maskObj = NULL; 115 119 source->maskView = NULL; … … 198 202 source->pixels = in->pixels ? psImageCopyView(NULL, in->pixels) : NULL; 199 203 source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL; 204 source->modelVar = NULL; 200 205 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 201 206 … … 1026 1031 1027 1032 bool addNoise = mode & PM_MODEL_OP_NOISE; 1033 bool addModelVar = mode & PM_MODEL_OP_MODELVAR; 1034 1035 if (addModelVar) psAssert (source->modelVar, "programming error"); 1028 1036 1029 1037 // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled) … … 1048 1056 } 1049 1057 1050 psF32 **target = source->pixels->data.F32;1058 psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1051 1059 1052 1060 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 1063 1071 } 1064 1072 } 1065 if (add) { 1066 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1067 } else { 1068 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1073 if (!addModelVar) { 1074 if (add) { 1075 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1076 } else { 1077 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1078 } 1069 1079 } 1070 1080 return true; … … 1075 1085 target = source->variance; 1076 1086 } 1087 if (addModelVar) { 1088 target = source->modelVar; 1089 } 1077 1090 1078 1091 if (add) { 1079 1092 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1080 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1093 if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1081 1094 } else { 1082 1095 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1083 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;1096 if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1084 1097 } 1085 1098
Note:
See TracChangeset
for help on using the changeset viewer.
