IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2020, 1:54:47 PM (6 years ago)
Author:
tdeboer
Message:

revert to working Ohana build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/interpolate_presort.c

    r41164 r41340  
    77  double x0, dx, dy, y0;
    88  Vector *xout, *yout, *xin, *yin;
    9 
    10   int N;
    11   int FillEnds = FALSE;
    12   if ((N = get_argument (argc, argv, "-fill-ends"))) {
    13     FillEnds = TRUE;
    14     remove_argument (N, &argc, argv);
    15   }
    169
    1710  /** check basic syntax **/
     
    4336  y0 = yin[0].elements.Flt[0];
    4437 
    45   // fill in the start with NANs
    46   for (i = 0; (i < xout[0].Nelements) && (xout[0].elements.Flt[i] < xin[0].elements.Flt[0]); i++) {
    47     yout[0].elements.Flt[i] = FillEnds ? yin[0].elements.Flt[0] : NAN;
    48   }
     38  /* in and out vectors are sorted */
     39  j = 0;
    4940
    5041  // every output pixel should get a value unless
    5142  // we are below the lowest in or above the highest in
    52   for (j = 0; (i < xout[0].Nelements) && (j < xin[0].Nelements - 1); ) {
     43  for (i = 0, j = 0; (i < xout[0].Nelements) && (j < xin[0].Nelements - 1); ) {
    5344
    5445    yout[0].elements.Flt[i] = NAN;
     
    7566
    7667  // fill in the rest with NANs
    77   int NinLast = xin[0].Nelements - 1;
    7868  while (i < yout[0].Nelements) {
    79     yout[0].elements.Flt[i] = FillEnds ? yin[0].elements.Flt[NinLast] : NAN;
     69    yout[0].elements.Flt[i] = NAN;
    8070    i++;
    8171  }
    8272
    8373  return (TRUE);
     74   
    8475}
Note: See TracChangeset for help on using the changeset viewer.