IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2008, 3:31:01 PM (18 years ago)
Author:
eugene
Message:

big update from eam_branch_20081124 with updates to Opihi math

File:
1 edited

Legend:

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

    r19823 r20936  
    3030  srand48(B);
    3131
     32  N = 0;
    3233  NPTS = 200;
    33   ALLOCATE (Xvec.elements, float, NPTS);
    34   ALLOCATE (Yvec.elements, float, NPTS);
    35   N = 0;
     34  SetVector (&Xvec, OPIHI_FLT, NPTS);
     35  SetVector (&Yvec, OPIHI_FLT, NPTS);
     36
    3637  for (i = 0; i < Nimage; i++) {
    3738    /* choose a position for point within image box */
     
    4546    while (r < Rmin) r += 360.0;
    4647    while (r > Rmax) r -= 360.0;
    47     status |= fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, d, &graphmode.coords);
    48     if ((Xvec.elements[N] >= graphmode.xmin) &&
    49         (Xvec.elements[N] <= graphmode.xmax) &&
    50         (Yvec.elements[N] >= graphmode.ymin) &&
    51         (Yvec.elements[N] <= graphmode.ymax) && status) {
     48    status |= RD_to_XY (&Xvec.elements.Flt[N], &Yvec.elements.Flt[N], r, d, &graphmode.coords);
     49    if ((Xvec.elements.Flt[N] >= graphmode.xmin) &&
     50        (Xvec.elements.Flt[N] <= graphmode.xmax) &&
     51        (Yvec.elements.Flt[N] >= graphmode.ymin) &&
     52        (Yvec.elements.Flt[N] <= graphmode.ymax) && status) {
    5253      N++;
    5354      if (N > NPTS - 1) {
    5455        NPTS += 200;
    55         REALLOCATE (Xvec.elements, float, NPTS);
    56         REALLOCATE (Yvec.elements, float, NPTS);
     56        REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS);
     57        REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS);
    5758      }
    5859    }
    5960  }
    6061
    61   Xvec.Nelements = Xvec.Nelements = N;
     62  Xvec.Nelements = Yvec.Nelements = N;
    6263  if (N > 0) {
    6364    graphmode.style = 2; /* points */
    6465    graphmode.etype = 0;
    65     PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
     66    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    6667  }
    6768
    68   free (Xvec.elements);
    69   free (Yvec.elements);
     69  free (Xvec.elements.Flt);
     70  free (Yvec.elements.Flt);
    7071  free (image);
    7172  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.