aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/mwswsampd.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 /sys/mwcs/mwswsampd.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/mwcs/mwswsampd.x')
-rw-r--r--sys/mwcs/mwswsampd.x36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/mwcs/mwswsampd.x b/sys/mwcs/mwswsampd.x
new file mode 100644
index 00000000..10d02068
--- /dev/null
+++ b/sys/mwcs/mwswsampd.x
@@ -0,0 +1,36 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+include "mwcs.h"
+
+# MW_SWSAMPD -- Set the sampled WCS curve for an axis.
+
+procedure mw_swsampd (mw, axis, pv, wv, npts)
+
+pointer mw #I pointer to MWCS descriptor
+int axis #I axis which gets the wsamp vector
+double pv[ARB] #I physical coordinates of points
+double wv[ARB] #I world coordinates of points
+int npts #I number of data point in curve
+
+pointer wp
+int mw_allocd()
+errchk syserrs, mw_allocd
+
+begin
+ # Get the current WCS.
+ wp = MI_WCS(mw)
+ if (wp == NULL)
+ call syserrs (SYS_MWNOWCS, "mw_swsampd")
+
+ # Overwrite the current curve, if any, else allocate new storage.
+ if (WCS_PV(wp,axis) == NULL || WCS_NPTS(wp,axis) < npts)
+ WCS_PV(wp,axis) = mw_allocd (mw, npts)
+ call amovd (pv, D(mw,WCS_PV(wp,axis)), npts)
+
+ if (WCS_WV(wp,axis) == NULL || WCS_NPTS(wp,axis) < npts)
+ WCS_WV(wp,axis) = mw_allocd (mw, npts)
+ call amovd (wv, D(mw,WCS_WV(wp,axis)), npts)
+
+ WCS_NPTS(wp,axis) = npts
+end