aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/acht.gx
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vops/acht.gx')
-rw-r--r--sys/vops/acht.gx36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/vops/acht.gx b/sys/vops/acht.gx
new file mode 100644
index 00000000..e1ad83f4
--- /dev/null
+++ b/sys/vops/acht.gx
@@ -0,0 +1,36 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic).
+# The operation is performed in such a way that the output vector can be
+# the same as the input vector without overwriting data.
+
+procedure acht$t$$t (a, b, npix)
+
+PIXEL a[ARB]
+$PIXEL b[ARB]
+int npix
+$$if (datatype != $t)
+int i
+$$endif
+
+begin
+ $$if (datatype == $t)
+ call amov$t (a, b, npix)
+ $$else
+ $$if (sizeof(t) <= sizeof($t))
+ do i = 1, npix
+ $$if (datatype == x)
+ b[i] = complex(real(a[i]),0.0)
+ $$else
+ b[i] = a[i]
+ $$endif
+ $$else
+ do i = npix, 1, -1
+ $$if (datatype == x)
+ b[i] = complex(real(a[i]),0.0)
+ $$else
+ b[i] = a[i]
+ $$endif
+ $$endif
+ $$endif
+end