Changeset 34085 for trunk/psModules/src/objects/pmSource.c
- Timestamp:
- Jun 26, 2012, 11:31:38 AM (14 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSource.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120601/psModules (added) merged: 34002,34044,34049,34051-34053,34073,34076,34078
- Property svn:mergeinfo changed
-
trunk/psModules/src/objects/pmSource.c
r33993 r34085 51 51 psFree(tmp->pixels); 52 52 psFree(tmp->variance); 53 # if (HAVE_MODEL_VAR)54 53 psFree(tmp->modelVar); 55 # endif56 54 psFree(tmp->maskObj); 57 55 psFree(tmp->maskView); … … 80 78 psFree (source->pixels); 81 79 psFree (source->variance); 82 # if (HAVE_MODEL_VAR)83 80 psFree (source->modelVar); 84 # endif85 81 psFree (source->maskObj); 86 82 psFree (source->maskView); … … 90 86 source->pixels = NULL; 91 87 source->variance = NULL; 92 # if (HAVE_MODEL_VAR)93 88 source->modelVar = NULL; 94 # endif95 89 source->maskObj = NULL; 96 90 source->maskView = NULL; … … 122 116 source->pixels = NULL; 123 117 source->variance = NULL; 124 # if (HAVE_MODEL_VAR)125 118 source->modelVar = NULL; 126 # endif127 119 source->maskObj = NULL; 128 120 source->maskView = NULL; … … 212 204 source->pixels = in->pixels ? psImageCopyView(NULL, in->pixels) : NULL; 213 205 source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL; 214 # if (HAVE_MODEL_VAR)215 206 source->modelVar = NULL; 216 # endif217 207 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 218 208 … … 1044 1034 bool addNoise = mode & PM_MODEL_OP_NOISE; 1045 1035 1046 # if (HAVE_MODEL_VAR)1047 1036 bool addModelVar = mode & PM_MODEL_OP_MODELVAR; 1048 1037 if (addModelVar) psAssert (source->modelVar, "programming error"); 1049 # endif1050 1038 1051 1039 // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled) … … 1070 1058 } 1071 1059 1072 # if (HAVE_MODEL_VAR) 1073 psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1074 # else 1075 psF32 **target = source->pixels->data.F32; 1076 # endif 1060 psF32 **target = NULL; 1061 target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1077 1062 1078 1063 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 1089 1074 } 1090 1075 } 1091 # if (HAVE_MODEL_VAR) 1076 // do not change the flag here if we are adding/subtracting from modelVar 1092 1077 if (!addModelVar) { 1093 if (add) {1094 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1095 } else {1096 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;1097 }1078 if (add) { 1079 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1080 } else { 1081 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1082 } 1098 1083 } 1099 # else1100 if (add) {1101 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1102 } else {1103 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;1104 }1105 # endif1106 1084 return true; 1107 1085 } … … 1111 1089 target = source->variance; 1112 1090 } 1113 # if (HAVE_MODEL_VAR)1114 1091 if (addModelVar) { 1115 target = source->modelVar; 1116 } 1117 # endif 1092 target = source->modelVar; 1093 } 1118 1094 1119 1095 if (add) { 1120 1096 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1121 # if (HAVE_MODEL_VAR)1122 1097 if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1123 # else1124 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1125 # endif1126 1098 } else { 1127 1099 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1128 # if (HAVE_MODEL_VAR)1129 1100 if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1130 # else 1131 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1132 # endif 1101 } 1102 if (!status) { 1103 // XXX maybe raise an error or warning? 1133 1104 } 1134 1105 … … 1200 1171 status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1201 1172 } 1173 if (!status) { 1174 // XXX raise an error or warning? 1175 } 1202 1176 1203 1177 // restore original values … … 1287 1261 } else { 1288 1262 status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1263 } 1264 if (!status) { 1265 // XXX raise an error or warning? 1289 1266 } 1290 1267
Note:
See TracChangeset
for help on using the changeset viewer.
