IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2012, 1:12:18 PM (14 years ago)
Author:
eugene
Message:

do not modify input vectors when rationalizing ra range

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.astro/cplot.c

    r34490 r34521  
    33int cplot (int argc, char **argv) {
    44 
     5  double ra_prev;
    56  int i, kapa, Npts, status, leftside;
    67  opihi_flt *x, *y, *r, *d, Rmin, Rmax, Rmid;
     
    4142  Npts = 0;
    4243  for (i = 0; i < Xvec.Nelements; i++, r++, d++) {
    43     *r = ohana_normalize_angle (*r);
    44     while (*r < Rmin) *r += 360.0;
    45     while (*r > Rmax) *r -= 360.0;
     44    double ra = ohana_normalize_angle (*r);
     45    while (ra < Rmin) ra += 360.0;
     46    while (ra > Rmax) ra -= 360.0;
    4647
    4748    // for pair-by-pair connections, check on second point if we straddle the back midline
    48     if ((graphmode.ptype == 100) && (i % 2)) {
    49       leftside = (r[-1] < Rmid); // if first of the pair is left, second must be as well
    50       if ( leftside && (r[0] > Rmid + 90)) { r[0] -= 360.0; }
    51       if (!leftside && (r[0] < Rmid - 90)) { r[0] += 360.0; }
     49    if (graphmode.ptype == 100) {
     50      if (i % 2) {
     51        leftside = (ra_prev < Rmid); // if first of the pair is left, second must be as well
     52        if ( leftside && (ra > Rmid + 90)) { ra -= 360.0; }
     53        if (!leftside && (ra < Rmid - 90)) { ra += 360.0; }
     54      } else {
     55        ra_prev = ra;
     56      }
    5257    }
    53     status = RD_to_XY (x, y, *r, *d, &graphmode.coords);
     58    status = RD_to_XY (x, y, ra, *d, &graphmode.coords);
    5459
    5560    // if we fail on one of the points, drop the corresponding pair
Note: See TracChangeset for help on using the changeset viewer.