Changeset 30974
- Timestamp:
- Mar 18, 2011, 2:09:39 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules
- Files:
-
- 32 edited
-
src/objects/models/pmModel_DEV.c (modified) (1 diff)
-
src/objects/models/pmModel_EXP.c (modified) (1 diff)
-
src/objects/models/pmModel_GAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_PGAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_PS1_V1.c (modified) (1 diff)
-
src/objects/models/pmModel_QGAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_RGAUSS.c (modified) (1 diff)
-
src/objects/models/pmModel_SERSIC.c (modified) (1 diff)
-
src/objects/pmFootprint.c (modified) (1 diff)
-
src/objects/pmFootprint.h (modified) (1 diff)
-
src/objects/pmFootprintAssignPeaks.c (modified) (2 diffs)
-
src/objects/pmPeaks.c (modified) (7 diffs)
-
src/objects/pmPeaks.h (modified) (3 diffs)
-
src/objects/pmPhotObj.c (modified) (2 diffs)
-
src/objects/pmPhotObj.h (modified) (2 diffs)
-
src/objects/pmSource.c (modified) (6 diffs)
-
src/objects/pmSource.h (modified) (1 diff)
-
src/objects/pmSourceIO_CMF_PS1_DV1.c (modified) (4 diffs)
-
src/objects/pmSourceIO_CMF_PS1_DV2.c (modified) (4 diffs)
-
src/objects/pmSourceIO_CMF_PS1_SV1.c (modified) (5 diffs)
-
src/objects/pmSourceIO_CMF_PS1_V1.c (modified) (4 diffs)
-
src/objects/pmSourceIO_CMF_PS1_V2.c (modified) (4 diffs)
-
src/objects/pmSourceIO_CMF_PS1_V3.c (modified) (4 diffs)
-
src/objects/pmSourceIO_PS1_CAL_0.c (modified) (5 diffs)
-
src/objects/pmSourceIO_PS1_DEV_0.c (modified) (2 diffs)
-
src/objects/pmSourceIO_PS1_DEV_1.c (modified) (5 diffs)
-
src/objects/pmSourceIO_RAW.c (modified) (5 diffs)
-
src/objects/pmSourceIO_SMPDATA.c (modified) (1 diff)
-
src/objects/pmSourceMoments.c (modified) (1 diff)
-
src/objects/pmSourceOutputs.c (modified) (1 diff)
-
test/objects/tap_pmPeaks.c (modified) (1 diff)
-
test/objects/tap_pmSource.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_DEV.c
r29004 r30974 249 249 250 250 PAR[PM_PAR_SKY] = 0.0; 251 PAR[PM_PAR_I0] = peak-> flux / Io;251 PAR[PM_PAR_I0] = peak->rawFlux / Io; 252 252 PAR[PM_PAR_XPOS] = peak->xf; 253 253 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_EXP.c
r29004 r30974 233 233 234 234 PAR[PM_PAR_SKY] = 0.0; 235 PAR[PM_PAR_I0] = peak-> flux;235 PAR[PM_PAR_I0] = peak->rawFlux; 236 236 PAR[PM_PAR_XPOS] = peak->xf; 237 237 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_GAUSS.c
r29004 r30974 207 207 208 208 PAR[PM_PAR_SKY] = 0.0; 209 PAR[PM_PAR_I0] = peak-> flux;209 PAR[PM_PAR_I0] = peak->rawFlux; 210 210 PAR[PM_PAR_XPOS] = peak->xf; 211 211 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_PGAUSS.c
r29004 r30974 207 207 208 208 PAR[PM_PAR_SKY] = 0.0; 209 PAR[PM_PAR_I0] = peak-> flux;209 PAR[PM_PAR_I0] = peak->rawFlux; 210 210 PAR[PM_PAR_XPOS] = peak->xf; 211 211 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_PS1_V1.c
r29004 r30974 236 236 237 237 PAR[PM_PAR_SKY] = 0.0; 238 PAR[PM_PAR_I0] = peak-> flux;238 PAR[PM_PAR_I0] = peak->rawFlux; 239 239 PAR[PM_PAR_XPOS] = peak->xf; 240 240 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_QGAUSS.c
r29004 r30974 237 237 238 238 PAR[PM_PAR_SKY] = 0.0; 239 PAR[PM_PAR_I0] = peak-> flux;239 PAR[PM_PAR_I0] = peak->rawFlux; 240 240 PAR[PM_PAR_XPOS] = peak->xf; 241 241 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_RGAUSS.c
r29004 r30974 226 226 227 227 PAR[PM_PAR_SKY] = 0.0; 228 PAR[PM_PAR_I0] = peak-> flux;228 PAR[PM_PAR_I0] = peak->rawFlux; 229 229 PAR[PM_PAR_XPOS] = peak->xf; 230 230 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_SERSIC.c
r29028 r30974 274 274 275 275 PAR[PM_PAR_SKY] = 0.0; 276 PAR[PM_PAR_I0] = peak-> flux / Io;276 PAR[PM_PAR_I0] = peak->rawFlux / Io; 277 277 PAR[PM_PAR_XPOS] = peak->xf; 278 278 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.c
r30621 r30974 98 98 } 99 99 100 // XXX not actually used anywhere 100 101 pmFootprint *pmFootprintNormalize(pmFootprint *fp) { 101 102 if (fp != NULL && !fp->normalized) { 102 fp->peaks = psArraySort(fp->peaks, pmPeakSortBySN); 103 if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) { 104 fp->peaks = psArraySort(fp->peaks, pmPeaksSortBySmoothFluxDescend); 105 } else { 106 fp->peaks = psArraySort(fp->peaks, pmPeaksSortByRawFluxDescend); 107 } 103 108 fp->normalized = true; 104 109 } -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h
r30902 r30974 10 10 #ifndef PM_FOOTPRINT_H 11 11 #define PM_FOOTPRINT_H 12 13 // We need to choose up front if the culling algorithm uses the raw or smoothed image. 14 // depending on which we choose, we should produce sorted peaks based on peak->rawFlux or 15 // peak->smoothFlux 16 17 # define PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE 1 12 18 13 19 typedef struct { -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintAssignPeaks.c
r30815 r30974 60 60 if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);} 61 61 int id = ids ? ids->data.S32[y][x - col0] : 0; 62 // XXX I think the '[x - col0]' above is just wrong (should be [x], but never gets triggerd. 62 63 63 64 if (id == 0) { // peak isn't in a footprint, so make one for it … … 86 87 if (fp->peaks->n == 1) continue; 87 88 88 fp->peaks = psArraySort(fp->peaks, pmPeakSortBySN); 89 // make sure the peaks are sorted in a way consistent with our cull process 90 if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) { 91 fp->peaks = psArraySort(fp->peaks, pmPeaksSortBySmoothFluxDescend); 92 } else { 93 fp->peaks = psArraySort(fp->peaks, pmPeaksSortByRawFluxDescend); 94 } 89 95 90 96 // XXX check for an assert on duplicates (I don't think they can happen, but -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.c
r30751 r30974 115 115 XXX: Macro this. 116 116 *****************************************************************************/ 117 # if (0) 117 118 static bool isItInThisRegion(const psRegion valid, 118 119 psS32 x, … … 130 131 return(false); 131 132 } 133 # endif 132 134 133 135 /****************************************************************************** … … 148 150 tmp->x = x; 149 151 tmp->y = y; 150 tmp->value = value; 151 tmp->flux = value; 152 tmp->SN = 0; 152 tmp->detValue = value; 153 tmp->rawFlux = NAN; 154 tmp->rawFluxStdev = NAN; 155 tmp->smoothFlux = NAN; 156 tmp->smoothFluxStdev = NAN; 157 // tmp->SN = 0; 153 158 tmp->xf = x; 154 159 tmp->yf = y; … … 170 175 171 176 172 // psSort comparison function for peaks177 // psSort comparison functions for peaks 173 178 // XXX: Add error-checking for NULL args 174 int pmPeaksCompareAscend (const void **a, const void **b) 175 { 176 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 179 int pmPeaksSortByDetValueAscend (const void **a, const void **b) 180 { 177 181 pmPeak *A = *(pmPeak **)a; 178 182 pmPeak *B = *(pmPeak **)b; … … 180 184 psF32 diff; 181 185 182 diff = A-> value - B->value;186 diff = A->detValue - B->detValue; 183 187 if (diff < FLT_EPSILON) { 184 psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__);185 188 return (-1); 186 189 } else if (diff > FLT_EPSILON) { 187 psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__);188 190 return (+1); 189 191 } 190 psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__);191 192 return (0); 192 193 } 193 194 // psSort comparison function for peaks 195 // XXX: Add error-checking for NULL args 196 int pmPeaksCompareDescend (const void **a, const void **b) 197 { 198 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 194 int pmPeaksSortByDetValueDescend (const void **a, const void **b) 195 { 199 196 pmPeak *A = *(pmPeak **)a; 200 197 pmPeak *B = *(pmPeak **)b; … … 202 199 psF32 diff; 203 200 204 diff = A-> value - B->value;201 diff = A->detValue - B->detValue; 205 202 if (diff < FLT_EPSILON) { 206 psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__);207 203 return (+1); 208 204 } else if (diff > FLT_EPSILON) { 209 psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__);210 205 return (-1); 211 206 } 212 psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__);213 207 return (0); 214 208 } 215 216 // sort by SN (descending) 217 int pmPeakSortBySN (const void **a, const void **b) 209 int pmPeaksSortByRawFluxAscend (const void **a, const void **b) 218 210 { 219 211 pmPeak *A = *(pmPeak **)a; 220 212 pmPeak *B = *(pmPeak **)b; 221 213 222 psF32 fA = A->flux;223 psF32 fB = B->flux; 224 if (isnan (fA)) fA = 0;225 if ( isnan (fB)) fB = 0;226 227 psF32 diff = fA - fB;228 if (diff > FLT_EPSILON) return (-1);229 if (diff < FLT_EPSILON) return (+1);214 psF32 diff; 215 216 diff = A->rawFlux - B->rawFlux; 217 if (diff < FLT_EPSILON) { 218 return (-1); 219 } else if (diff > FLT_EPSILON) { 220 return (+1); 221 } 230 222 return (0); 231 223 } 232 233 // sort by Y (ascending) 234 int pmPeakSortByY (const void **a, const void **b) 224 int pmPeaksSortByRawFluxDescend (const void **a, const void **b) 235 225 { 236 226 pmPeak *A = *(pmPeak **)a; 237 227 pmPeak *B = *(pmPeak **)b; 238 228 239 psF32 fA = A->y; 240 psF32 fB = B->y; 241 242 psF32 diff = fA - fB; 243 if (diff > FLT_EPSILON) return (+1); 244 if (diff < FLT_EPSILON) return (-1); 229 psF32 diff; 230 231 diff = A->rawFlux - B->rawFlux; 232 if (diff < FLT_EPSILON) { 233 return (+1); 234 } else if (diff > FLT_EPSILON) { 235 return (-1); 236 } 245 237 return (0); 246 238 } 239 int pmPeaksSortBySmoothFluxAscend (const void **a, const void **b) 240 { 241 pmPeak *A = *(pmPeak **)a; 242 pmPeak *B = *(pmPeak **)b; 243 244 psF32 diff; 245 246 diff = A->smoothFlux - B->smoothFlux; 247 if (diff < FLT_EPSILON) { 248 return (-1); 249 } else if (diff > FLT_EPSILON) { 250 return (+1); 251 } 252 return (0); 253 } 254 int pmPeaksSortBySmoothFluxDescend (const void **a, const void **b) 255 { 256 pmPeak *A = *(pmPeak **)a; 257 pmPeak *B = *(pmPeak **)b; 258 259 psF32 diff; 260 261 diff = A->smoothFlux - B->smoothFlux; 262 if (diff < FLT_EPSILON) { 263 return (+1); 264 } else if (diff > FLT_EPSILON) { 265 return (-1); 266 } 267 return (0); 268 } 269 270 // // sort by SN (descending) 271 // int pmPeakSortBySN (const void **a, const void **b) 272 // { 273 // pmPeak *A = *(pmPeak **)a; 274 // pmPeak *B = *(pmPeak **)b; 275 // 276 // psF32 fA = A->flux; 277 // psF32 fB = B->flux; 278 // if (isnan (fA)) fA = 0; 279 // if (isnan (fB)) fB = 0; 280 // 281 // psF32 diff = fA - fB; 282 // if (diff > FLT_EPSILON) return (-1); 283 // if (diff < FLT_EPSILON) return (+1); 284 // return (0); 285 // } 286 // 287 // // sort by Y (ascending) 288 // int pmPeakSortByY (const void **a, const void **b) 289 // { 290 // pmPeak *A = *(pmPeak **)a; 291 // pmPeak *B = *(pmPeak **)b; 292 // 293 // psF32 fA = A->y; 294 // psF32 fB = B->y; 295 // 296 // psF32 diff = fA - fB; 297 // if (diff > FLT_EPSILON) return (+1); 298 // if (diff < FLT_EPSILON) return (-1); 299 // return (0); 300 // } 247 301 248 302 /****************************************************************************** … … 554 608 return(list); 555 609 } 556 557 // return a new array of peaks which are in the valid region and below threshold558 // XXX this function is unused and probably could be dropped559 psArray *pmPeaksSubset(560 psArray *peaks,561 psF32 maxValue,562 const psRegion valid)563 {564 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__);565 PS_ASSERT_PTR_NON_NULL(peaks, NULL);566 567 psArray *output = psArrayAllocEmpty (200);568 569 psTrace ("psModules.objects", 3, "list size is %ld\n", peaks->n);570 571 for (int i = 0; i < peaks->n; i++) {572 pmPeak *tmpPeak = (pmPeak *) peaks->data[i];573 if (tmpPeak->value > maxValue)574 continue;575 if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))576 continue;577 psArrayAdd (output, 200, tmpPeak);578 }579 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__);580 return(output);581 } -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.h
r30865 r30974 46 46 * associated with the source: 47 47 * 48 * There are 3 values which define the amplitude of the peak and which may be used to sort the 49 * peaks: 50 * * detValue - the peak in the detection image (nominally, the S/N) 51 * * rawFlux - the peak in the unsmoothed image 52 * * smoothFlux - the peak in the smoothed image 53 * 54 * For a given image, peaks do necesarily not have the same sequence for these three values. 55 * Depending on the analysis, it may make sense to sort by one or the other of these values 48 56 */ 49 57 typedef struct … … 56 64 float dx; ///< bicube fit error on peak coord (x) 57 65 float dy; ///< bicube fit error on peak coord (y) 58 float value; ///< level in detection image 59 float flux; ///< level in unsmoothed sci image 60 float SN; ///< S/N implied by detection level 66 float detValue; ///< peak flux in detection image (= S/N) 67 float rawFlux; ///< peak flux in unsmoothed signal image 68 float rawFluxStdev; ///< peak stdev in unsmoothed signal image 69 float smoothFlux; ///< peak flux in smoothed signal image 70 float smoothFluxStdev; ///< peak stdev in smoothed signal image 71 // float SNestimated; ///< S/N estimated from the detection image 61 72 bool assigned; ///< is peak assigned to a source? 62 73 pmPeakType type; ///< Description of peak. … … 137 148 ); 138 149 139 int pmPeaksCompareAscend (const void **a, const void **b); 140 int pmPeaksCompareDescend (const void **a, const void **b); 141 142 int pmPeakSortBySN (const void **a, const void **b); 143 int pmPeakSortByY (const void **a, const void **b); 150 int pmPeaksSortByDetValueAscend (const void **a, const void **b); 151 int pmPeaksSortByDetValueDescend (const void **a, const void **b); 152 int pmPeaksSortByRawFluxAscend (const void **a, const void **b); 153 int pmPeaksSortByRawFluxDescend (const void **a, const void **b); 154 int pmPeaksSortBySmoothFluxAscend (const void **a, const void **b); 155 int pmPeaksSortBySmoothFluxDescend (const void **a, const void **b); 144 156 145 157 /// @} -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmPhotObj.c
r30892 r30974 81 81 object->x = source->peak->xf; 82 82 object->y = source->peak->yf; 83 object-> SN = source->peak->SN;83 object->flux = source->peak->rawFlux; 84 84 } else { 85 object-> SN = PS_MAX(object->SN, source->peak->SN);85 object->flux = PS_MAX(object->flux, source->peak->rawFlux); 86 86 } 87 87 psArrayAdd (object->sources, 1, source); … … 89 89 } 90 90 91 // sort by SN(descending)92 int pmPhotObjSortBy SN(const void **a, const void **b)91 // sort by flux (descending) 92 int pmPhotObjSortByFlux (const void **a, const void **b) 93 93 { 94 94 pmPhotObj *objA = *(pmPhotObj **)a; 95 95 pmPhotObj *objB = *(pmPhotObj **)b; 96 96 97 psF32 fA = objA-> SN;98 psF32 fB = objB-> SN;97 psF32 fA = objA->flux; 98 psF32 fB = objB->flux; 99 99 100 100 psF32 diff = fA - fB; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmPhotObj.h
r29004 r30974 34 34 float x; 35 35 float y; 36 float SN; // max of peak->SNfor all matched sources36 float flux; // max of peak->rawFlux for all matched sources 37 37 } pmPhotObj; 38 38 … … 41 41 bool pmPhotObjAddSource(pmPhotObj *object, pmSource *source); 42 42 43 int pmPhotObjSortBy SN(const void **a, const void **b);43 int pmPhotObjSortByFlux (const void **a, const void **b); 44 44 int pmPhotObjSortByX (const void **a, const void **b); 45 45 -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c
r30935 r30974 171 171 // peak has the same values as the original 172 172 if (in->peak != NULL) { 173 source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak-> value, in->peak->type);173 source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->detValue, in->peak->type); 174 174 source->peak->xf = in->peak->xf; 175 175 source->peak->yf = in->peak->yf; 176 source->peak->flux = in->peak->flux; 177 source->peak->SN = in->peak->SN; 176 source->peak->rawFlux = in->peak->rawFlux; 177 source->peak->rawFluxStdev = in->peak->rawFluxStdev; 178 source->peak->smoothFlux = in->peak->smoothFlux; 179 source->peak->smoothFluxStdev = in->peak->smoothFluxStdev; 180 // source->peak->SN = in->peak->SN; 178 181 } 179 182 … … 462 465 psStats *stats = NULL; 463 466 464 // select the single highest peak 465 psArraySort (peaks, pmPeaks CompareDescend);467 // select the single highest peak (note that we only have detValue, not rawFlux, etc 468 psArraySort (peaks, pmPeaksSortByDetValueDescend); 466 469 clump = peaks->data[0]; 467 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump-> value);470 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->detValue); 468 471 469 472 // XXX store the mean sigma? 470 473 float meanSigma = psfClump.nSigma; 471 psfClump.nStars = clump-> value;472 psfClump.nSigma = clump-> value / meanSigma;474 psfClump.nStars = clump->detValue; 475 psfClump.nSigma = clump->detValue / meanSigma; 473 476 474 477 // define section window for clump … … 666 669 667 670 // the rest are probable stellar objects 671 // the vectors below are accumulated to give user feedback on the S/N ranges 668 672 starsn_moments->data.F32[starsn_moments->n] = source->moments->SN; 669 673 starsn_moments->n ++; 670 starsn_peaks->data.F32[starsn_peaks->n] = s ource->peak->SN;674 starsn_peaks->data.F32[starsn_peaks->n] = sqrt(source->peak->detValue); 671 675 starsn_peaks->n ++; 672 676 Nstar ++; … … 1186 1190 1187 1191 // sort by SN (descending) 1188 int pmSourceSortBy SN(const void **a, const void **b)1192 int pmSourceSortByFlux (const void **a, const void **b) 1189 1193 { 1190 1194 pmSource *A = *(pmSource **)a; 1191 1195 pmSource *B = *(pmSource **)b; 1192 1196 1193 psF32 fA = (A->peak == NULL) ? 0 : A->peak-> SN;1194 psF32 fB = (B->peak == NULL) ? 0 : B->peak-> SN;1197 psF32 fA = (A->peak == NULL) ? 0 : A->peak->rawFlux; 1198 psF32 fB = (B->peak == NULL) ? 0 : B->peak->rawFlux; 1195 1199 if (isnan (fA)) fA = 0; 1196 1200 if (isnan (fB)) fB = 0; … … 1203 1207 1204 1208 // sort by SN (descending) 1205 int pmSourceSortByParent SN(const void **a, const void **b)1209 int pmSourceSortByParentFlux (const void **a, const void **b) 1206 1210 { 1207 1211 pmSource *Ao = *(pmSource **)a; … … 1210 1214 pmSource *B = Bo->parent; 1211 1215 1212 psF32 fA = (A->peak == NULL) ? 0 : A->peak-> SN;1213 psF32 fB = (B->peak == NULL) ? 0 : B->peak-> SN;1216 psF32 fA = (A->peak == NULL) ? 0 : A->peak->rawFlux; 1217 psF32 fB = (B->peak == NULL) ? 0 : B->peak->rawFlux; 1214 1218 if (isnan (fA)) fA = 0; 1215 1219 if (isnan (fB)) fB = 0; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.h
r30935 r30974 293 293 int pmSourceSortBySeq (const void **a, const void **b); 294 294 int pmSourceSortByParentSeq (const void **a, const void **b); 295 int pmSourceSortBy SN(const void **a, const void **b);296 int pmSourceSortByParent SN(const void **a, const void **b);295 int pmSourceSortByFlux (const void **a, const void **b); 296 int pmSourceSortByParentFlux (const void **a, const void **b); 297 297 298 298 pmSourceMode pmSourceModeFromString (const char *name); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c
r30931 r30974 75 75 if (source->seq == -1) { 76 76 // let's write these out in S/N order 77 sources = psArraySort (sources, pmSourceSortBy SN);77 sources = psArraySort (sources, pmSourceSortByFlux); 78 78 } else { 79 79 sources = psArraySort (sources, pmSourceSortBySeq); … … 270 270 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 271 271 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 272 source->peak->flux = peakFlux; 272 source->peak->rawFlux = peakFlux; 273 source->peak->smoothFlux = peakFlux; 273 274 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 274 275 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 275 276 source->peak->dx = dPAR[PM_PAR_XPOS]; 276 277 source->peak->dy = dPAR[PM_PAR_YPOS]; 277 if (isfinite (source->errMag) && (source->errMag > 0.0)) {278 source->peak->SN = 1.0 / source->errMag;279 } else {280 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N281 }282 278 283 279 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 337 333 338 334 // let's write these out in S/N order 339 sources = psArraySort (sources, pmSourceSortBy SN);335 sources = psArraySort (sources, pmSourceSortByFlux); 340 336 341 337 table = psArrayAllocEmpty (sources->n); … … 510 506 511 507 // let's write these out in S/N order 512 sources = psArraySort (sources, pmSourceSortBy SN);508 sources = psArraySort (sources, pmSourceSortByFlux); 513 509 514 510 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c
r30931 r30974 74 74 if (source->seq == -1) { 75 75 // let's write these out in S/N order 76 sources = psArraySort (sources, pmSourceSortBy SN);76 sources = psArraySort (sources, pmSourceSortByFlux); 77 77 } else { 78 78 sources = psArraySort (sources, pmSourceSortBySeq); … … 288 288 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 289 289 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 290 source->peak->flux = peakFlux; 290 source->peak->rawFlux = peakFlux; 291 source->peak->smoothFlux = peakFlux; 291 292 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 292 293 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 293 294 source->peak->dx = dPAR[PM_PAR_XPOS]; 294 295 source->peak->dy = dPAR[PM_PAR_YPOS]; 295 if (isfinite (source->errMag) && (source->errMag > 0.0)) {296 source->peak->SN = 1.0 / source->errMag;297 } else {298 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N299 }300 296 301 297 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 362 358 363 359 // let's write these out in S/N order 364 sources = psArraySort (sources, pmSourceSortBy SN);360 sources = psArraySort (sources, pmSourceSortByFlux); 365 361 366 362 table = psArrayAllocEmpty (sources->n); … … 535 531 536 532 // let's write these out in S/N order 537 sources = psArraySort (sources, pmSourceSortBy SN);533 sources = psArraySort (sources, pmSourceSortByFlux); 538 534 539 535 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c
r30931 r30974 76 76 pmSource *source = sources->data[0]; 77 77 if (source->seq == -1) { 78 sources = psArraySort (sources, pmSourceSortBy SN);78 sources = psArraySort (sources, pmSourceSortByFlux); 79 79 } else { 80 80 sources = psArraySort (sources, pmSourceSortBySeq); … … 287 287 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 288 288 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 289 source->peak->flux = peakFlux; 289 source->peak->rawFlux = peakFlux; 290 source->peak->smoothFlux = peakFlux; 290 291 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 291 292 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 292 293 source->peak->dx = dPAR[PM_PAR_XPOS]; 293 294 source->peak->dy = dPAR[PM_PAR_YPOS]; 294 if (isfinite (source->errMag) && (source->errMag > 0.0)) {295 source->peak->SN = 1.0 / source->errMag;296 } else {297 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N298 }299 295 300 296 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 384 380 385 381 // let's write these out in S/N order 386 sources = psArraySort (sources, pmSourceSortBy SN);382 sources = psArraySort (sources, pmSourceSortByFlux); 387 383 388 384 table = psArrayAllocEmpty (sources->n); … … 562 558 563 559 // let's write these out in S/N order 564 sources = psArraySort (sources, pmSourceSortBy SN);560 sources = psArraySort (sources, pmSourceSortByFlux); 565 561 566 562 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams … … 732 728 733 729 // let's write these out in S/N order 734 sources = psArraySort (sources, pmSourceSortBy SN);730 sources = psArraySort (sources, pmSourceSortByFlux); 735 731 736 732 table = psArrayAllocEmpty (sources->n); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
r30931 r30974 72 72 if (source->seq == -1) { 73 73 // let's write these out in S/N order 74 sources = psArraySort (sources, pmSourceSortBy SN);74 sources = psArraySort (sources, pmSourceSortByFlux); 75 75 } else { 76 76 sources = psArraySort (sources, pmSourceSortBySeq); … … 255 255 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 256 256 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 257 source->peak->flux = peakFlux; 257 source->peak->rawFlux = peakFlux; 258 source->peak->smoothFlux = peakFlux; 258 259 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 259 260 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 260 261 source->peak->dx = dPAR[PM_PAR_XPOS]; 261 262 source->peak->dy = dPAR[PM_PAR_YPOS]; 262 if (isfinite (source->errMag) && (source->errMag > 0.0)) {263 source->peak->SN = 1.0 / source->errMag;264 } else {265 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N266 }267 263 268 264 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 312 308 313 309 // let's write these out in S/N order 314 sources = psArraySort (sources, pmSourceSortBy SN);310 sources = psArraySort (sources, pmSourceSortByFlux); 315 311 316 312 table = psArrayAllocEmpty (sources->n); … … 490 486 491 487 // let's write these out in S/N order 492 sources = psArraySort (sources, pmSourceSortBy SN);488 sources = psArraySort (sources, pmSourceSortByFlux); 493 489 494 490 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
r30931 r30974 72 72 if (source->seq == -1) { 73 73 // let's write these out in S/N order 74 sources = psArraySort (sources, pmSourceSortBy SN);74 sources = psArraySort (sources, pmSourceSortByFlux); 75 75 } else { 76 76 sources = psArraySort (sources, pmSourceSortBySeq); … … 261 261 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 262 262 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 263 source->peak->flux = peakFlux; 263 source->peak->rawFlux = peakFlux; 264 source->peak->smoothFlux = peakFlux; 264 265 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 265 266 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 266 267 source->peak->dx = dPAR[PM_PAR_XPOS]; 267 268 source->peak->dy = dPAR[PM_PAR_YPOS]; 268 if (isfinite (source->errMag) && (source->errMag > 0.0)) {269 source->peak->SN = 1.0 / source->errMag;270 } else {271 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N272 }273 269 274 270 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 334 330 335 331 // let's write these out in S/N order 336 sources = psArraySort (sources, pmSourceSortBy SN);332 sources = psArraySort (sources, pmSourceSortByFlux); 337 333 338 334 table = psArrayAllocEmpty (sources->n); … … 553 549 554 550 // let's write these out in S/N order 555 sources = psArraySort (sources, pmSourceSortBy SN);551 sources = psArraySort (sources, pmSourceSortByFlux); 556 552 557 553 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c
r30931 r30974 72 72 if (source->seq == -1) { 73 73 // let's write these out in S/N order 74 sources = psArraySort (sources, pmSourceSortBy SN);74 sources = psArraySort (sources, pmSourceSortByFlux); 75 75 } else { 76 76 sources = psArraySort (sources, pmSourceSortBySeq); … … 284 284 // recreate the peak to match (xPos, yPos) +/- (xErr, yErr) 285 285 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 286 source->peak->flux = peakFlux; 286 source->peak->rawFlux = peakFlux; 287 source->peak->smoothFlux = peakFlux; 287 288 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 288 289 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 289 290 source->peak->dx = dPAR[PM_PAR_XPOS]; 290 291 source->peak->dy = dPAR[PM_PAR_YPOS]; 291 if (isfinite (source->errMag) && (source->errMag > 0.0)) { 292 source->peak->SN = 1.0 / source->errMag; 293 } else { 294 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N 295 } 292 293 // we no longer sort by S/N, only flux 294 // if (isfinite (source->errMag) && (source->errMag > 0.0)) { 295 // source->peak->SN = 1.0 / source->errMag; 296 // } else { 297 // source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N 298 // } 296 299 297 300 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); … … 380 383 381 384 // let's write these out in S/N order 382 sources = psArraySort (sources, pmSourceSortBy SN);385 sources = psArraySort (sources, pmSourceSortByFlux); 383 386 384 387 table = psArrayAllocEmpty (sources->n); … … 552 555 553 556 // let's write these out in S/N order 554 sources = psArraySort (sources, pmSourceSortBy SN);557 sources = psArraySort (sources, pmSourceSortByFlux); 555 558 556 559 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_CAL_0.c
r30621 r30974 91 91 92 92 // let's write these out in S/N order 93 sources = psArraySort (sources, pmSourceSortBy SN);93 sources = psArraySort (sources, pmSourceSortByFlux); 94 94 95 95 table = psArrayAllocEmpty (sources->n); … … 136 136 137 137 float calMag = source->psfMag + magOffset; 138 float peakMag = (source->peak-> flux > 0) ? -2.5*log10(source->peak->flux) : NAN;138 float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN; 139 139 psS16 nImageOverlap = 1; 140 140 … … 294 294 295 295 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 296 source->peak->flux = peakFlux; 296 source->peak->rawFlux = peakFlux; 297 source->peak->smoothFlux = peakFlux; 297 298 source->peak->dx = dPAR[PM_PAR_XPOS]; 298 299 source->peak->dy = dPAR[PM_PAR_YPOS]; … … 357 358 358 359 // let's write these out in S/N order 359 sources = psArraySort (sources, pmSourceSortBy SN);360 sources = psArraySort (sources, pmSourceSortByFlux); 360 361 361 362 table = psArrayAllocEmpty (sources->n); … … 576 577 577 578 // let's write these out in S/N order 578 sources = psArraySort (sources, pmSourceSortBy SN);579 sources = psArraySort (sources, pmSourceSortByFlux); 579 580 580 581 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r30621 r30974 101 101 } 102 102 103 float peakMag = (source->peak-> flux > 0) ? -2.5*log10(source->peak->flux) : NAN;103 float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN; 104 104 psS16 nImageOverlap = 1; 105 105 psS32 ID = 0; // XXX need to figure out how to generate this … … 220 220 221 221 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 222 source->peak->flux = peakFlux; 222 source->peak->rawFlux = peakFlux; 223 source->peak->smoothFlux = peakFlux; 223 224 source->peak->dx = dPAR[PM_PAR_XPOS]; 224 225 source->peak->dy = dPAR[PM_PAR_YPOS]; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r30621 r30974 73 73 74 74 // let's write these out in S/N order 75 sources = psArraySort (sources, pmSourceSortBy SN);75 sources = psArraySort (sources, pmSourceSortByFlux); 76 76 77 77 table = psArrayAllocEmpty (sources->n); … … 117 117 } 118 118 119 float peakMag = (source->peak-> flux > 0) ? -2.5*log10(source->peak->flux) : NAN;119 float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN; 120 120 psS16 nImageOverlap = 1; 121 121 … … 263 263 264 264 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 265 source->peak->flux = peakFlux; 265 source->peak->rawFlux = peakFlux; 266 source->peak->smoothFlux = peakFlux; 266 267 source->peak->dx = dPAR[PM_PAR_XPOS]; 267 268 source->peak->dy = dPAR[PM_PAR_YPOS]; … … 307 308 308 309 // let's write these out in S/N order 309 sources = psArraySort (sources, pmSourceSortBy SN);310 sources = psArraySort (sources, pmSourceSortByFlux); 310 311 311 312 table = psArrayAllocEmpty (sources->n); … … 480 481 481 482 // let's write these out in S/N order 482 sources = psArraySort (sources, pmSourceSortBy SN);483 sources = psArraySort (sources, pmSourceSortByFlux); 483 484 484 485 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_RAW.c
r29004 r30974 126 126 source[0].apMag, source[0].type, source[0].mode, 127 127 logChi, logChiNorm, 128 source[0].peak-> SN,128 source[0].peak->rawFlux, 129 129 source[0].apRadius, 130 130 source[0].pixWeightNotBad, … … 188 188 log10(model[0].chisq/model[0].nDOF), 189 189 log10(model[0].chisqNorm/model[0].nDOF), 190 source[0].peak-> SN,190 source[0].peak->rawFlux, 191 191 source[0].apRadius, 192 192 source[0].pixWeightNotBad, … … 234 234 235 235 fprintf (f, "%5d %5d %7.1f %7.1f %7.1f %6.3f %6.3f %8.1f %7.1f %7.1f %7.1f %4d %2d\n", 236 source->peak->x, source->peak->y, source->peak-> value,236 source->peak->x, source->peak->y, source->peak->detValue, 237 237 moment->Mx, moment->My, 238 238 moment->Mxx, moment->Myy, … … 270 270 continue; 271 271 fprintf (f, "%5d %5d %8.1f %7.1f %7.1f %6.3f %6.3f %10.1f %7.1f %7.1f %7.1f %4d %2d %#5x\n", 272 source->peak->x, source->peak->y, source->peak-> value,272 source->peak->x, source->peak->y, source->peak->detValue, 273 273 source->moments->Mx, source->moments->My, 274 274 source->moments->Mxx, source->moments->Myy, … … 299 299 continue; 300 300 fprintf (f, "%5d %5d %7.1f %7.2f %7.2f %7.2f\n", 301 peak->x, peak->y, peak-> value, peak->SN, peak->xf, peak->yf);302 } 303 fclose (f); 304 return true; 305 } 306 301 peak->x, peak->y, peak->detValue, peak->rawFlux, peak->xf, peak->yf); 302 } 303 fclose (f); 304 return true; 305 } 306 -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_SMPDATA.c
r30621 r30974 205 205 206 206 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 207 source->peak-> flux = peakFlux;207 source->peak->rawFlux = peakFlux; 208 208 209 209 sources->data[i] = source; -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceMoments.c
r30865 r30974 330 330 331 331 psTrace ("psModules.objects", 3, "peak %f %f (%f = %f) Mx: %f My: %f Sum: %f Mxx: %f Mxy: %f Myy: %f sky: %f Npix: %d\n", 332 source->peak->xf, source->peak->yf, source->peak-> flux, source->peak->SN, source->moments->Mx, source->moments->My, Sum, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, sky, source->moments->nPixels);332 source->peak->xf, source->peak->yf, source->peak->rawFlux, sqrt(source->peak->detValue), source->moments->Mx, source->moments->My, Sum, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, sky, source->moments->nPixels); 333 333 334 334 return(true); -
branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c
r30935 r30974 143 143 144 144 outputs->calMag = isfinite(magOffset) ? source->psfMag + magOffset : NAN; 145 outputs->peakMag = (source->peak-> flux > 0) ? -2.5*log10(source->peak->flux) : NAN;145 outputs->peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN; 146 146 147 147 psSphere ptSky = {0.0, 0.0, 0.0, 0.0}; -
branches/eam_branches/ipp-20110213/psModules/test/objects/tap_pmPeaks.c
r15985 r30974 650 650 ok(test_pmPeaksInImage(TST02_NUM_ROWS, 2*TST02_NUM_COLS), 651 651 "Tested pmPeaksInImage() on (%d, %d) image", TST02_NUM_ROWS, 2*TST02_NUM_COLS); 652 653 654 // ------------------------------------------------------------------------655 // Test pmPeaksSubset()656 // Calling pmPeaksSubset with NULL psList. Should generate error.657 {658 psMemId id = psMemGetId();659 psArray *outData = pmPeaksSubset(NULL, 0.0, psRegionSet(0, 0, 0, 0));660 ok(outData == NULL, "pmPeaksSubset() returned a NULL with a NULL psArray input");661 psFree(outData);662 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");663 }664 665 666 // Set peaks in input image. All even-column and even-row pixels are667 // set non-zero, all other pixels are set to zero.668 psImage *imgData = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);669 psS32 numPeaksOrig = 0;670 for (psS32 i = 0 ; i < NUM_ROWS ; i++) {671 for (psS32 j = 0 ; j < NUM_COLS ; j++) {672 if ((0 == i%2) && (0 == j%2)) {673 imgData->data.F32[i][j] = (float) (i + 10);674 numPeaksOrig++;675 } else {676 imgData->data.F32[i][j] = 0.0;677 }678 }679 }680 // Call pmPeaksSubset() with large maxValue and disjoint psRegion.681 // Should not remove any peaks.682 {683 psMemId id = psMemGetId();684 psArray *outData = pmPeaksInImage(imgData, 0.0);685 psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, psRegionSet(20, 20, 20, 20));686 ok(outData2 != NULL && psMemCheckArray(outData),687 "pmPeaksSubset() returned a non-NULL psArray (large maxValue)");688 ok(outData2->n == numPeaksOrig,689 "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n+1, numPeaksOrig);690 psFree(outData);691 psFree(outData2);692 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");693 }694 695 696 // Call pmPeaksSubset() with small maxValue and disjoint psRegion.697 // Should not remove any peaks.698 {699 psMemId id = psMemGetId();700 psArray *outData = pmPeaksInImage(imgData, 0.0);701 psArray *outData2 = pmPeaksSubset(outData, 0.0, psRegionSet(20, 20, 20, 20));702 ok(outData2 != NULL && psMemCheckArray(outData),703 "pmPeaksSubset() returned a non-NULL psArray (small maxValue)");704 ok(outData2->n == 0,705 "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);706 psFree(outData);707 psFree(outData2);708 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");709 }710 711 712 // Call pmPeaksSubset() with large maxValue and enclosing psRegion.713 // Should remove aall peaks.714 {715 psMemId id = psMemGetId();716 psArray *outData = pmPeaksInImage(imgData, 0.0);717 psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);718 psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, tmpRegion);719 ok(outData2 != NULL && psMemCheckArray(outData),720 "pmPeaksSubset() returned a non-NULL psArray (small maxValue, enclosing psRegion)");721 ok(outData2->n == 0,722 "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);723 psFree(outData);724 psFree(outData2);725 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");726 }727 728 729 // Call pmPeaksSubset() with large maxValue and enclosing psRegion.730 // Should remove aall peaks.731 {732 psMemId id = psMemGetId();733 psArray *outData = pmPeaksInImage(imgData, 0.0);734 psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);735 psArray *outData2 = pmPeaksSubset(outData, 0.0, tmpRegion);736 ok(outData2 != NULL && psMemCheckArray(outData),737 "pmPeaksSubset() returned a non-NULL psArray (small maxValue, inclusive psRegion)");738 ok(outData2->n == 0,739 "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);740 psFree(outData);741 psFree(outData2);742 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");743 }744 652 } -
branches/eam_branches/ipp-20110213/psModules/test/objects/tap_pmSource.c
r24580 r30974 21 21 pmSourceCacheModel() 22 22 pmSourceCachePSF() 23 pmSourceSortBy SN() (COMPILER ERRORS)23 pmSourceSortByFlux() (COMPILER ERRORS) 24 24 pmSourceSortByY() (COMPILER ERRORS) 25 25 Must test … … 801 801 802 802 // ---------------------------------------- 803 // pmSourceSortBy SN() tests804 // int pmSourceSortBy SN(const void **a, const void **b)805 // Call pmSourceSortBy SN() with acceptable input parameters.803 // pmSourceSortByFlux() tests 804 // int pmSourceSortByFlux (const void **a, const void **b) 805 // Call pmSourceSortByFlux() with acceptable input parameters. 806 806 // XXX: We don't test with NULL input parameters since this function has no PS_ASSERTS to protect 807 807 // against that. … … 816 816 src2->peak->SN = 20.0; 817 817 818 int rc = pmSourceSortBy SN((const void **) &src1, (const void **) &src2);819 ok(rc == 1, "pmSourceSortBy SN() returned correct result (source1 < source2) (%d)", rc);820 rc = pmSourceSortBy SN((const void **) &src2, (const void **) &src1);821 ok(rc == -1, "pmSourceSortBy SN() returned correct result (source2 < source1) (%d)", rc);822 rc = pmSourceSortBy SN((const void **) &src1, (const void **) &src1);823 ok(rc == 0, "pmSourceSortBy SN() returned correct result (source1 == source2) (%d)", rc);818 int rc = pmSourceSortByFlux((const void **) &src1, (const void **) &src2); 819 ok(rc == 1, "pmSourceSortByFlux() returned correct result (source1 < source2) (%d)", rc); 820 rc = pmSourceSortByFlux((const void **) &src2, (const void **) &src1); 821 ok(rc == -1, "pmSourceSortByFlux() returned correct result (source2 < source1) (%d)", rc); 822 rc = pmSourceSortByFlux((const void **) &src1, (const void **) &src1); 823 ok(rc == 0, "pmSourceSortByFlux() returned correct result (source1 == source2) (%d)", rc); 824 824 825 825 psFree(src1);
Note:
See TracChangeset
for help on using the changeset viewer.
