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/amed3.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/vops/amed3.gx')
-rw-r--r-- | sys/vops/amed3.gx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/vops/amed3.gx b/sys/vops/amed3.gx new file mode 100644 index 00000000..37452cb5 --- /dev/null +++ b/sys/vops/amed3.gx @@ -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 amed3$t (a, b, c, m, npix) + +PIXEL a[ARB], b[ARB], c[ARB] # input vectors +PIXEL 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 |