IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8644


Ignore:
Timestamp:
Aug 27, 2006, 1:34:01 PM (20 years ago)
Author:
eugene
Message:

changed match projection to ZEA from TAN (this should have no large
impact for modest-sized fields, less than a few tens across), added
test for average/measure pair which are on opposite sides of 0,360
(causes an inconsistent dR value)

Location:
trunk/Ohana/src/addstar/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/find_matches.c

    r8458 r8644  
    11# include "addstar.h"
    22
    3 void find_matches (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {
     3int find_matches (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {
    44
    55  int i, j, n, N, J, status, Nstars;
     
    4141  NMISS = Nmiss = catalog[0].Nmissing;
    4242 
    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
    4650  if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
    4751    tcoords = mosaic[0];
     
    5054    tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
    5155    tcoords.Npolyterms = 1;
    52     strcpy (tcoords.ctype, "RA---TAN");
     56    strcpy (tcoords.ctype, "RA---ZEA");
    5357  } else {
    5458    tcoords = image[0].coords;
     
    5761    tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
    5862    tcoords.Npolyterms = 1;
    59     strcpy (tcoords.ctype, "RA---TAN");
     63    strcpy (tcoords.ctype, "RA---ZEA");
    6064  }
    6165
     
    151155      /** dR,dD now represent arcsec **/
    152156      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      }
    153174      catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N].D);
    154175      catalog[0].measure[Nmeas].M_PS        = MIN (stars[N].M + MTIME, NO_MAG);
     
    369390  free (Y2);
    370391  free (N2);
    371   return;
     392  return (Nmatch);
    372393}
    373394
  • trunk/Ohana/src/addstar/src/find_matches_closest.c

    r8328 r8644  
    11# include "addstar.h"
    22
    3 void find_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {
     3int find_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic, AddstarClientOptions options) {
    44
    55  int i, j, n, N, J, Jmin, status, Nstars;
     
    4040  NMISS = Nmiss = catalog[0].Nmissing;
    4141
    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
    4549  if (!strcmp (&image[0].coords.ctype[4], "-WRP")) {
    4650    tcoords = mosaic[0];
     
    4953    tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
    5054    tcoords.Npolyterms = 1;
    51     strcpy (tcoords.ctype, "RA---TAN");
     55    strcpy (tcoords.ctype, "RA---ZEA");
    5256  } else {
    5357    tcoords = image[0].coords;
     
    5660    tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
    5761    tcoords.Npolyterms = 1;
    58     strcpy (tcoords.ctype, "RA---TAN");
     62    strcpy (tcoords.ctype, "RA---ZEA");
    5963  }
    6064
     
    174178    /** dR,dD now represent arcsec **/
    175179    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    }
    176197    catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N].D);
    177198    catalog[0].measure[Nmeas].M_PS        = MIN (stars[N].M + MTIME, NO_MAG);
     
    374395  free (Y2);
    375396  free (N2);
    376   return;
     397  return (Nmatch);
    377398}
    378399
  • trunk/Ohana/src/addstar/src/find_matches_refstars.c

    r8458 r8644  
    11# include "addstar.h"
    22
    3 void find_matches_refstars (SkyRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options) {
     3int find_matches_refstars (SkyRegion *region, Stars **stars, int Nstars, Catalog *catalog, AddstarClientOptions options) {
    44
    55  int i, j, k, n, m, N, J;
     
    5555  tcoords.pc1_1 = tcoords.pc2_2 = 1.0;
    5656  tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
    57   strcpy (tcoords.ctype, "RA---TAN");
     57  strcpy (tcoords.ctype, "RA---ZEA");
    5858  tcoords.Npolyterms = 0;
    5959 
     
    337337  catalog[0].Nmissing = Nmiss;
    338338  if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nmiss: %d %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmiss, Nmatch);
     339  return (Nmatch);
    339340}
Note: See TracChangeset for help on using the changeset viewer.