aboutsummaryrefslogtreecommitdiff
path: root/math/surfit/iscoeff.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/surfit/iscoeff.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/surfit/iscoeff.x')
-rw-r--r--math/surfit/iscoeff.x37
1 files changed, 37 insertions, 0 deletions
diff --git a/math/surfit/iscoeff.x b/math/surfit/iscoeff.x
new file mode 100644
index 00000000..f656e7e6
--- /dev/null
+++ b/math/surfit/iscoeff.x
@@ -0,0 +1,37 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "surfitdef.h"
+
+# ISCOEFF -- Procedure to fetch the number and magnitude of the coefficients.
+# If the surface type is a bicubic spline or polynomials with cross terms
+# then the number of coefficients is SF_NXCOEFF(sf) * SF_NYCOEFF(sf) and
+# the coefficient of B(i,x) * B(j,y) will be stored in element
+# (i - 1) * SF_NYCOEFF(sf) + j of the array coeff. Otherwise the number
+# of coefficients will be (SF_NXCOEFF(sf) + SF_NYCOEFF(sf) - 1), and
+# the SF_NYCOEFF(sf) y coefficients will be output first followed by
+# the (SF_NXCOEFF(sf) - 1) x coefficients.
+
+procedure iscoeff (sf, coeff, ncoeff)
+
+pointer sf # pointer to the surface fitting descriptor
+real coeff[ARB] # the coefficients of the fit
+int ncoeff # the number of coefficients
+
+int i
+pointer cptr
+
+begin
+ # calculate the number of coefficients
+ if (SF_XTERMS(sf) == NO) {
+ ncoeff = SF_NXCOEFF(sf) + SF_NYCOEFF(sf) - 1
+ call amovr (COEFF(SF_COEFF(sf)), coeff, SF_NYCOEFF(sf))
+ cptr = SF_COEFF(sf) + SF_NYCOEFF(sf)
+ do i = SF_NYCOEFF(sf) + 1, ncoeff {
+ coeff[i] = COEFF(cptr)
+ cptr = cptr + SF_NYCOEFF(sf)
+ }
+ } else {
+ ncoeff = SF_NXCOEFF(sf) * SF_NYCOEFF(sf)
+ call amovr (COEFF(SF_COEFF(sf)), coeff, ncoeff)
+ }
+end