aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/mwsltermd.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/mwsltermd.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/mwcs/mwsltermd.x')
-rw-r--r--sys/mwcs/mwsltermd.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/mwcs/mwsltermd.x b/sys/mwcs/mwsltermd.x
new file mode 100644
index 00000000..f5619fd7
--- /dev/null
+++ b/sys/mwcs/mwsltermd.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+include "mwcs.h"
+
+# MW_SLTERMD -- Set the Lterm, double precision version. Since all floating
+# data is stored as double internally, we merely copy the data in.
+
+procedure mw_sltermd (mw, ltm, ltv, ndim)
+
+pointer mw #I pointer to MWCS descriptor
+double ltm[ndim,ndim] #I linear transformation matrix
+double ltv[ndim] #I translation vector
+int ndim #I dimensionality of system
+
+pointer mw_allocd()
+errchk syserrs, mw_allocd
+
+begin
+ # The dimensionality of the data must match that of the current Lterm.
+ if (ndim != MI_NDIM(mw))
+ call syserrs (SYS_MWNDIM, "mw_sltermd")
+
+ # Copy in the data. Cobber the old data if the Lterm has been set,
+ # otherwise allocate space in the global data area.
+
+ if (MI_LTM(mw) == NULL)
+ MI_LTM(mw) = mw_allocd (mw, ndim*ndim)
+ call amovd (ltm, D(mw,MI_LTM(mw)), ndim*ndim)
+
+ if (MI_LTV(mw) == NULL)
+ MI_LTV(mw) = mw_allocd (mw, ndim)
+ call amovd (ltv, D(mw,MI_LTV(mw)), ndim)
+end