Changeset 15039 for trunk/psModules/src/objects/pmSource.c
- Timestamp:
- Sep 26, 2007, 5:35:29 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r14950 r15039 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-09-2 1 00:21:57$8 * @version $Revision: 1.39 $ $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 … … 87 87 pmSource *source = (pmSource *) psAlloc(sizeof(pmSource)); 88 88 *(int *)&source->id = id++; 89 source->seq = -1; 89 90 source->peak = NULL; 90 91 source->pixels = NULL; … … 111 112 source->skyErr = NAN; 112 113 source->pixWeight = NAN; 114 115 source->psfProb = NAN; 116 source->crNsigma = NAN; 117 source->extNsigma = NAN; 113 118 114 119 psTrace("psModules.objects", 5, "---- end ----\n"); … … 930 935 return NULL; 931 936 } 937 938 // sort by SN (descending) 939 int pmSourceSortBySN (const void **a, const void **b) 940 { 941 pmSource *A = *(pmSource **)a; 942 pmSource *B = *(pmSource **)b; 943 944 psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN; 945 psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN; 946 if (isnan (fA)) fA = 0; 947 if (isnan (fB)) fB = 0; 948 949 psF32 diff = fA - fB; 950 if (diff > FLT_EPSILON) return (-1); 951 if (diff < FLT_EPSILON) return (+1); 952 return (0); 953 } 954 955 // sort by Y (ascending) 956 int pmSourceSortByY (const void **a, const void **b) 957 { 958 pmSource *A = *(pmSource **)a; 959 pmSource *B = *(pmSource **)b; 960 961 psF32 fA = (A->peak == NULL) ? 0 : A->peak->y; 962 psF32 fB = (B->peak == NULL) ? 0 : B->peak->y; 963 964 psF32 diff = fA - fB; 965 if (diff > FLT_EPSILON) return (+1); 966 if (diff < FLT_EPSILON) return (-1); 967 return (0); 968 } 969
Note:
See TracChangeset
for help on using the changeset viewer.
