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/ahiv.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/vops/ahiv.gx')
-rw-r--r-- | sys/vops/ahiv.gx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/vops/ahiv.gx b/sys/vops/ahiv.gx new file mode 100644 index 00000000..ba6d487a --- /dev/null +++ b/sys/vops/ahiv.gx @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +PIXEL procedure ahiv$t (a, npix) + +PIXEL a[ARB] +int npix +PIXEL high, pixval +$if (datatype == x) +real abs_high +$endif +int i + +begin + high = a[1] + $if (datatype == x) + abs_high = abs (high) + $endif + + do i = 1, npix { + pixval = a[i] + $if (datatype == x) + if (abs (pixval) > abs_high) { + high = pixval + abs_high = abs (high) + } + $else + if (pixval > high) + high = pixval + $endif + } + + return (high) +end |