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/cmd.data/lookup.c

    r7952 r20936  
    44 
    55  int i, j;
    6   float *ip, *op, *xp, *yp;
     6  opihi_flt *ip, *op, *xp, *yp;
    77  Vector *in, *out, *xv, *yv;
    88
     
    1717  if ((yv  = SelectVector (argv[4], OLDVECTOR, TRUE)) == NULL) return (FALSE);
    1818
     19  REQUIRE_VECTOR_FLT (in, FALSE);
     20  REQUIRE_VECTOR_FLT (xv, FALSE);
     21  REQUIRE_VECTOR_FLT (yv, FALSE);
     22
    1923  if (xv[0].Nelements != yv[0].Nelements) {
    2024      gprint (GP_ERR, "unmatched lookup table lengths\n");
     
    2226  }
    2327
    24   out[0].Nelements = in[0].Nelements;
    25   REALLOCATE (out[0].elements, float, out[0].Nelements);
     28  ResetVector (out, OPIHI_FLT, in[0].Nelements);
    2629
    27   ip = in[0].elements;
    28   op = out[0].elements;
     30  ip = in[0].elements.Flt;
     31  op = out[0].elements.Flt;
    2932
    3033  for (i = 0; i < in[0].Nelements; i++, ip++, op++) {
    3134    // re-write this using bisection
    32     xp = xv[0].elements;
    33     yp = yv[0].elements;
     35    xp = xv[0].elements.Flt;
     36    yp = yv[0].elements.Flt;
    3437
    3538    for (j = 0; (*ip < *xp) && (j < yv[0].Nelements); j++);
Note: See TracChangeset for help on using the changeset viewer.