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/lz/amed3i.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/vops/lz/amed3i.x')
-rw-r--r-- | sys/vops/lz/amed3i.x | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/vops/lz/amed3i.x b/sys/vops/lz/amed3i.x new file mode 100644 index 00000000..2be5fb15 --- /dev/null +++ b/sys/vops/lz/amed3i.x @@ -0,0 +1,30 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AMED3 -- Median of three vectors. Each output point M[i] is the median value +# of the three input points A[i],B[i],C[i]. + +procedure amed3i (a, b, c, m, npix) + +int a[ARB], b[ARB], c[ARB] # input vectors +int m[ARB] # output vector (median) +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) { + if (b[i] < c[i]) # abc + m[i] = b[i] + else if (a[i] < c[i]) # acb + m[i] = c[i] + else # cab + m[i] = a[i] + } else { + if (b[i] > c[i]) # cba + m[i] = b[i] + else if (a[i] > c[i]) # bca + m[i] = c[i] + else # bac + m[i] = a[i] + } +end |