aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/imaplv.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 /sys/imio/imaplv.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/imaplv.x')
-rw-r--r--sys/imio/imaplv.x30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/imio/imaplv.x b/sys/imio/imaplv.x
new file mode 100644
index 00000000..36a1f315
--- /dev/null
+++ b/sys/imio/imaplv.x
@@ -0,0 +1,30 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <imio.h>
+
+# IMAPLV -- Transform the logical vector LV (which references an image section)
+# into a physical vector (which references the physical image).
+
+procedure imaplv (im, lv, pv, ndim)
+
+pointer im
+long lv[ndim], pv[IM_MAXDIM]
+int ndim
+int loff # logical offset (subscript)
+int nldims # number of logical dimensions
+int i, j # i = logical dim index, j = physical dim index
+
+begin
+ i = 1
+ nldims = min (IM_NDIM(im), ndim)
+
+ do j = 1, IM_NPHYSDIM(im) {
+ if (i <= nldims && IM_VMAP(im,i) == j) {
+ loff = lv[i]
+ i = i + 1
+ } else
+ loff = 1
+ pv[j] = IM_VOFF(im,j) + IM_VSTEP(im,j) * loff
+ }
+end