IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 23, 2025, 4:33:16 PM (8 months ago)
Author:
eugene
Message:

add spline option to extrapolate (vs saturate); add vweave function (like drizzle for a vector)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-ppmerge-20241229/Ohana/src/opihi/lib.data/spline.c

    r42332 r42946  
    11# include "data.h"
     2
     3static SplineMode MODE = SPLINE_SATURATE; // SATURATE or EXTRAPOLATE?
     4
     5int spline_contruct_mode (SplineMode mode) {
     6 
     7  switch (mode) {
     8  case SPLINE_SATURATE:
     9  case SPLINE_EXTRAPOLATE:
     10    MODE = mode;
     11    break;
     12  default:
     13    return FALSE;
     14  }
     15  return TRUE;
     16}
    217
    318/* construct the natural spline for x, y in y2 */
     
    3651 
    3752  // saturate correction at high and low ends
    38   if (X < x[0]) return y[0];
    39   if (X > x[N-1]) return y[N-1];
     53  if (MODE == SPLINE_SATURATE) {
     54    if (X < x[0]) return y[0];
     55    if (X > x[N-1]) return y[N-1];
     56  }
    4057
    4158  /* find correct element in array (x must be sorted) */
     
    114131 
    115132  // saturate correction at high and low ends
    116   if (X < x[0]) return y[0];
    117   if (X > x[N-1]) return y[N-1];
     133  if (MODE == SPLINE_SATURATE) {
     134    if (X < x[0]) return y[0];
     135    if (X > x[N-1]) return y[N-1];
     136  }
    118137
    119138  /* find correct element in array (x must be sorted) */
Note: See TracChangeset for help on using the changeset viewer.