aboutsummaryrefslogtreecommitdiff
path: root/pkg/xtools/inlfit/inguaxes.gx
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 /pkg/xtools/inlfit/inguaxes.gx
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/xtools/inlfit/inguaxes.gx')
-rw-r--r--pkg/xtools/inlfit/inguaxes.gx47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkg/xtools/inlfit/inguaxes.gx b/pkg/xtools/inlfit/inguaxes.gx
new file mode 100644
index 00000000..58942f52
--- /dev/null
+++ b/pkg/xtools/inlfit/inguaxes.gx
@@ -0,0 +1,47 @@
+include <math/nlfit.h>
+include <pkg/inlfit.h>
+
+
+# ING_UAXES -- Set user axis
+
+procedure ing_uaxes$t (keynum, in, nl, x, y, z, npts, nvars)
+
+int keynum # Key number for axes
+pointer in # INLFIT pointer
+pointer nl # NLFIT pointer
+PIXEL x[ARB] # Independent variable
+PIXEL y[npts] # Dependent variable
+PIXEL z[npts] # Output values
+int npts # Number of points
+int nvars # Number of variables
+
+int npars # number of parameters
+int uaxes # user defined procedure
+pointer params # parameter values
+pointer sp
+
+int nlstati()
+int in_geti()
+
+begin
+ # Check if equation is defined
+ uaxes = in_geti (in, INLUAXES)
+ if (!IS_INDEFI (uaxes)) {
+
+ # Get number of parameters, allocate space
+ # for parameter values, and get parameter values
+ npars = nlstati (nl, NLNPARAMS)
+ call smark (sp)
+ call salloc (params, npars, TY_PIXEL)
+ call nlpget$t (nl, Mem$t[params], npars)
+
+ # Call user plot functions
+ call zcall8 (uaxes, keynum, Mem$t[params], npars,
+ x, y, z, npts, nvars)
+
+ # Free memory
+ call sfree (sp)
+
+ } else
+ call eprintf ("Warning: User plot function not defined\n")
+end