aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/ecidentify/ecffit/ecfshift.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 /noao/onedspec/ecidentify/ecffit/ecfshift.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
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