Changeset 15039 for trunk/psModules/src/objects/pmPeaks.c
- Timestamp:
- Sep 26, 2007, 5:35:29 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPeaks.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPeaks.c
r14652 r15039 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 8-24 00:11:02$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-09-27 03:35:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 51 51 52 52 // calculate peak position relative to ix,iy 53 // XXX these functions need to take a mask, weight, and calculate the errors 53 54 psPolynomial2D *bicube = psImageBicubeFit (image, ix + image->col0, iy + image->row0); 54 55 psPlane min = psImageBicubeMin (bicube); … … 59 60 peak->xf = min.x + ix + image->col0; 60 61 peak->yf = min.y + iy + image->row0; 62 peak->dx = 0.0; 63 peak->dy = 0.0; 61 64 } else { 62 65 peak->xf = ix; 63 66 peak->yf = iy; 67 peak->dx = 1.0; 68 peak->dy = 1.0; 64 69 } 65 70 … … 189 194 } 190 195 psTrace("psModules.objects", 3, "---- %s(0) end ----\n", __func__); 196 return (0); 197 } 198 199 // sort by SN (descending) 200 int pmPeakSortBySN (const void **a, const void **b) 201 { 202 pmPeak *A = *(pmPeak **)a; 203 pmPeak *B = *(pmPeak **)b; 204 205 psF32 fA = A->SN; 206 psF32 fB = B->SN; 207 if (isnan (fA)) fA = 0; 208 if (isnan (fB)) fB = 0; 209 210 psF32 diff = fA - fB; 211 if (diff > FLT_EPSILON) return (-1); 212 if (diff < FLT_EPSILON) return (+1); 213 return (0); 214 } 215 216 // sort by Y (ascending) 217 int pmPeakSortByY (const void **a, const void **b) 218 { 219 pmPeak *A = *(pmPeak **)a; 220 pmPeak *B = *(pmPeak **)b; 221 222 psF32 fA = A->y; 223 psF32 fB = B->y; 224 225 psF32 diff = fA - fB; 226 if (diff > FLT_EPSILON) return (+1); 227 if (diff < FLT_EPSILON) return (-1); 191 228 return (0); 192 229 }
Note:
See TracChangeset
for help on using the changeset viewer.
