From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/onedspec/splot/fudgept.x | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 noao/onedspec/splot/fudgept.x (limited to 'noao/onedspec/splot/fudgept.x') diff --git a/noao/onedspec/splot/fudgept.x b/noao/onedspec/splot/fudgept.x new file mode 100644 index 00000000..c2aa3740 --- /dev/null +++ b/noao/onedspec/splot/fudgept.x @@ -0,0 +1,38 @@ +# FUDGEPT -- Fudge a point + +procedure fudgept (sh, gfd, x, y, n, wx, wy) + +pointer sh +int gfd +real x[n] +real y[n] +int n +real wx, wy + +int i1, nplot, istart +double shdr_wl() + +begin + # Get pixel number + i1 = max (1, min (n, nint (shdr_wl (sh, double(wx))))) + + # Replace with Y-value + if (i1 > 0 && i1 <= n) + y[i1] = wy + else + return + + # Plot region around new point + if (i1 > 1 && i1 < n) { + nplot = 3 + istart = i1 - 1 + } else if (i1 == 1) { + nplot = 2 + istart = i1 + } else if (i1 == n) { + nplot = 2 + istart = n - 1 + } + + call gpline (gfd, x[istart], y[istart], nplot) +end -- cgit