IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 30, 2008, 7:45:21 AM (18 years ago)
Author:
eugene
Message:

modify functions to use both int and flt vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/paverage.c

    r20839 r20857  
    1010  double Radius, Rmin, Rmax, R, D;
    1111  unsigned IDclip, IDchoice, LimExclude;
    12   opihi_flt *Xvec, *Yvec, *Zvec;
     12  float *Xvec, *Yvec, *Zvec;
    1313  void *Signal;
    1414
     
    3838    photcode = GetPhotcodebyName (argv[Narg]);
    3939    if (!photcode) {
    40         fprintf (stderr, "unknown photcode %s\n", argv[Narg]);
    41         return (FALSE);
     40      fprintf (stderr, "unknown photcode %s\n", argv[Narg]);
     41      return (FALSE);
    4242    }
    4343    remove_argument (Narg, &argc, argv);
    4444    Nsec = GetPhotcodeNsec (photcode[0].code);
    4545    if (Nsec == -1) {
    46         fprintf (stderr, "photcode %s is not an AVERAGE photcode\n", argv[Narg]);
    47         return (FALSE);
     46      fprintf (stderr, "photcode %s is not an AVERAGE photcode\n", argv[Narg]);
     47      return (FALSE);
    4848    }
    4949  }
     
    9696  Npts = 0;
    9797  NPTS = 1000;
    98   ALLOCATE (Xvec, opihi_flt, NPTS);
    99   ALLOCATE (Yvec, opihi_flt, NPTS);
    100   ALLOCATE (Zvec, opihi_flt, NPTS);
     98  ALLOCATE (Xvec, float, NPTS);
     99  ALLOCATE (Yvec, float, NPTS);
     100  ALLOCATE (Zvec, float, NPTS);
    101101
    102102  // prepare to handle interrupt signals
     
    133133      R = average[i].R;
    134134      D = average[i].D;
    135       status = RD_to_XY (&Xvec[Npts], &Yvec[Npts], R, D, &graphmode.coords);
     135      status = fRD_to_XY (&Xvec[Npts], &Yvec[Npts], R, D, &graphmode.coords);
    136136      if (!status) continue;
    137137      Npts ++;
    138138
    139139      if (Npts == NPTS - 1) {
    140           NPTS += 1000;
    141           REALLOCATE (Xvec, opihi_flt, NPTS);
    142           REALLOCATE (Yvec, opihi_flt, NPTS);
    143           REALLOCATE (Zvec, opihi_flt, NPTS);
     140        NPTS += 1000;
     141        REALLOCATE (Xvec, float, NPTS);
     142        REALLOCATE (Yvec, float, NPTS);
     143        REALLOCATE (Zvec, float, NPTS);
    144144      }
    145145      if ((Npts > NCHUNK) || (Nloaded >= 25)) {
    146           PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
    147           Npts = 0;
    148           Nloaded = 0;
     146        KapaPrepPlot (kapa, Npts, graphmode);
     147        KapaPlotVector (kapa, Npts, Xvec, "x");
     148        KapaPlotVector (kapa, Npts, Yvec, "y");
     149        KapaPlotVector (kapa, Npts, Zvec, "z");
     150        Npts = 0;
     151        Nloaded = 0;
    149152      }
    150153    }
     
    152155    dvo_catalog_free (&catalog);
    153156  }
    154   if (Npts > 0) PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
     157  if (Npts > 0) {
     158    KapaPrepPlot (kapa, Npts, graphmode);
     159    KapaPlotVector (kapa, Npts, Xvec, "x");
     160    KapaPlotVector (kapa, Npts, Yvec, "y");
     161    KapaPlotVector (kapa, Npts, Zvec, "z");
     162  }
    155163
    156164  free (Xvec);
Note: See TracChangeset for help on using the changeset viewer.