aboutsummaryrefslogtreecommitdiff
path: root/math/iminterp/asisave.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /math/iminterp/asisave.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/iminterp/asisave.x')
-rw-r--r--math/iminterp/asisave.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/math/iminterp/asisave.x b/math/iminterp/asisave.x
new file mode 100644
index 00000000..6d6d83db
--- /dev/null
+++ b/math/iminterp/asisave.x
@@ -0,0 +1,42 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "im1interpdef.h"
+include <math/iminterp.h>
+
+# ASISAVE -- Procedure to save the interpolant for later use by ASIEVAL,
+# ASIVECTOR, ASIDER and ASIGRL.
+
+procedure asisave (asi, interpolant)
+
+pointer asi # interpolant descriptor
+real interpolant[ARB] # array containing the interpolant
+
+int i, nconv
+pointer cptr
+
+begin
+ # Save the interpolant type, number of coefficients, and position of
+ # first data point.
+
+ ASI_SAVETYPE(interpolant) = ASI_TYPE(asi)
+ ASI_SAVENSINC(interpolant) = ASI_NSINC(asi)
+ ASI_SAVENINCR(interpolant) = ASI_NINCR(asi)
+ ASI_SAVESHIFT(interpolant) = ASI_SHIFT(asi)
+ ASI_SAVEPIXFRAC(interpolant) = ASI_PIXFRAC(asi)
+ ASI_SAVENCOEFF(interpolant) = ASI_NCOEFF(asi)
+ ASI_SAVEOFFSET(interpolant) = ASI_OFFSET(asi)
+ ASI_SAVEBADVAL(interpolant) = ASI_BADVAL(asi)
+
+ # Save the coefficients.
+ cptr = ASI_COEFF(asi) - 1
+ do i = 1, ASI_NCOEFF(asi)
+ interpolant[ASI_SAVECOEFF+i] = COEFF(cptr+i)
+
+ # Save the lookup-tables.
+ if (ASI_NINCR(asi) > 0) {
+ nconv = 2 * ASI_NSINC(asi) + 1
+ cptr = ASI_LTABLE(asi) - 1
+ do i = 1, nconv * ASI_NINCR(asi)
+ interpolant[ASI_SAVECOEFF+ASI_NCOEFF(asi)+i] = LTABLE(cptr+i)
+ }
+end