diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/vops/ak/agltr.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/vops/ak/agltr.x')
-rw-r--r-- | sys/vops/ak/agltr.x | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/vops/ak/agltr.x b/sys/vops/ak/agltr.x new file mode 100644 index 00000000..974344a4 --- /dev/null +++ b/sys/vops/ak/agltr.x @@ -0,0 +1,29 @@ +# 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 agltr (a, b, npix, low, high, kmul, kadd, nrange) + +real a[ARB], b[ARB], pixval +int npix, i +real low[nrange], high[nrange] # range limits +real kmul[nrange], kadd[nrange] +int nrange, nr + +begin + do i = 1, npix { + pixval = a[i] + b[i] = pixval + do nr = 1, nrange + if (pixval >= low[nr] && pixval <= high[nr]) { + if (kmul[nr] == 0.0) + b[i] = kadd[nr] + else + b[i] = (pixval * kmul[nr]) + kadd[nr] + break + } + } +end |