aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/ecidentify/ecffit/ecfshift.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/onedspec/ecidentify/ecffit/ecfshift.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/onedspec/ecidentify/ecffit/ecfshift.x')
-rw-r--r--noao/onedspec/ecidentify/ecffit/ecfshift.x55
1 files changed, 55 insertions, 0 deletions
diff --git a/noao/onedspec/ecidentify/ecffit/ecfshift.x b/noao/onedspec/ecidentify/ecffit/ecfshift.x
new file mode 100644
index 00000000..75655703
--- /dev/null
+++ b/noao/onedspec/ecidentify/ecffit/ecfshift.x
@@ -0,0 +1,55 @@
+# ECF_GSHIFT -- Return the shift for the given order.
+
+double procedure ecf_gshift (ecf, order)
+
+pointer ecf # GSURFIT pointer
+int order # User order
+
+include "ecffit.com"
+
+begin
+ return (shift / (slope * order + offset))
+end
+
+
+# ECF_PSHIFT -- Put the shift for the given order.
+
+procedure ecf_pshift (ecf, order, shft)
+
+pointer ecf # GSURFIT pointer
+int order # User order
+double shft # Shift at given order
+
+include "ecffit.com"
+
+begin
+ shift = shft * (slope * order + offset)
+end
+
+
+procedure ecf_vector (ecf, order, x, fit, npts)
+
+pointer ecf # GSURFIT pointer
+int order # Order
+double x[npts] # X points
+double fit[npts] # Fitted points
+int npts # Number of points
+
+double yval
+pointer sp, y
+
+include "ecffit.com"
+
+begin
+ call smark (sp)
+ call salloc (y, npts, TY_DOUBLE)
+
+ yval = slope * order + offset
+ call amovkd (yval, Memd[y], npts)
+ call dgsvector (ecf, x, Memd[y], fit, npts)
+ call adivkd (fit, yval, fit, npts)
+ if (shift != 0.)
+ call aaddkd (fit, shift / yval, fit, npts)
+
+ call sfree (sp)
+end