IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40581 for trunk


Ignore:
Timestamp:
Dec 10, 2018, 5:05:32 PM (8 years ago)
Author:
eugene
Message:

fix end-post error in unique region list; test for coordinates in region based on normalized RA values; for regions near the 0,360 boundary, check above or below boundary if needed; do not try to weed out points based on discovered regions (with large radius, this test goes awry)

Location:
trunk/Ohana/src/opihi/dvo
Files:
2 edited

Legend:

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

    r40523 r40581  
    213213  for (i = 0; i < Npoints; i++) {
    214214    inCatalog[i] = FALSE;
    215     if (RAvec->elements.Flt[i] < Rmin) continue;
    216     if (RAvec->elements.Flt[i] > Rmax) continue;
     215
     216    // we need to worry about points near the 0,360 boundary.  I have expanded Rmin and
     217    // Rmax to account for the RADIUS.  if I have a region which is close to the boundary,
     218    // then: Rmin < 0 or Rmax > 360.  if so, check on the other side as well
     219
     220    int altTest = FALSE;
     221    double Rnorm = ohana_normalize_angle (RAvec->elements.Flt[i]);
     222    if ((Rmax > 360.0) && (Rnorm < 180.0)) {
     223      double Rtest = Rnorm + 360.0;
     224      if (Rtest < Rmin) continue;
     225      if (Rtest > Rmax) continue;
     226      altTest = TRUE;
     227    }
     228    if ((Rmin < 0.0) && (Rnorm > 180.0)) {
     229      double Rtest = Rnorm - 360.0;
     230      if (Rtest < Rmin) continue;
     231      if (Rtest > Rmax) continue;
     232      altTest = TRUE;
     233    }
     234    if (!altTest) {
     235      if (Rnorm < Rmin) continue;
     236      if (Rnorm > Rmax) continue;
     237    }
     238
    217239    if (DECvec->elements.Flt[i] < Dmin) continue;
    218240    if (DECvec->elements.Flt[i] > Dmax) continue;
  • trunk/Ohana/src/opihi/dvo/skyregion.c

    r40576 r40581  
    186186  list->regions[Nout] = input->regions[0];
    187187  list->filename[Nout] = input->filename[0];
     188  Nout ++;
    188189
    189190  for (int i = 0; i < input->Nregions; i++) {
    190     if (list->regions[Nout][0].index == input->regions[i][0].index) continue;
    191     Nout ++;
     191    if (list->regions[Nout-1][0].index == input->regions[i][0].index) continue;
    192192    list->regions[Nout] = input->regions[i];
    193193    list->filename[Nout] = input->filename[i];
     194    Nout ++;
    194195  }
    195196  list->Nregions = Nout;
     
    249250    // scan over the remaining points to find any that lie within these regions
    250251    // if we sorted the ra,dec inputs we could break out of this more quickly
    251     for (int j = i + 1; j < Npts; j++) {
     252    for (int j = i + 1; FALSE && (j < Npts); j++) {
    252253      ra = RA->elements.Flt[j];
    253254      dec = DEC->elements.Flt[j];
    254       for (int n = 0; !found[j] && (n < new->Nregions); n++) {
     255      for (int n = 0; n < new->Nregions; n++) {
    255256        if (ra  < new[0].regions[n][0].Rmin) continue;
    256257        if (ra  > new[0].regions[n][0].Rmax) continue;
Note: See TracChangeset for help on using the changeset viewer.