aboutsummaryrefslogtreecommitdiff
path: root/math/interp/asival.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /math/interp/asival.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'math/interp/asival.x')
-rw-r--r--math/interp/asival.x49
1 files changed, 49 insertions, 0 deletions
diff --git a/math/interp/asival.x b/math/interp/asival.x
new file mode 100644
index 00000000..56f18938
--- /dev/null
+++ b/math/interp/asival.x
@@ -0,0 +1,49 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+.help
+ procedure asival
+
+ This procedure finds interpolated value assuming that x lands in
+array i.e. 1 <= x < npts.
+It must be called by a routine that checks for out of bound references
+and takes care of bad pixels.
+ This version assumes that the data are stored for polynomials and
+the spline appears as basis-spline coefficients.
+ Also the sequential evaluators are used to obtain the values in
+order to reduce the amount of duplicated code.
+.endhelp
+
+real procedure asival(x,coeff)
+include "interpdef.h"
+include "asidef.h"
+
+real x
+real coeff[ARB]
+
+real t
+
+begin
+ switch (ITYPEI) { # switch on interpolator type
+
+ case IT_NEAREST :
+ call iievne(x,t,1,coeff[COFF+1])
+ return(t)
+
+ case IT_LINEAR :
+ call iievli(x,t,1,coeff[COFF+1])
+ return(t)
+
+ case IT_POLY3 :
+ call iievp3(x,t,1,coeff[COFF+1])
+ return(t)
+
+ case IT_POLY5 :
+ call iievp5(x,t,1,coeff[COFF+1])
+ return(t)
+
+ case IT_SPLINE3 :
+ call iievs3(x,t,1,coeff[COFF+1])
+ return(t)
+
+ }
+end