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/imbox.c

    r20212 r20936  
    3636 
    3737  /* project this image to screen display coords */
    38   ALLOCATE (Xvec.elements, float, 8);
    39   ALLOCATE (Yvec.elements, float, 8);
     38  SetVector (&Xvec, OPIHI_FLT, 8);
     39  SetVector (&Yvec, OPIHI_FLT, 8);
    4040
    4141  while (gfits_fread_header (f, &header)) {
     
    8282        while (r > Rmid) r-= 360.0;
    8383      }
    84       status |= fRD_to_XY (&Xvec.elements[2*j], &Yvec.elements[2*j], r, d, &graphmode.coords);
     84      status |= RD_to_XY (&Xvec.elements.Flt[2*j], &Yvec.elements.Flt[2*j], r, d, &graphmode.coords);
    8585      if (j > 0) {
    86         Xvec.elements[2*j - 1] = Xvec.elements[2*j];
    87         Yvec.elements[2*j - 1] = Yvec.elements[2*j];
     86        Xvec.elements.Flt[2*j - 1] = Xvec.elements.Flt[2*j];
     87        Yvec.elements.Flt[2*j - 1] = Yvec.elements.Flt[2*j];
    8888      }
    8989    }
    90     Xvec.elements[7] = Xvec.elements[0];
    91     Yvec.elements[7] = Yvec.elements[0];
     90    Xvec.elements.Flt[7] = Xvec.elements.Flt[0];
     91    Yvec.elements.Flt[7] = Yvec.elements.Flt[0];
    9292    InPic = FALSE;
    9393    for (j = 0; j < 8; j+=2) {
    94       if ((Xvec.elements[j] >= graphmode.xmin) &&
    95           (Xvec.elements[j] <= graphmode.xmax) &&
    96           (Yvec.elements[j] >= graphmode.ymin) &&
    97           (Yvec.elements[j] <= graphmode.ymax))
     94      if ((Xvec.elements.Flt[j] >= graphmode.xmin) &&
     95          (Xvec.elements.Flt[j] <= graphmode.xmax) &&
     96          (Yvec.elements.Flt[j] >= graphmode.ymin) &&
     97          (Yvec.elements.Flt[j] <= graphmode.ymax))
    9898        InPic = TRUE;
    9999    }
    100100
    101     Xvec.Nelements = Xvec.Nelements = 8;
     101    Xvec.Nelements = Yvec.Nelements = 8;
    102102    if (InPic) {
    103103      graphmode.style = 2; /* points */
    104104      graphmode.ptype = 100; /* connect pairs of points */
    105105      graphmode.etype = 0;
    106       PlotVectorPair (kapa, 8, Xvec.elements, Yvec.elements, &graphmode);
     106      PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    107107    }
    108108  skip:
     
    112112  }
    113113  fclose (f);
    114   free (Xvec.elements);
    115   free (Yvec.elements);
     114  free (Xvec.elements.Flt);
     115  free (Yvec.elements.Flt);
    116116  return (TRUE);
    117117
Note: See TracChangeset for help on using the changeset viewer.