Changeset 26277
- Timestamp:
- Nov 25, 2009, 11:48:23 AM (16 years ago)
- Location:
- trunk/Ohana/src/addstar/src
- Files:
-
- 2 edited
-
find_matches.c (modified) (3 diffs)
-
find_matches_closest.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/find_matches.c
r21508 r26277 7 7 double *X1, *Y1, *X2, *Y2; 8 8 double dX, dY, dR; 9 int *N1, *N2, *next_meas;9 int *N1, *N2, *next_meas; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmatch; 11 11 int Nsecfilt, Nsec; … … 24 24 ALLOCATE (X1, double, NstarsIn); 25 25 ALLOCATE (Y1, double, NstarsIn); 26 ALLOCATE (N1, int, NstarsIn);26 ALLOCATE (N1, int, NstarsIn); 27 27 28 28 /** allocate local arrays (catalog) **/ … … 338 338 free (Y1); 339 339 free (N1); 340 free (N2); 340 341 free (X2); 341 342 free (Y2); 342 free (N2); 343 free (next_meas); 344 343 345 return (Nmatch); 344 346 } -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r21508 r26277 24 24 ALLOCATE (X1, double, NstarsIn); 25 25 ALLOCATE (Y1, double, NstarsIn); 26 ALLOCATE (N1, int, NstarsIn);26 ALLOCATE (N1, int, NstarsIn); 27 27 28 28 /** allocate local arrays (catalog) **/ … … 42 42 catID = catalog[0].catID; 43 43 44 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the 45 * advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all 46 * possible X,Y points map back to R,D and the local plate scale changes substantially far from 47 * the projection pole. a better mapping might be ARC, not yet implemented (see 48 * coordops.update.c). We use the center of the region (catalog) for crval1,2. 44 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ARC projection has 45 * the advantage that every point in R,D has a mapping to a unique X,Y. However, note 46 * that not all possible X,Y points map back to R,D and the local plate scale changes 47 * far from the projection pole. We use the center of the region (catalog) for crval1,2. 49 48 */ 50 49 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); … … 117 116 /* negative dX: j is too large */ 118 117 dX = X1[i] - X2[j]; 119 if (dX <= - 2*RADIUS) {118 if (dX <= -1.02*RADIUS) { 120 119 i++; 121 120 continue; 122 121 } 123 122 /* positive dX, i is too large */ 124 if (dX >= 2*RADIUS) {123 if (dX >= 1.02*RADIUS) { 125 124 j++; 126 125 continue; 127 126 } 128 127 128 /* within match range; look for matches */ 129 129 Jmin = -1; 130 130 Rmin = RADIUS2; 131 for (J = j; (dX > - 2*RADIUS) && (J < Nave); J++) {131 for (J = j; (dX > -1.02*RADIUS) && (J < Nave); J++) { 132 132 /* find closest match for this detection */ 133 133 dX = X1[i] - X2[J]; … … 195 195 } 196 196 197 198 197 /* adds the measurement to the calibration if appropriate color terms are found */ 199 198 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ … … 285 284 286 285 // the following measure elements cannot be set until here: 287 catalog[0].measure[Nmeas].dR = 0.0; 288 catalog[0].measure[Nmeas].dD = 0.0; 286 catalog[0].measure[Nmeas].dR = 0.0; // astrometric offset, not error 287 catalog[0].measure[Nmeas].dD = 0.0; // astrometric offset, not error 289 288 catalog[0].measure[Nmeas].dbFlags = 0; 290 289 catalog[0].measure[Nmeas].averef = Nave; … … 336 335 free (Y1); 337 336 free (N1); 337 free (N2); 338 338 free (X2); 339 339 free (Y2); 340 free (N2); 340 free (next_meas); 341 341 342 return (Nmatch); 342 343 }
Note:
See TracChangeset
for help on using the changeset viewer.
