aboutsummaryrefslogtreecommitdiff
path: root/math/gsurfit/gssaver.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/gsurfit/gssaver.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/gsurfit/gssaver.x')
-rw-r--r--math/gsurfit/gssaver.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/math/gsurfit/gssaver.x b/math/gsurfit/gssaver.x
new file mode 100644
index 00000000..b4f5bf32
--- /dev/null
+++ b/math/gsurfit/gssaver.x
@@ -0,0 +1,42 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <math/gsurfit.h>
+include "gsurfitdef.h"
+
+# GSSAVE -- Procedure to save the surface fit for later use by the
+# evaluate routines. After a call to GSSAVE the first eight elements
+# of fit contain the surface type, xorder (or number of polynomial pieces
+# in x), yorder (or the number of polynomial pieces in y), xterms, xmin,
+# xmax, ymin, and ymax. The remaining spaces are filled by the GS_NCOEFF(sf)
+# coefficients.
+
+procedure gssave (sf, fit)
+
+pointer sf # pointer to the surface descriptor
+real fit[ARB] # array for storing fit
+
+begin
+ # get the surface parameters
+ if (sf == NULL)
+ return
+
+ # order is surface type dependent
+ switch (GS_TYPE(sf)) {
+ case GS_LEGENDRE, GS_CHEBYSHEV, GS_POLYNOMIAL:
+ GS_SAVEXORDER(fit) = GS_XORDER(sf)
+ GS_SAVEYORDER(fit) = GS_YORDER(sf)
+ default:
+ call error (0, "GSSAVE: Unknown surface type.")
+ }
+
+ # save remaining parameters
+ GS_SAVETYPE(fit) = GS_TYPE(sf)
+ GS_SAVEXMIN(fit) = GS_XMIN(sf)
+ GS_SAVEXMAX(fit) = GS_XMAX(sf)
+ GS_SAVEYMIN(fit) = GS_YMIN(sf)
+ GS_SAVEYMAX(fit) = GS_YMAX(sf)
+ GS_SAVEXTERMS(fit) = GS_XTERMS(sf)
+
+ # save the coefficients
+ call amovr (COEFF(GS_COEFF(sf)), fit[GS_SAVECOEFF+1], GS_NCOEFF(sf))
+end