aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/iscl32.c
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/osb/iscl32.c
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/osb/iscl32.c')
-rw-r--r--sys/osb/iscl32.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/osb/iscl32.c b/sys/osb/iscl32.c
new file mode 100644
index 00000000..75e51082
--- /dev/null
+++ b/sys/osb/iscl32.c
@@ -0,0 +1,31 @@
+/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+ */
+
+#define import_spp
+#define import_knames
+#include <stdlib.h>
+#include <iraf.h>
+
+
+/* ISCL32 - Scale a pixel array stored as SPP chars to the desired type.
+ */
+ISCL32 (a, b, npix, bscale, bzero)
+XCHAR *a; /* input array */
+XCHAR *b; /* output array */
+XINT *npix; /* number of bytes to swap */
+XDOUBLE *bscale, *bzero; /* scaling factors */
+{
+ int i, pix;
+ int *ip = (int *) a;
+ float *rp = (float *) calloc (*npix, sizeof (float));
+ float *tmp;
+
+ tmp = rp;
+ for (i=0; i < *npix; i++) {
+ pix = *ip;
+ *tmp = (float) (pix * (*bscale) + (*bzero));
+ tmp++, ip++;
+ }
+
+ memmove (b, rp, (*npix * sizeof (float)));
+}