Changeset 33993 for trunk/psModules/src/objects/pmSource.c
- Timestamp:
- Jun 8, 2012, 6:32:36 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r33963 r33993 51 51 psFree(tmp->pixels); 52 52 psFree(tmp->variance); 53 # if (HAVE_MODEL_VAR) 53 54 psFree(tmp->modelVar); 55 # endif 54 56 psFree(tmp->maskObj); 55 57 psFree(tmp->maskView); … … 78 80 psFree (source->pixels); 79 81 psFree (source->variance); 82 # if (HAVE_MODEL_VAR) 80 83 psFree (source->modelVar); 84 # endif 81 85 psFree (source->maskObj); 82 86 psFree (source->maskView); … … 86 90 source->pixels = NULL; 87 91 source->variance = NULL; 92 # if (HAVE_MODEL_VAR) 88 93 source->modelVar = NULL; 94 # endif 89 95 source->maskObj = NULL; 90 96 source->maskView = NULL; … … 116 122 source->pixels = NULL; 117 123 source->variance = NULL; 124 # if (HAVE_MODEL_VAR) 118 125 source->modelVar = NULL; 126 # endif 119 127 source->maskObj = NULL; 120 128 source->maskView = NULL; … … 204 212 source->pixels = in->pixels ? psImageCopyView(NULL, in->pixels) : NULL; 205 213 source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL; 214 # if (HAVE_MODEL_VAR) 206 215 source->modelVar = NULL; 216 # endif 207 217 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 208 218 … … 1033 1043 1034 1044 bool addNoise = mode & PM_MODEL_OP_NOISE; 1045 1046 # if (HAVE_MODEL_VAR) 1035 1047 bool addModelVar = mode & PM_MODEL_OP_MODELVAR; 1036 1037 1048 if (addModelVar) psAssert (source->modelVar, "programming error"); 1049 # endif 1038 1050 1039 1051 // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled) … … 1058 1070 } 1059 1071 1072 # if (HAVE_MODEL_VAR) 1060 1073 psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1074 # else 1075 psF32 **target = source->pixels->data.F32; 1076 # endif 1061 1077 1062 1078 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 1073 1089 } 1074 1090 } 1091 # if (HAVE_MODEL_VAR) 1075 1092 if (!addModelVar) { 1076 1093 if (add) { … … 1080 1097 } 1081 1098 } 1099 # else 1100 if (add) { 1101 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1102 } else { 1103 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1104 } 1105 # endif 1082 1106 return true; 1083 1107 } … … 1087 1111 target = source->variance; 1088 1112 } 1113 # if (HAVE_MODEL_VAR) 1089 1114 if (addModelVar) { 1090 1115 target = source->modelVar; 1091 1116 } 1117 # endif 1092 1118 1093 1119 if (add) { 1094 1120 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1121 # if (HAVE_MODEL_VAR) 1095 1122 if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1123 # else 1124 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1125 # endif 1096 1126 } else { 1097 1127 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1128 # if (HAVE_MODEL_VAR) 1098 1129 if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1130 # else 1131 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1132 # endif 1099 1133 } 1100 1134
Note:
See TracChangeset
for help on using the changeset viewer.
