From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/vops/ak/agltx.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/vops/ak/agltx.x (limited to 'sys/vops/ak/agltx.x') diff --git a/sys/vops/ak/agltx.x b/sys/vops/ak/agltx.x new file mode 100644 index 00000000..c50cfccf --- /dev/null +++ b/sys/vops/ak/agltx.x @@ -0,0 +1,32 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AGLT -- Given a list of ranges, replace the value of each input pixel +# which falls within a given range by applying the corresponding linear +# transformation (b = a * kmul + kadd). If KMUL is identically zero, +# B is replaced by the constant KADD. + +procedure agltx (a, b, npix, low, high, kmul, kadd, nrange) + +complex a[ARB], b[ARB], pixval +int npix, i +complex low[nrange], high[nrange] # range limits +real kmul[nrange], kadd[nrange] +real abs_pixval +int nrange, nr + +begin + do i = 1, npix { + pixval = a[i] + b[i] = pixval + abs_pixval = abs (pixval) + do nr = 1, nrange + if (abs_pixval >= abs (low[nr]) && + abs_pixval <= abs (high[nr])) { + if (kmul[nr] == 0.0) + b[i] = kadd[nr] + else + b[i] = (pixval * kmul[nr]) + kadd[nr] + break + } + } +end -- cgit