Changeset 27610 for trunk/Ohana/src/opihi/dvo/find_matches.c
- Timestamp:
- Apr 5, 2010, 3:47:10 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/find_matches.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/find_matches.c
r27594 r27610 7 7 int find_matches_by_vectors (SkyRegion *region, Catalog *catalog, Vector *RAvec, Vector *DECvec, float RADIUS, off_t *index) { 8 8 9 off_t i, j, J, Jmin, n, N, Npoints;9 off_t i, j, J, Jmin, Npoints, Nmatch; 10 10 off_t *N1, *N2; 11 11 double *X1, *Y1, *X2, *Y2; … … 16 16 Coords tcoords; 17 17 18 assert(catalog[0].sorted); 18 // XXX dvoconvert does not correctly maintain 'sorted' 19 // assert(catalog[0].sorted); 19 20 20 21 Npoints = RAvec->Nelements; 22 Nmatch = 0; 21 23 22 24 /** allocate local arrays (points) **/ … … 80 82 RADIUS2 = RADIUS*RADIUS; 81 83 82 # define NEXTi { i++; continue; } 83 # define NEXTj { j++; continue; } 84 # define NEXTi { i++; continue; } 85 # define NEXTj { j++; continue; } 84 86 85 87 /** find matched stars **/ 86 88 for (i = j = 0; (i < Npoints) && (j < Nave); ) { 87 if (index[ i] == -1) NEXTi;89 if (index[N1[i]] == -1) NEXTi; 88 90 if (!finite(X1[i]) || !finite(Y1[i])) NEXTi; 89 91 if (!finite(X2[j]) || !finite(Y2[j])) NEXTj; … … 112 114 113 115 /* no match, try next detection */ 114 if (Jmin == -1) NEXTi; 116 if (Jmin == -1) { 117 NEXTi; 118 } 115 119 116 120 /*** a match is found, set the index for this entry ***/ 117 n= N2[Jmin];118 N = N1[i]; 119 index[N] = n;121 index[N1[i]] = N2[Jmin]; 122 123 Nmatch ++; 120 124 121 125 NEXTi;
Note:
See TracChangeset
for help on using the changeset viewer.
