aboutsummaryrefslogtreecommitdiff
path: root/noao/imred/dtoi/hdicfit/userfcn.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 /noao/imred/dtoi/hdicfit/userfcn.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/imred/dtoi/hdicfit/userfcn.x')
-rw-r--r--noao/imred/dtoi/hdicfit/userfcn.x37
1 files changed, 37 insertions, 0 deletions
diff --git a/noao/imred/dtoi/hdicfit/userfcn.x b/noao/imred/dtoi/hdicfit/userfcn.x
new file mode 100644
index 00000000..d5dba4ed
--- /dev/null
+++ b/noao/imred/dtoi/hdicfit/userfcn.x
@@ -0,0 +1,37 @@
+include <error.h>
+
+# HD_POWERR -- Construct the basis functions for a power series function.
+# Invoked from curfit as a user function. Real version.
+
+procedure hd_powerr (x, order, k1, k2, basis)
+
+real x # array of data points
+int order # order of polynomial, order = 1, constant
+real k1, k2 # normalizing constants - unused
+real basis[ARB] # basis functions
+
+int i
+
+begin
+ do i = 1, order
+ iferr (basis[i] = x ** (i-1))
+ call erract (EA_FATAL)
+end
+
+
+# HD_POWERD -- Double version of above.
+
+procedure hd_powerd (x, order, k1, k2, basis)
+
+double x # array of data points
+int order # order of polynomial, order = 1, constant
+double k1, k2 # normalizing constants - unused
+double basis[ARB] # basis functions
+
+int i
+
+begin
+ do i = 1, order
+ iferr (basis[i] = x ** (i-1))
+ call erract (EA_FATAL)
+end