IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 7, 2006, 7:15:49 AM (20 years ago)
Author:
eugene
Message:

more efficient plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/cplot.c

    r7080 r7391  
    33int cplot (int argc, char **argv) {
    44 
    5   int i, Npts;
     5  int i, Npts, status;
    66  float *x, *y, *r, *d, Rmin, Rmax;
    77  Vector Xvec, Yvec, *xvec, *yvec;
     
    3939  y = Yvec.elements;
    4040 
    41   for (i = 0; i < Xvec.Nelements; i++, r++, d++, x++, y++) {
     41  Npts = 0;
     42  for (i = 0; i < Xvec.Nelements; i++, r++, d++) {
    4243    while (*r < Rmin) *r += 360.0;
    4344    while (*r > Rmax) *r -= 360.0;
    44     fRD_to_XY (x, y, *r, *d, &graphmode.coords);
     45    status = fRD_to_XY (x, y, *r, *d, &graphmode.coords);
     46    if (!status) {
     47      if (graphmode.ptype == 100) {
     48        if (i % 2) {
     49          // for odd points, skip previous also
     50          x--;
     51          y--;
     52          Npts--;
     53        } else {
     54          // for even points, skip previous also
     55          i++;
     56          r++;
     57          d++;
     58        }
     59      }
     60      continue;
     61    }
     62    x++;
     63    y++;
     64    Npts++;
    4565  }
    46  
    47   Npts = Xvec.Nelements;
     66  Xvec.Nelements = Npts;
     67
    4868  graphmode.etype = 0;
    4969  PrepPlotting (Npts, &graphmode);
Note: See TracChangeset for help on using the changeset viewer.