IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29123


Ignore:
Timestamp:
Sep 7, 2010, 9:07:04 AM (16 years ago)
Author:
eugene
Message:

I think avmatch gaps were caused by not handling the boundary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/find_matches.c

    r27610 r29123  
    1010  off_t *N1, *N2;
    1111  double *X1, *Y1, *X2, *Y2;
    12   double dX, dY, dR;
     12  double dX, dY, dR, Doff, Dmin, Dmax, Rmin, Rmax;
    1313  int status;
    14   double RADIUS2, Rmin;
     14  double RADIUS2, RadMin;
    1515  off_t Nave;
    1616  Coords tcoords;
     
    5252  strcpy (tcoords.ctype, "RA---ARC");
    5353
     54  // this region includes a boundary layer of size RADIUS
     55  if (fabs(region[0].Dmin) < fabs(region[0].Dmax)) {
     56    Doff = RAD_DEG*region[0].Dmax;
     57  } else {
     58    Doff = RAD_DEG*region[0].Dmin;
     59  }   
     60  if (Doff < 80) {
     61    Rmin = region[0].Rmin - RADIUS / 3600.0 / cos(Doff);
     62    Rmax = region[0].Rmax + RADIUS / 3600.0 / cos(Doff);
     63  } else {
     64    Rmin = 0.0;
     65    Rmax = 360.0;
     66  }
     67  Dmin = region[0].Dmin - RADIUS / 3600.0;
     68  Dmax = region[0].Dmax + RADIUS / 3600.0;
     69
    5470  // identify the entries contained by this catalog & init index
    5571  for (i = 0; i < Npoints; i++) {
    5672    index[i] = -1;
    57     if (RAvec->elements.Flt[i] < region[0].Rmin) continue;
    58     if (RAvec->elements.Flt[i] > region[0].Rmax) continue;
    59     if (DECvec->elements.Flt[i] < region[0].Dmin) continue;
    60     if (DECvec->elements.Flt[i] > region[0].Dmax) continue;
     73    if (RAvec->elements.Flt[i] < Rmin) continue;
     74    if (RAvec->elements.Flt[i] > Rmax) continue;
     75    if (DECvec->elements.Flt[i] < Dmin) continue;
     76    if (DECvec->elements.Flt[i] > Dmax) continue;
    6177    index[i] = -2;
    6278  }
     
    100116    /* within match range; look for matches */
    101117    Jmin = -1;
    102     Rmin = RADIUS2;
     118    RadMin = RADIUS2;
    103119    for (J = j; (dX > -1.02*RADIUS) && (J < Nave); J++) {
    104120      /* find closest match for this detection */
     
    107123      dR = dX*dX + dY*dY;
    108124      if (dR > RADIUS2) continue;
    109       if (dR < Rmin) {
    110         Rmin = dR;
     125      if (dR < RadMin) {
     126        RadMin = dR;
    111127        Jmin  = J;
    112128      }
Note: See TracChangeset for help on using the changeset viewer.