Changeset 8644
- Timestamp:
- Aug 27, 2006, 1:34:01 PM (20 years ago)
- Location:
- trunk/Ohana/src/addstar/src
- Files:
-
- 3 edited
-
find_matches.c (modified) (6 diffs)
-
find_matches_closest.c (modified) (6 diffs)
-
find_matches_refstars.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/find_matches.c
r8458 r8644 1 1 # include "addstar.h" 2 2 3 voidfind_matches (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {3 int find_matches (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) { 4 4 5 5 int i, j, n, N, J, status, Nstars; … … 41 41 NMISS = Nmiss = catalog[0].Nmissing; 42 42 43 /* project onto rectilinear grid with 1 arcsec pixels */ 44 /* we keep the original crpix1,2 and crref1,2 */ 45 /* for mosaic astrometry, the grid should be w.r.t. the tangent-plane, not chip coords */ 43 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the 44 advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all 45 possible X,Y points map back to R,D and the local plate scale changes substantially far from 46 the projection pole. a better mapping might be ARC, not yet implemented (see 47 coordops.update.c). We keep the original crpix1,2 and crref1,2. For mosaic astrometry, the 48 grid should be w.r.t. the tangent-plane, not chip coords */ 49 46 50 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 47 51 tcoords = mosaic[0]; … … 50 54 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 51 55 tcoords.Npolyterms = 1; 52 strcpy (tcoords.ctype, "RA--- TAN");56 strcpy (tcoords.ctype, "RA---ZEA"); 53 57 } else { 54 58 tcoords = image[0].coords; … … 57 61 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 58 62 tcoords.Npolyterms = 1; 59 strcpy (tcoords.ctype, "RA--- TAN");63 strcpy (tcoords.ctype, "RA---ZEA"); 60 64 } 61 65 … … 151 155 /** dR,dD now represent arcsec **/ 152 156 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 157 if (catalog[0].measure[Nmeas].dR_PS > +180.0*3600.0) { 158 // average on high end of boundary, move star up 159 stars[N].R += 360.0; 160 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 161 } 162 if (catalog[0].measure[Nmeas].dR_PS < -180.0*3600.0) { 163 // average on low end of boundary, move star down 164 stars[N].R -= 360.0; 165 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 166 } 167 if (fabs(catalog[0].measure[Nmeas].dR_PS) > 10*RADIUS) { 168 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 169 catalog[0].average[n].R, catalog[0].average[n].D, 170 stars[N].R, stars[N].D, 171 X1[i], X2[Jmin], 172 Y1[i], Y2[Jmin]); 173 } 153 174 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D - stars[N].D); 154 175 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); … … 369 390 free (Y2); 370 391 free (N2); 371 return ;392 return (Nmatch); 372 393 } 373 394 -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r8328 r8644 1 1 # include "addstar.h" 2 2 3 voidfind_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {3 int find_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) { 4 4 5 5 int i, j, n, N, J, Jmin, status, Nstars; … … 40 40 NMISS = Nmiss = catalog[0].Nmissing; 41 41 42 /* project onto rectilinear grid with 1 arcsec pixels */ 43 /* we keep the original crpix1,2 and crref1,2 */ 44 /* for mosaic astrometry, the grid should be w.r.t. the tangent-plane, not chip coords */ 42 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the 43 advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all 44 possible X,Y points map back to R,D and the local plate scale changes substantially far from 45 the projection pole. a better mapping might be ARC, not yet implemented (see 46 coordops.update.c). We keep the original crpix1,2 and crref1,2. For mosaic astrometry, the 47 grid should be w.r.t. the tangent-plane, not chip coords */ 48 45 49 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 46 50 tcoords = mosaic[0]; … … 49 53 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 50 54 tcoords.Npolyterms = 1; 51 strcpy (tcoords.ctype, "RA--- TAN");55 strcpy (tcoords.ctype, "RA---ZEA"); 52 56 } else { 53 57 tcoords = image[0].coords; … … 56 60 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 57 61 tcoords.Npolyterms = 1; 58 strcpy (tcoords.ctype, "RA--- TAN");62 strcpy (tcoords.ctype, "RA---ZEA"); 59 63 } 60 64 … … 174 178 /** dR,dD now represent arcsec **/ 175 179 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 180 if (catalog[0].measure[Nmeas].dR_PS > +180.0*3600.0) { 181 // average on high end of boundary, move star up 182 stars[N].R += 360.0; 183 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 184 } 185 if (catalog[0].measure[Nmeas].dR_PS < -180.0*3600.0) { 186 // average on low end of boundary, move star down 187 stars[N].R -= 360.0; 188 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R); 189 } 190 if (fabs(catalog[0].measure[Nmeas].dR_PS) > 10*RADIUS) { 191 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 192 catalog[0].average[n].R, catalog[0].average[n].D, 193 stars[N].R, stars[N].D, 194 X1[i], X2[Jmin], 195 Y1[i], Y2[Jmin]); 196 } 176 197 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D - stars[N].D); 177 198 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); … … 374 395 free (Y2); 375 396 free (N2); 376 return ;397 return (Nmatch); 377 398 } 378 399 -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r8458 r8644 1 1 # include "addstar.h" 2 2 3 voidfind_matches_refstars (SkyRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options) {3 int find_matches_refstars (SkyRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options) { 4 4 5 5 int i, j, k, n, m, N, J; … … 55 55 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; 56 56 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 57 strcpy (tcoords.ctype, "RA--- TAN");57 strcpy (tcoords.ctype, "RA---ZEA"); 58 58 tcoords.Npolyterms = 0; 59 59 … … 337 337 catalog[0].Nmissing = Nmiss; 338 338 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nmiss: %d %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmiss, Nmatch); 339 return (Nmatch); 339 340 }
Note:
See TracChangeset
for help on using the changeset viewer.
