diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/vops/ak | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/vops/ak')
268 files changed, 6398 insertions, 0 deletions
diff --git a/sys/vops/ak/aabsd.x b/sys/vops/ak/aabsd.x new file mode 100644 index 00000000..d9a85b4a --- /dev/null +++ b/sys/vops/ak/aabsd.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabsd (a, b, npix) + +double a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aabsi.x b/sys/vops/ak/aabsi.x new file mode 100644 index 00000000..b1c677aa --- /dev/null +++ b/sys/vops/ak/aabsi.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabsi (a, b, npix) + +int a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aabsl.x b/sys/vops/ak/aabsl.x new file mode 100644 index 00000000..27543118 --- /dev/null +++ b/sys/vops/ak/aabsl.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabsl (a, b, npix) + +long a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aabsr.x b/sys/vops/ak/aabsr.x new file mode 100644 index 00000000..824e77d5 --- /dev/null +++ b/sys/vops/ak/aabsr.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabsr (a, b, npix) + +real a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aabss.x b/sys/vops/ak/aabss.x new file mode 100644 index 00000000..2084a7cc --- /dev/null +++ b/sys/vops/ak/aabss.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabss (a, b, npix) + +short a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aabsx.x b/sys/vops/ak/aabsx.x new file mode 100644 index 00000000..287e22cf --- /dev/null +++ b/sys/vops/ak/aabsx.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AABS -- Compute the absolute value of a vector (generic). + +procedure aabsx (a, b, npix) + +complex a[ARB], b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = abs(a[i]) +end diff --git a/sys/vops/ak/aaddd.x b/sys/vops/ak/aaddd.x new file mode 100644 index 00000000..50716bbc --- /dev/null +++ b/sys/vops/ak/aaddd.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aaddd (a, b, c, npix) + +double a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aaddi.x b/sys/vops/ak/aaddi.x new file mode 100644 index 00000000..cfaf200c --- /dev/null +++ b/sys/vops/ak/aaddi.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aaddi (a, b, c, npix) + +int a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aaddkd.x b/sys/vops/ak/aaddkd.x new file mode 100644 index 00000000..e98dfb57 --- /dev/null +++ b/sys/vops/ak/aaddkd.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddkd (a, b, c, npix) + +double a[ARB] +double b +double c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddki.x b/sys/vops/ak/aaddki.x new file mode 100644 index 00000000..f71b5654 --- /dev/null +++ b/sys/vops/ak/aaddki.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddkl.x b/sys/vops/ak/aaddkl.x new file mode 100644 index 00000000..9d16f93d --- /dev/null +++ b/sys/vops/ak/aaddkl.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddkl (a, b, c, npix) + +long a[ARB] +long b +long c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddkr.x b/sys/vops/ak/aaddkr.x new file mode 100644 index 00000000..07b92d8e --- /dev/null +++ b/sys/vops/ak/aaddkr.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddkr (a, b, c, npix) + +real a[ARB] +real b +real c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddks.x b/sys/vops/ak/aaddks.x new file mode 100644 index 00000000..d8256585 --- /dev/null +++ b/sys/vops/ak/aaddks.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddks (a, b, c, npix) + +short a[ARB] +short b +short c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddkx.x b/sys/vops/ak/aaddkx.x new file mode 100644 index 00000000..ea47e214 --- /dev/null +++ b/sys/vops/ak/aaddkx.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADDK -- Add a constant to a vector (generic). + +procedure aaddkx (a, b, c, npix) + +complex a[ARB] +complex b +complex c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b +end diff --git a/sys/vops/ak/aaddl.x b/sys/vops/ak/aaddl.x new file mode 100644 index 00000000..3684265f --- /dev/null +++ b/sys/vops/ak/aaddl.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aaddl (a, b, c, npix) + +long a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aaddr.x b/sys/vops/ak/aaddr.x new file mode 100644 index 00000000..ba35b513 --- /dev/null +++ b/sys/vops/ak/aaddr.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aaddr (a, b, c, npix) + +real a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aadds.x b/sys/vops/ak/aadds.x new file mode 100644 index 00000000..bd53ed59 --- /dev/null +++ b/sys/vops/ak/aadds.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aadds (a, b, c, npix) + +short a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aaddx.x b/sys/vops/ak/aaddx.x new file mode 100644 index 00000000..23239203 --- /dev/null +++ b/sys/vops/ak/aaddx.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AADD -- Add two vectors (generic). + +procedure aaddx (a, b, c, npix) + +complex a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] + b[i] +end diff --git a/sys/vops/ak/aandi.x b/sys/vops/ak/aandi.x new file mode 100644 index 00000000..86d6aadc --- /dev/null +++ b/sys/vops/ak/aandi.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAND -- Compute the bitwise boolean 'and' of two vectors (generic). + +procedure aandi (a, b, c, npix) + +int a[ARB], b[ARB], c[ARB] +int npix, i +int and() + +begin + do i = 1, npix { + c[i] = and (a[i], b[i]) + } +end diff --git a/sys/vops/ak/aandki.x b/sys/vops/ak/aandki.x new file mode 100644 index 00000000..792b491e --- /dev/null +++ b/sys/vops/ak/aandki.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AANDK -- Compute the bitwise boolean 'and' of a vector and a constant +# (generic) + +procedure aandki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix, i +int and() + +begin + do i = 1, npix { + c[i] = and (a[i], b) + } +end diff --git a/sys/vops/ak/aandkl.x b/sys/vops/ak/aandkl.x new file mode 100644 index 00000000..c178aa21 --- /dev/null +++ b/sys/vops/ak/aandkl.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AANDK -- Compute the bitwise boolean 'and' of a vector and a constant +# (generic) + +procedure aandkl (a, b, c, npix) + +long a[ARB] +long b +long c[ARB] +int npix, i +long andl() + +begin + do i = 1, npix { + c[i] = andl (a[i], b) + } +end diff --git a/sys/vops/ak/aandks.x b/sys/vops/ak/aandks.x new file mode 100644 index 00000000..03a64dcb --- /dev/null +++ b/sys/vops/ak/aandks.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AANDK -- Compute the bitwise boolean 'and' of a vector and a constant +# (generic) + +procedure aandks (a, b, c, npix) + +short a[ARB] +short b +short c[ARB] +int npix, i +short ands() + +begin + do i = 1, npix { + c[i] = ands (a[i], b) + } +end diff --git a/sys/vops/ak/aandl.x b/sys/vops/ak/aandl.x new file mode 100644 index 00000000..95990efc --- /dev/null +++ b/sys/vops/ak/aandl.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAND -- Compute the bitwise boolean 'and' of two vectors (generic). + +procedure aandl (a, b, c, npix) + +long a[ARB], b[ARB], c[ARB] +int npix, i +long andl() + +begin + do i = 1, npix { + c[i] = andl (a[i], b[i]) + } +end diff --git a/sys/vops/ak/aands.x b/sys/vops/ak/aands.x new file mode 100644 index 00000000..fe174b83 --- /dev/null +++ b/sys/vops/ak/aands.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAND -- Compute the bitwise boolean 'and' of two vectors (generic). + +procedure aands (a, b, c, npix) + +short a[ARB], b[ARB], c[ARB] +int npix, i +short ands() + +begin + do i = 1, npix { + c[i] = ands (a[i], b[i]) + } +end diff --git a/sys/vops/ak/aavgd.x b/sys/vops/ak/aavgd.x new file mode 100644 index 00000000..04c68bf2 --- /dev/null +++ b/sys/vops/ak/aavgd.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgd (a, npix, mean, sigma) + +double a[ARB] +int npix +double mean, sigma, lcut, hcut +int junk, awvgd() +data lcut /0./, hcut /0./ + +begin + junk = awvgd (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/aavgi.x b/sys/vops/ak/aavgi.x new file mode 100644 index 00000000..45c8a64e --- /dev/null +++ b/sys/vops/ak/aavgi.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgi (a, npix, mean, sigma) + +int a[ARB] +int npix +real mean, sigma, lcut, hcut +int junk, awvgi() +data lcut /0./, hcut /0./ + +begin + junk = awvgi (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/aavgl.x b/sys/vops/ak/aavgl.x new file mode 100644 index 00000000..3c015246 --- /dev/null +++ b/sys/vops/ak/aavgl.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgl (a, npix, mean, sigma) + +long a[ARB] +int npix +double mean, sigma, lcut, hcut +int junk, awvgl() +data lcut /0./, hcut /0./ + +begin + junk = awvgl (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/aavgr.x b/sys/vops/ak/aavgr.x new file mode 100644 index 00000000..c4aaa051 --- /dev/null +++ b/sys/vops/ak/aavgr.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgr (a, npix, mean, sigma) + +real a[ARB] +int npix +real mean, sigma, lcut, hcut +int junk, awvgr() +data lcut /0./, hcut /0./ + +begin + junk = awvgr (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/aavgs.x b/sys/vops/ak/aavgs.x new file mode 100644 index 00000000..2793e2e8 --- /dev/null +++ b/sys/vops/ak/aavgs.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgs (a, npix, mean, sigma) + +short a[ARB] +int npix +real mean, sigma, lcut, hcut +int junk, awvgs() +data lcut /0./, hcut /0./ + +begin + junk = awvgs (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/aavgx.x b/sys/vops/ak/aavgx.x new file mode 100644 index 00000000..07949efc --- /dev/null +++ b/sys/vops/ak/aavgx.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AAVG -- Compute the mean and standard deviation (sigma) of a sample. +# All pixels are used. + +procedure aavgx (a, npix, mean, sigma) + +complex a[ARB] +int npix +real mean, sigma, lcut, hcut +int junk, awvgx() +data lcut /0./, hcut /0./ + +begin + junk = awvgx (a, npix, mean, sigma, lcut, hcut) +end diff --git a/sys/vops/ak/abavd.x b/sys/vops/ak/abavd.x new file mode 100644 index 00000000..0e76e230 --- /dev/null +++ b/sys/vops/ak/abavd.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavd (a, b, nblocks, npix_per_block) + +double a[ARB] # input vector +double b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +double sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = block_length + + if (block_length <= 1) + call amovd (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abavi.x b/sys/vops/ak/abavi.x new file mode 100644 index 00000000..9ca5b267 --- /dev/null +++ b/sys/vops/ak/abavi.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavi (a, b, nblocks, npix_per_block) + +int a[ARB] # input vector +int b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = block_length + + if (block_length <= 1) + call amovi (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abavl.x b/sys/vops/ak/abavl.x new file mode 100644 index 00000000..29332022 --- /dev/null +++ b/sys/vops/ak/abavl.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavl (a, b, nblocks, npix_per_block) + +long a[ARB] # input vector +long b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = block_length + + if (block_length <= 1) + call amovl (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abavr.x b/sys/vops/ak/abavr.x new file mode 100644 index 00000000..3e442d8e --- /dev/null +++ b/sys/vops/ak/abavr.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavr (a, b, nblocks, npix_per_block) + +real a[ARB] # input vector +real b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = block_length + + if (block_length <= 1) + call amovr (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abavs.x b/sys/vops/ak/abavs.x new file mode 100644 index 00000000..f3e42dc4 --- /dev/null +++ b/sys/vops/ak/abavs.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavs (a, b, nblocks, npix_per_block) + +short a[ARB] # input vector +short b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +long sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = block_length + + if (block_length <= 1) + call amovs (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abavx.x b/sys/vops/ak/abavx.x new file mode 100644 index 00000000..7b33c2a3 --- /dev/null +++ b/sys/vops/ak/abavx.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABAV -- Vector block average. Each pixel in the output vector is the +# average of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure abavx (a, b, nblocks, npix_per_block) + +complex a[ARB] # input vector +complex b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +complex sum, width + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + width = complex (block_length, block_length) + + if (block_length <= 1) + call amovx (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum / width + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/abeqc.x b/sys/vops/ak/abeqc.x new file mode 100644 index 00000000..cbd97363 --- /dev/null +++ b/sys/vops/ak/abeqc.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqc (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqd.x b/sys/vops/ak/abeqd.x new file mode 100644 index 00000000..d71d2ad8 --- /dev/null +++ b/sys/vops/ak/abeqd.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqd (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqi.x b/sys/vops/ak/abeqi.x new file mode 100644 index 00000000..a70fad30 --- /dev/null +++ b/sys/vops/ak/abeqi.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqi (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqkc.x b/sys/vops/ak/abeqkc.x new file mode 100644 index 00000000..10757e50 --- /dev/null +++ b/sys/vops/ak/abeqkc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqkc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] == 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqkd.x b/sys/vops/ak/abeqkd.x new file mode 100644 index 00000000..f4b0950a --- /dev/null +++ b/sys/vops/ak/abeqkd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqkd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] == 0.0D0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqki.x b/sys/vops/ak/abeqki.x new file mode 100644 index 00000000..c0a8d33c --- /dev/null +++ b/sys/vops/ak/abeqki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] == 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqkl.x b/sys/vops/ak/abeqkl.x new file mode 100644 index 00000000..35491d1e --- /dev/null +++ b/sys/vops/ak/abeqkl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqkl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] == 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqkr.x b/sys/vops/ak/abeqkr.x new file mode 100644 index 00000000..5f6625ab --- /dev/null +++ b/sys/vops/ak/abeqkr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqkr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] == 0.0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqks.x b/sys/vops/ak/abeqks.x new file mode 100644 index 00000000..f699cdf6 --- /dev/null +++ b/sys/vops/ak/abeqks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] == 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeqkx.x b/sys/vops/ak/abeqkx.x new file mode 100644 index 00000000..c2767408 --- /dev/null +++ b/sys/vops/ak/abeqkx.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQK -- Vector boolean equals constant. C[i], type INT, is set to 1 if +# A[i] equals B, else C[i] is set to zero. + +procedure abeqkx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + do i = 1, npix + if (a[i] == (0.0,0.0)) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] == b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abeql.x b/sys/vops/ak/abeql.x new file mode 100644 index 00000000..36d1d195 --- /dev/null +++ b/sys/vops/ak/abeql.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeql (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqr.x b/sys/vops/ak/abeqr.x new file mode 100644 index 00000000..263246b8 --- /dev/null +++ b/sys/vops/ak/abeqr.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqr (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqs.x b/sys/vops/ak/abeqs.x new file mode 100644 index 00000000..d133181b --- /dev/null +++ b/sys/vops/ak/abeqs.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqs (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abeqx.x b/sys/vops/ak/abeqx.x new file mode 100644 index 00000000..858142fb --- /dev/null +++ b/sys/vops/ak/abeqx.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABEQ -- Vector boolean equals. C[i], type INT, is set to 1 if A[i] equals +# B[i], else C[i] is set to zero. + +procedure abeqx (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] == b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgec.x b/sys/vops/ak/abgec.x new file mode 100644 index 00000000..5f1f03af --- /dev/null +++ b/sys/vops/ak/abgec.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgec (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abged.x b/sys/vops/ak/abged.x new file mode 100644 index 00000000..36565fd6 --- /dev/null +++ b/sys/vops/ak/abged.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abged (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgei.x b/sys/vops/ak/abgei.x new file mode 100644 index 00000000..76b9aca1 --- /dev/null +++ b/sys/vops/ak/abgei.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgei (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgekc.x b/sys/vops/ak/abgekc.x new file mode 100644 index 00000000..dcb495e6 --- /dev/null +++ b/sys/vops/ak/abgekc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgekc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgekd.x b/sys/vops/ak/abgekd.x new file mode 100644 index 00000000..4443230e --- /dev/null +++ b/sys/vops/ak/abgekd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgekd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgeki.x b/sys/vops/ak/abgeki.x new file mode 100644 index 00000000..d819f2e9 --- /dev/null +++ b/sys/vops/ak/abgeki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgeki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgekl.x b/sys/vops/ak/abgekl.x new file mode 100644 index 00000000..f599ffff --- /dev/null +++ b/sys/vops/ak/abgekl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgekl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgekr.x b/sys/vops/ak/abgekr.x new file mode 100644 index 00000000..35141e4c --- /dev/null +++ b/sys/vops/ak/abgekr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgekr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgeks.x b/sys/vops/ak/abgeks.x new file mode 100644 index 00000000..04486504 --- /dev/null +++ b/sys/vops/ak/abgeks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgeks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] >= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] >= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgekx.x b/sys/vops/ak/abgekx.x new file mode 100644 index 00000000..f8f43b77 --- /dev/null +++ b/sys/vops/ak/abgekx.x @@ -0,0 +1,29 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGEK -- Vector boolean greater than or equals constant. C[i], type INT, +# is set to 1 if A[i] is greater than or equal to B, else C[i] is set to zero. + +procedure abgekx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i +real abs_b + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + call amovki (1, c, npix) + } else { + abs_b = abs (b) + do i = 1, npix + if (abs (a[i]) >= abs_b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgel.x b/sys/vops/ak/abgel.x new file mode 100644 index 00000000..385082d7 --- /dev/null +++ b/sys/vops/ak/abgel.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgel (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abger.x b/sys/vops/ak/abger.x new file mode 100644 index 00000000..f13f1065 --- /dev/null +++ b/sys/vops/ak/abger.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abger (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abges.x b/sys/vops/ak/abges.x new file mode 100644 index 00000000..c0bed06c --- /dev/null +++ b/sys/vops/ak/abges.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abges (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] >= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgex.x b/sys/vops/ak/abgex.x new file mode 100644 index 00000000..bf8affff --- /dev/null +++ b/sys/vops/ak/abgex.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGE -- Vector boolean greater than or equals. C[i], type INT, is set to 1 +# if A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgex (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (abs (a[i]) >= abs (b[i])) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgtc.x b/sys/vops/ak/abgtc.x new file mode 100644 index 00000000..85eb410e --- /dev/null +++ b/sys/vops/ak/abgtc.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgtc (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgtd.x b/sys/vops/ak/abgtd.x new file mode 100644 index 00000000..7a5b668d --- /dev/null +++ b/sys/vops/ak/abgtd.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgtd (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgti.x b/sys/vops/ak/abgti.x new file mode 100644 index 00000000..356e66e9 --- /dev/null +++ b/sys/vops/ak/abgti.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgti (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgtkc.x b/sys/vops/ak/abgtkc.x new file mode 100644 index 00000000..425db27b --- /dev/null +++ b/sys/vops/ak/abgtkc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtkc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtkd.x b/sys/vops/ak/abgtkd.x new file mode 100644 index 00000000..239caf24 --- /dev/null +++ b/sys/vops/ak/abgtkd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtkd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtki.x b/sys/vops/ak/abgtki.x new file mode 100644 index 00000000..17d67d74 --- /dev/null +++ b/sys/vops/ak/abgtki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtkl.x b/sys/vops/ak/abgtkl.x new file mode 100644 index 00000000..1ee43a43 --- /dev/null +++ b/sys/vops/ak/abgtkl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtkl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtkr.x b/sys/vops/ak/abgtkr.x new file mode 100644 index 00000000..11673299 --- /dev/null +++ b/sys/vops/ak/abgtkr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtkr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtks.x b/sys/vops/ak/abgtks.x new file mode 100644 index 00000000..2c27023a --- /dev/null +++ b/sys/vops/ak/abgtks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] > 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] > b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtkx.x b/sys/vops/ak/abgtkx.x new file mode 100644 index 00000000..f7b2a992 --- /dev/null +++ b/sys/vops/ak/abgtkx.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGTK -- Vector boolean greater than constant. C[i], type INT, is set to 1 +# if A[i] is greater than B, else C[i] is set to zero. + +procedure abgtkx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i +real abs_b + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + do i = 1, npix + if (abs (a[i]) > 0) + c[i] = 1 + else + c[i] = 0 + } else { + abs_b = abs (b) + do i = 1, npix + if (abs (a[i]) > abs_b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abgtl.x b/sys/vops/ak/abgtl.x new file mode 100644 index 00000000..3b5304b9 --- /dev/null +++ b/sys/vops/ak/abgtl.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgtl (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgtr.x b/sys/vops/ak/abgtr.x new file mode 100644 index 00000000..4d900166 --- /dev/null +++ b/sys/vops/ak/abgtr.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgtr (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgts.x b/sys/vops/ak/abgts.x new file mode 100644 index 00000000..8bb92613 --- /dev/null +++ b/sys/vops/ak/abgts.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgts (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] > b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abgtx.x b/sys/vops/ak/abgtx.x new file mode 100644 index 00000000..c82aef59 --- /dev/null +++ b/sys/vops/ak/abgtx.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABGT -- Vector boolean greater than. C[i], type INT, is set to 1 if +# A[i] is greater than B[i], else C[i] is set to zero. + +procedure abgtx (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (abs (a[i]) > abs (b[i])) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablec.x b/sys/vops/ak/ablec.x new file mode 100644 index 00000000..76806def --- /dev/null +++ b/sys/vops/ak/ablec.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure ablec (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abled.x b/sys/vops/ak/abled.x new file mode 100644 index 00000000..e1288c98 --- /dev/null +++ b/sys/vops/ak/abled.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure abled (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablei.x b/sys/vops/ak/ablei.x new file mode 100644 index 00000000..d69d184f --- /dev/null +++ b/sys/vops/ak/ablei.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure ablei (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablekc.x b/sys/vops/ak/ablekc.x new file mode 100644 index 00000000..5a9f776f --- /dev/null +++ b/sys/vops/ak/ablekc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ablekc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ablekd.x b/sys/vops/ak/ablekd.x new file mode 100644 index 00000000..f18548da --- /dev/null +++ b/sys/vops/ak/ablekd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ablekd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ableki.x b/sys/vops/ak/ableki.x new file mode 100644 index 00000000..4ee983f7 --- /dev/null +++ b/sys/vops/ak/ableki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ableki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ablekl.x b/sys/vops/ak/ablekl.x new file mode 100644 index 00000000..5e480c5b --- /dev/null +++ b/sys/vops/ak/ablekl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ablekl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ablekr.x b/sys/vops/ak/ablekr.x new file mode 100644 index 00000000..3e61beae --- /dev/null +++ b/sys/vops/ak/ablekr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ablekr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ableks.x b/sys/vops/ak/ableks.x new file mode 100644 index 00000000..b8e855da --- /dev/null +++ b/sys/vops/ak/ableks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ableks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] <= 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] <= b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ablekx.x b/sys/vops/ak/ablekx.x new file mode 100644 index 00000000..f29abb93 --- /dev/null +++ b/sys/vops/ak/ablekx.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLEK -- Vector boolean less than or equals constant. C[i], type INT, +# is set to 1 if A[i] is less than or equal to B, else C[i] is set to zero. + +procedure ablekx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i +real abs_b + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + do i = 1, npix + if (abs (a[i]) == 0) + c[i] = 1 + else + c[i] = 0 + } else { + abs_b = abs (b) + do i = 1, npix + if (abs (a[i]) <= abs_b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/ablel.x b/sys/vops/ak/ablel.x new file mode 100644 index 00000000..b218784b --- /dev/null +++ b/sys/vops/ak/ablel.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure ablel (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abler.x b/sys/vops/ak/abler.x new file mode 100644 index 00000000..88121ab3 --- /dev/null +++ b/sys/vops/ak/abler.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure abler (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ables.x b/sys/vops/ak/ables.x new file mode 100644 index 00000000..3165c0eb --- /dev/null +++ b/sys/vops/ak/ables.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure ables (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] <= b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablex.x b/sys/vops/ak/ablex.x new file mode 100644 index 00000000..98b68857 --- /dev/null +++ b/sys/vops/ak/ablex.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLE -- Vector boolean less than or equals. C[i], type INT, is set to 1 if +# A[i] is less than or equal to B[i], else C[i] is set to zero. + +procedure ablex (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (abs (a[i]) <= abs (b[i])) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abltc.x b/sys/vops/ak/abltc.x new file mode 100644 index 00000000..46c4c86c --- /dev/null +++ b/sys/vops/ak/abltc.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure abltc (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abltd.x b/sys/vops/ak/abltd.x new file mode 100644 index 00000000..9b392c1f --- /dev/null +++ b/sys/vops/ak/abltd.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure abltd (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablti.x b/sys/vops/ak/ablti.x new file mode 100644 index 00000000..b567b589 --- /dev/null +++ b/sys/vops/ak/ablti.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure ablti (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abltkc.x b/sys/vops/ak/abltkc.x new file mode 100644 index 00000000..6917a40b --- /dev/null +++ b/sys/vops/ak/abltkc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltkc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltkd.x b/sys/vops/ak/abltkd.x new file mode 100644 index 00000000..354c9bfb --- /dev/null +++ b/sys/vops/ak/abltkd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltkd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltki.x b/sys/vops/ak/abltki.x new file mode 100644 index 00000000..f20f6455 --- /dev/null +++ b/sys/vops/ak/abltki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltkl.x b/sys/vops/ak/abltkl.x new file mode 100644 index 00000000..dc02c284 --- /dev/null +++ b/sys/vops/ak/abltkl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltkl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltkr.x b/sys/vops/ak/abltkr.x new file mode 100644 index 00000000..02531a40 --- /dev/null +++ b/sys/vops/ak/abltkr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltkr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltks.x b/sys/vops/ak/abltks.x new file mode 100644 index 00000000..3cdb07c5 --- /dev/null +++ b/sys/vops/ak/abltks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] < 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] < b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltkx.x b/sys/vops/ak/abltkx.x new file mode 100644 index 00000000..04527b7f --- /dev/null +++ b/sys/vops/ak/abltkx.x @@ -0,0 +1,29 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLTK -- Vector boolean less than constant. C[i], type INT, is set to 1 if +# A[i] is less than B, else C[i] is set to zero. + +procedure abltkx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i +real abs_b + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + call aclri (c, npix) + } else { + abs_b = abs (b) + do i = 1, npix + if (abs (a[i]) < abs_b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abltl.x b/sys/vops/ak/abltl.x new file mode 100644 index 00000000..526a8ba3 --- /dev/null +++ b/sys/vops/ak/abltl.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure abltl (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abltr.x b/sys/vops/ak/abltr.x new file mode 100644 index 00000000..bdaf39eb --- /dev/null +++ b/sys/vops/ak/abltr.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure abltr (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/ablts.x b/sys/vops/ak/ablts.x new file mode 100644 index 00000000..a0a9bded --- /dev/null +++ b/sys/vops/ak/ablts.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure ablts (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] < b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abltx.x b/sys/vops/ak/abltx.x new file mode 100644 index 00000000..354238b3 --- /dev/null +++ b/sys/vops/ak/abltx.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABLT -- Vector boolean less than. C[i], type INT, is set to 1 if +# A[i] is less than B[i], else C[i] is set to zero. + +procedure abltx (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (abs (a[i]) < abs (b[i])) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abnec.x b/sys/vops/ak/abnec.x new file mode 100644 index 00000000..7634ce5d --- /dev/null +++ b/sys/vops/ak/abnec.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abnec (a, b, c, npix) + +char a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abned.x b/sys/vops/ak/abned.x new file mode 100644 index 00000000..74da7d12 --- /dev/null +++ b/sys/vops/ak/abned.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abned (a, b, c, npix) + +double a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abnei.x b/sys/vops/ak/abnei.x new file mode 100644 index 00000000..57ce41c1 --- /dev/null +++ b/sys/vops/ak/abnei.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abnei (a, b, c, npix) + +int a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abnekc.x b/sys/vops/ak/abnekc.x new file mode 100644 index 00000000..082d2ac9 --- /dev/null +++ b/sys/vops/ak/abnekc.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abnekc (a, b, c, npix) + +char a[ARB] +char b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] != 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abnekd.x b/sys/vops/ak/abnekd.x new file mode 100644 index 00000000..7f95e855 --- /dev/null +++ b/sys/vops/ak/abnekd.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abnekd (a, b, c, npix) + +double a[ARB] +double b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0D0) { + do i = 1, npix + if (a[i] != 0.0D0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abneki.x b/sys/vops/ak/abneki.x new file mode 100644 index 00000000..c8e497c8 --- /dev/null +++ b/sys/vops/ak/abneki.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abneki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] != 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abnekl.x b/sys/vops/ak/abnekl.x new file mode 100644 index 00000000..4e8537c2 --- /dev/null +++ b/sys/vops/ak/abnekl.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abnekl (a, b, c, npix) + +long a[ARB] +long b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] != 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abnekr.x b/sys/vops/ak/abnekr.x new file mode 100644 index 00000000..effd0fc7 --- /dev/null +++ b/sys/vops/ak/abnekr.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abnekr (a, b, c, npix) + +real a[ARB] +real b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0.0) { + do i = 1, npix + if (a[i] != 0.0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abneks.x b/sys/vops/ak/abneks.x new file mode 100644 index 00000000..e587ed1f --- /dev/null +++ b/sys/vops/ak/abneks.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abneks (a, b, c, npix) + +short a[ARB] +short b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == 0) { + do i = 1, npix + if (a[i] != 0) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abnekx.x b/sys/vops/ak/abnekx.x new file mode 100644 index 00000000..8ddaca07 --- /dev/null +++ b/sys/vops/ak/abnekx.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNEK -- Vector boolean not equals constant. C[i], type INT, is set to 1 if +# A[i] is not equal to B, else C[i] is set to zero. + +procedure abnekx (a, b, c, npix) + +complex a[ARB] +complex b +int c[ARB] +int npix +int i + +begin + # The case b==0 is perhaps worth optimizing. On many machines this + # will save a memory fetch. + + if (b == (0.0,0.0)) { + do i = 1, npix + if (a[i] != (0.0,0.0)) + c[i] = 1 + else + c[i] = 0 + } else { + do i = 1, npix + if (a[i] != b) + c[i] = 1 + else + c[i] = 0 + } +end diff --git a/sys/vops/ak/abnel.x b/sys/vops/ak/abnel.x new file mode 100644 index 00000000..3f57b4cb --- /dev/null +++ b/sys/vops/ak/abnel.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abnel (a, b, c, npix) + +long a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abner.x b/sys/vops/ak/abner.x new file mode 100644 index 00000000..a5409272 --- /dev/null +++ b/sys/vops/ak/abner.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abner (a, b, c, npix) + +real a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abnes.x b/sys/vops/ak/abnes.x new file mode 100644 index 00000000..75c23939 --- /dev/null +++ b/sys/vops/ak/abnes.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abnes (a, b, c, npix) + +short a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abnex.x b/sys/vops/ak/abnex.x new file mode 100644 index 00000000..bc914339 --- /dev/null +++ b/sys/vops/ak/abnex.x @@ -0,0 +1,19 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABNE -- Vector boolean not equals. C[i], type INT, is set to 1 if +# A[i] is not equal to B[i], else C[i] is set to zero. + +procedure abnex (a, b, c, npix) + +complex a[ARB], b[ARB] +int c[ARB] +int npix +int i + +begin + do i = 1, npix + if (a[i] != b[i]) + c[i] = 1 + else + c[i] = 0 +end diff --git a/sys/vops/ak/abori.x b/sys/vops/ak/abori.x new file mode 100644 index 00000000..e0ecf2fc --- /dev/null +++ b/sys/vops/ak/abori.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABOR -- Compute the bitwise boolean 'or' of two vectors (generic). + +procedure abori (a, b, c, npix) + +int a[ARB], b[ARB], c[ARB] +int npix, i +int or() + +begin + do i = 1, npix { + c[i] = or (a[i], b[i]) + } +end diff --git a/sys/vops/ak/aborki.x b/sys/vops/ak/aborki.x new file mode 100644 index 00000000..760debcc --- /dev/null +++ b/sys/vops/ak/aborki.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABORK -- Compute the bitwise boolean or of a vector and a constant +# (generic). + +procedure aborki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix, i +int or() + +begin + do i = 1, npix { + c[i] = or (a[i], b) + } +end diff --git a/sys/vops/ak/aborkl.x b/sys/vops/ak/aborkl.x new file mode 100644 index 00000000..262c113e --- /dev/null +++ b/sys/vops/ak/aborkl.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABORK -- Compute the bitwise boolean or of a vector and a constant +# (generic). + +procedure aborkl (a, b, c, npix) + +long a[ARB] +long b +long c[ARB] +int npix, i +long orl() + +begin + do i = 1, npix { + c[i] = orl (a[i], b) + } +end diff --git a/sys/vops/ak/aborks.x b/sys/vops/ak/aborks.x new file mode 100644 index 00000000..a8de717a --- /dev/null +++ b/sys/vops/ak/aborks.x @@ -0,0 +1,18 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABORK -- Compute the bitwise boolean or of a vector and a constant +# (generic). + +procedure aborks (a, b, c, npix) + +short a[ARB] +short b +short c[ARB] +int npix, i +short ors() + +begin + do i = 1, npix { + c[i] = ors (a[i], b) + } +end diff --git a/sys/vops/ak/aborl.x b/sys/vops/ak/aborl.x new file mode 100644 index 00000000..995b3c3b --- /dev/null +++ b/sys/vops/ak/aborl.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABOR -- Compute the bitwise boolean 'or' of two vectors (generic). + +procedure aborl (a, b, c, npix) + +long a[ARB], b[ARB], c[ARB] +int npix, i +long orl() + +begin + do i = 1, npix { + c[i] = orl (a[i], b[i]) + } +end diff --git a/sys/vops/ak/abors.x b/sys/vops/ak/abors.x new file mode 100644 index 00000000..6ae42d4f --- /dev/null +++ b/sys/vops/ak/abors.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABOR -- Compute the bitwise boolean 'or' of two vectors (generic). + +procedure abors (a, b, c, npix) + +short a[ARB], b[ARB], c[ARB] +int npix, i +short ors() + +begin + do i = 1, npix { + c[i] = ors (a[i], b[i]) + } +end diff --git a/sys/vops/ak/absud.x b/sys/vops/ak/absud.x new file mode 100644 index 00000000..06a7ae90 --- /dev/null +++ b/sys/vops/ak/absud.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABSU -- Vector block sum. Each pixel in the output vector is the +# sum of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure absud (a, b, nblocks, npix_per_block) + +double a[ARB] # input vector +double b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +double sum + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + + if (block_length <= 1) + call amovd (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/absui.x b/sys/vops/ak/absui.x new file mode 100644 index 00000000..ae785103 --- /dev/null +++ b/sys/vops/ak/absui.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABSU -- Vector block sum. Each pixel in the output vector is the +# sum of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure absui (a, b, nblocks, npix_per_block) + +int a[ARB] # input vector +int b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + + if (block_length <= 1) + call amovi (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/absul.x b/sys/vops/ak/absul.x new file mode 100644 index 00000000..ff803cc6 --- /dev/null +++ b/sys/vops/ak/absul.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABSU -- Vector block sum. Each pixel in the output vector is the +# sum of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure absul (a, b, nblocks, npix_per_block) + +long a[ARB] # input vector +long b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + + if (block_length <= 1) + call amovl (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/absur.x b/sys/vops/ak/absur.x new file mode 100644 index 00000000..8aaca446 --- /dev/null +++ b/sys/vops/ak/absur.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABSU -- Vector block sum. Each pixel in the output vector is the +# sum of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure absur (a, b, nblocks, npix_per_block) + +real a[ARB] # input vector +real b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +real sum + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + + if (block_length <= 1) + call amovr (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/absus.x b/sys/vops/ak/absus.x new file mode 100644 index 00000000..9161ed24 --- /dev/null +++ b/sys/vops/ak/absus.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ABSU -- Vector block sum. Each pixel in the output vector is the +# sum of the input vector over a block of pixels. The input vector must +# be at least (nblocks * npix_per_block) pixels in length. + +procedure absus (a, b, nblocks, npix_per_block) + +short a[ARB] # input vector +short b[nblocks] # output vector +int nblocks # number of blocks (pixels in output vector) +int npix_per_block # number of input pixels per block + +long sum + +int i, j +int block_offset, next_block, block_length + +begin + block_offset = 1 + block_length = npix_per_block + + if (block_length <= 1) + call amovs (a[block_offset], b, nblocks) + else { + do j = 1, nblocks { + next_block = block_offset + block_length + sum = 0 + do i = block_offset, next_block - 1 + sum = sum + a[i] + b[j] = sum + block_offset = next_block + } + } +end diff --git a/sys/vops/ak/achtcc.x b/sys/vops/ak/achtcc.x new file mode 100644 index 00000000..b531ea80 --- /dev/null +++ b/sys/vops/ak/achtcc.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcc (a, b, npix) + +char a[ARB] +char b[ARB] +int npix + +begin + call amovc (a, b, npix) +end diff --git a/sys/vops/ak/achtcd.x b/sys/vops/ak/achtcd.x new file mode 100644 index 00000000..6b0ea760 --- /dev/null +++ b/sys/vops/ak/achtcd.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcd (a, b, npix) + +char a[ARB] +double b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtci.x b/sys/vops/ak/achtci.x new file mode 100644 index 00000000..3aef94ee --- /dev/null +++ b/sys/vops/ak/achtci.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtci (a, b, npix) + +char a[ARB] +int b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtcl.x b/sys/vops/ak/achtcl.x new file mode 100644 index 00000000..8b01968d --- /dev/null +++ b/sys/vops/ak/achtcl.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcl (a, b, npix) + +char a[ARB] +long b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtcr.x b/sys/vops/ak/achtcr.x new file mode 100644 index 00000000..d95534a8 --- /dev/null +++ b/sys/vops/ak/achtcr.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcr (a, b, npix) + +char a[ARB] +real b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtcs.x b/sys/vops/ak/achtcs.x new file mode 100644 index 00000000..35e5266d --- /dev/null +++ b/sys/vops/ak/achtcs.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcs (a, b, npix) + +char a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtcx.x b/sys/vops/ak/achtcx.x new file mode 100644 index 00000000..1c8e1dc6 --- /dev/null +++ b/sys/vops/ak/achtcx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtcx (a, b, npix) + +char a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtdc.x b/sys/vops/ak/achtdc.x new file mode 100644 index 00000000..309ce09b --- /dev/null +++ b/sys/vops/ak/achtdc.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdc (a, b, npix) + +double a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtdd.x b/sys/vops/ak/achtdd.x new file mode 100644 index 00000000..76520e5a --- /dev/null +++ b/sys/vops/ak/achtdd.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdd (a, b, npix) + +double a[ARB] +double b[ARB] +int npix + +begin + call amovd (a, b, npix) +end diff --git a/sys/vops/ak/achtdi.x b/sys/vops/ak/achtdi.x new file mode 100644 index 00000000..7647c94f --- /dev/null +++ b/sys/vops/ak/achtdi.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdi (a, b, npix) + +double a[ARB] +int b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtdl.x b/sys/vops/ak/achtdl.x new file mode 100644 index 00000000..303d6e7c --- /dev/null +++ b/sys/vops/ak/achtdl.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdl (a, b, npix) + +double a[ARB] +long b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtdr.x b/sys/vops/ak/achtdr.x new file mode 100644 index 00000000..f047d66b --- /dev/null +++ b/sys/vops/ak/achtdr.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdr (a, b, npix) + +double a[ARB] +real b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtds.x b/sys/vops/ak/achtds.x new file mode 100644 index 00000000..08585d68 --- /dev/null +++ b/sys/vops/ak/achtds.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtds (a, b, npix) + +double a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtdx.x b/sys/vops/ak/achtdx.x new file mode 100644 index 00000000..0e253f4f --- /dev/null +++ b/sys/vops/ak/achtdx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtdx (a, b, npix) + +double a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtic.x b/sys/vops/ak/achtic.x new file mode 100644 index 00000000..17812f52 --- /dev/null +++ b/sys/vops/ak/achtic.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtic (a, b, npix) + +int a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtid.x b/sys/vops/ak/achtid.x new file mode 100644 index 00000000..d030ef99 --- /dev/null +++ b/sys/vops/ak/achtid.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtid (a, b, npix) + +int a[ARB] +double b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtii.x b/sys/vops/ak/achtii.x new file mode 100644 index 00000000..2bda8301 --- /dev/null +++ b/sys/vops/ak/achtii.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtii (a, b, npix) + +int a[ARB] +int b[ARB] +int npix + +begin + call amovi (a, b, npix) +end diff --git a/sys/vops/ak/achtil.x b/sys/vops/ak/achtil.x new file mode 100644 index 00000000..5397d121 --- /dev/null +++ b/sys/vops/ak/achtil.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtil (a, b, npix) + +int a[ARB] +long b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtir.x b/sys/vops/ak/achtir.x new file mode 100644 index 00000000..4e17ce9a --- /dev/null +++ b/sys/vops/ak/achtir.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtir (a, b, npix) + +int a[ARB] +real b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtis.x b/sys/vops/ak/achtis.x new file mode 100644 index 00000000..3f6df01c --- /dev/null +++ b/sys/vops/ak/achtis.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtis (a, b, npix) + +int a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtix.x b/sys/vops/ak/achtix.x new file mode 100644 index 00000000..7413c08a --- /dev/null +++ b/sys/vops/ak/achtix.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtix (a, b, npix) + +int a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtlc.x b/sys/vops/ak/achtlc.x new file mode 100644 index 00000000..67aded51 --- /dev/null +++ b/sys/vops/ak/achtlc.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtlc (a, b, npix) + +long a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtld.x b/sys/vops/ak/achtld.x new file mode 100644 index 00000000..a67a5a42 --- /dev/null +++ b/sys/vops/ak/achtld.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtld (a, b, npix) + +long a[ARB] +double b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtli.x b/sys/vops/ak/achtli.x new file mode 100644 index 00000000..0c06f8ba --- /dev/null +++ b/sys/vops/ak/achtli.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtli (a, b, npix) + +long a[ARB] +int b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtll.x b/sys/vops/ak/achtll.x new file mode 100644 index 00000000..ca9a5d05 --- /dev/null +++ b/sys/vops/ak/achtll.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtll (a, b, npix) + +long a[ARB] +long b[ARB] +int npix + +begin + call amovl (a, b, npix) +end diff --git a/sys/vops/ak/achtlr.x b/sys/vops/ak/achtlr.x new file mode 100644 index 00000000..a842c431 --- /dev/null +++ b/sys/vops/ak/achtlr.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtlr (a, b, npix) + +long a[ARB] +real b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtls.x b/sys/vops/ak/achtls.x new file mode 100644 index 00000000..8e71fc40 --- /dev/null +++ b/sys/vops/ak/achtls.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtls (a, b, npix) + +long a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtlx.x b/sys/vops/ak/achtlx.x new file mode 100644 index 00000000..ecfc2f68 --- /dev/null +++ b/sys/vops/ak/achtlx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtlx (a, b, npix) + +long a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtrc.x b/sys/vops/ak/achtrc.x new file mode 100644 index 00000000..0c16881a --- /dev/null +++ b/sys/vops/ak/achtrc.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrc (a, b, npix) + +real a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtrd.x b/sys/vops/ak/achtrd.x new file mode 100644 index 00000000..ef25741d --- /dev/null +++ b/sys/vops/ak/achtrd.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrd (a, b, npix) + +real a[ARB] +double b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtri.x b/sys/vops/ak/achtri.x new file mode 100644 index 00000000..38b137bf --- /dev/null +++ b/sys/vops/ak/achtri.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtri (a, b, npix) + +real a[ARB] +int b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtrl.x b/sys/vops/ak/achtrl.x new file mode 100644 index 00000000..fa30f59c --- /dev/null +++ b/sys/vops/ak/achtrl.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrl (a, b, npix) + +real a[ARB] +long b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtrr.x b/sys/vops/ak/achtrr.x new file mode 100644 index 00000000..9825cc95 --- /dev/null +++ b/sys/vops/ak/achtrr.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrr (a, b, npix) + +real a[ARB] +real b[ARB] +int npix + +begin + call amovr (a, b, npix) +end diff --git a/sys/vops/ak/achtrs.x b/sys/vops/ak/achtrs.x new file mode 100644 index 00000000..f3bcb1f9 --- /dev/null +++ b/sys/vops/ak/achtrs.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrs (a, b, npix) + +real a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtrx.x b/sys/vops/ak/achtrx.x new file mode 100644 index 00000000..047fdad5 --- /dev/null +++ b/sys/vops/ak/achtrx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtrx (a, b, npix) + +real a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtsc.x b/sys/vops/ak/achtsc.x new file mode 100644 index 00000000..b8a951bf --- /dev/null +++ b/sys/vops/ak/achtsc.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsc (a, b, npix) + +short a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtsd.x b/sys/vops/ak/achtsd.x new file mode 100644 index 00000000..a2b5d3af --- /dev/null +++ b/sys/vops/ak/achtsd.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsd (a, b, npix) + +short a[ARB] +double b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtsi.x b/sys/vops/ak/achtsi.x new file mode 100644 index 00000000..666530bf --- /dev/null +++ b/sys/vops/ak/achtsi.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsi (a, b, npix) + +short a[ARB] +int b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtsl.x b/sys/vops/ak/achtsl.x new file mode 100644 index 00000000..867e3f25 --- /dev/null +++ b/sys/vops/ak/achtsl.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsl (a, b, npix) + +short a[ARB] +long b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtsr.x b/sys/vops/ak/achtsr.x new file mode 100644 index 00000000..7f16c424 --- /dev/null +++ b/sys/vops/ak/achtsr.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsr (a, b, npix) + +short a[ARB] +real b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = a[i] +end diff --git a/sys/vops/ak/achtss.x b/sys/vops/ak/achtss.x new file mode 100644 index 00000000..2d8be27b --- /dev/null +++ b/sys/vops/ak/achtss.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtss (a, b, npix) + +short a[ARB] +short b[ARB] +int npix + +begin + call amovs (a, b, npix) +end diff --git a/sys/vops/ak/achtsx.x b/sys/vops/ak/achtsx.x new file mode 100644 index 00000000..f059d135 --- /dev/null +++ b/sys/vops/ak/achtsx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtsx (a, b, npix) + +short a[ARB] +complex b[ARB] +int npix +int i + +begin + do i = npix, 1, -1 + b[i] = complex(real(a[i]),0.0) +end diff --git a/sys/vops/ak/achtxc.x b/sys/vops/ak/achtxc.x new file mode 100644 index 00000000..06625215 --- /dev/null +++ b/sys/vops/ak/achtxc.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxc (a, b, npix) + +complex a[ARB] +char b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxd.x b/sys/vops/ak/achtxd.x new file mode 100644 index 00000000..3548ee23 --- /dev/null +++ b/sys/vops/ak/achtxd.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxd (a, b, npix) + +complex a[ARB] +double b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxi.x b/sys/vops/ak/achtxi.x new file mode 100644 index 00000000..403be396 --- /dev/null +++ b/sys/vops/ak/achtxi.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxi (a, b, npix) + +complex a[ARB] +int b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxl.x b/sys/vops/ak/achtxl.x new file mode 100644 index 00000000..eef669dd --- /dev/null +++ b/sys/vops/ak/achtxl.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxl (a, b, npix) + +complex a[ARB] +long b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxr.x b/sys/vops/ak/achtxr.x new file mode 100644 index 00000000..35352510 --- /dev/null +++ b/sys/vops/ak/achtxr.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxr (a, b, npix) + +complex a[ARB] +real b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxs.x b/sys/vops/ak/achtxs.x new file mode 100644 index 00000000..d4e36256 --- /dev/null +++ b/sys/vops/ak/achtxs.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxs (a, b, npix) + +complex a[ARB] +short b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = a[i] +end diff --git a/sys/vops/ak/achtxx.x b/sys/vops/ak/achtxx.x new file mode 100644 index 00000000..fe5072db --- /dev/null +++ b/sys/vops/ak/achtxx.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACHTxy -- Change datatype of vector from "x" to "y" (doubly generic). +# The operation is performed in such a way that the output vector can be +# the same as the input vector without overwriting data. + +procedure achtxx (a, b, npix) + +complex a[ARB] +complex b[ARB] +int npix + +begin + call amovx (a, b, npix) +end diff --git a/sys/vops/ak/acjgx.x b/sys/vops/ak/acjgx.x new file mode 100644 index 00000000..1fc9f944 --- /dev/null +++ b/sys/vops/ak/acjgx.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACJGX -- Complex conjugate of a complex vector. + +procedure acjgx (a, b, npix) + +complex a[ARB], b[ARB] +int npix +int i + +begin + do i = 1, npix + b[i] = conjg (a[i]) +end diff --git a/sys/vops/ak/aclrc.x b/sys/vops/ak/aclrc.x new file mode 100644 index 00000000..03a82c86 --- /dev/null +++ b/sys/vops/ak/aclrc.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrc (a, npix) + +char a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0 +end diff --git a/sys/vops/ak/aclrd.x b/sys/vops/ak/aclrd.x new file mode 100644 index 00000000..791eb7c0 --- /dev/null +++ b/sys/vops/ak/aclrd.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrd (a, npix) + +double a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0.0D0 +end diff --git a/sys/vops/ak/aclri.x b/sys/vops/ak/aclri.x new file mode 100644 index 00000000..0b022bb3 --- /dev/null +++ b/sys/vops/ak/aclri.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclri (a, npix) + +int a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0 +end diff --git a/sys/vops/ak/aclrl.x b/sys/vops/ak/aclrl.x new file mode 100644 index 00000000..c56fb5b3 --- /dev/null +++ b/sys/vops/ak/aclrl.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrl (a, npix) + +long a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0 +end diff --git a/sys/vops/ak/aclrr.x b/sys/vops/ak/aclrr.x new file mode 100644 index 00000000..9102ce7c --- /dev/null +++ b/sys/vops/ak/aclrr.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrr (a, npix) + +real a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0.0 +end diff --git a/sys/vops/ak/aclrs.x b/sys/vops/ak/aclrs.x new file mode 100644 index 00000000..a42a6b00 --- /dev/null +++ b/sys/vops/ak/aclrs.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrs (a, npix) + +short a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = 0 +end diff --git a/sys/vops/ak/aclrx.x b/sys/vops/ak/aclrx.x new file mode 100644 index 00000000..a27e555f --- /dev/null +++ b/sys/vops/ak/aclrx.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACLR -- Zero a vector (generic). + +procedure aclrx (a, npix) + +complex a[ARB] +int npix, i + +begin + do i = 1, npix + a[i] = (0.0,0.0) +end diff --git a/sys/vops/ak/acnvd.x b/sys/vops/ak/acnvd.x new file mode 100644 index 00000000..7871ac93 --- /dev/null +++ b/sys/vops/ak/acnvd.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNV -- Vector convolution. The output vector is equal to the sum of its +# initial value and the convolution of the input vector with the kernel. +# This routine assumes boundary extension on the input vector has been provided. +# For short kernels, we unroll the inner do loop into a single statement to +# reduce loop overhead. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 + +procedure acnvd (in, out, npix, kernel, knpix) + +double in[npix+knpix-1] # input vector, including boundary pixels +double out[ARB] # output vector +int npix # length of output vector +double kernel[knpix] # convolution kernel +int knpix # size of convolution kernel + +int i, j +double sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvi.x b/sys/vops/ak/acnvi.x new file mode 100644 index 00000000..70a236f8 --- /dev/null +++ b/sys/vops/ak/acnvi.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNV -- Vector convolution. The output vector is equal to the sum of its +# initial value and the convolution of the input vector with the kernel. +# This routine assumes boundary extension on the input vector has been provided. +# For short kernels, we unroll the inner do loop into a single statement to +# reduce loop overhead. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 + +procedure acnvi (in, out, npix, kernel, knpix) + +int in[npix+knpix-1] # input vector, including boundary pixels +int out[ARB] # output vector +int npix # length of output vector +int kernel[knpix] # convolution kernel +int knpix # size of convolution kernel + +int i, j +int sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvl.x b/sys/vops/ak/acnvl.x new file mode 100644 index 00000000..98fc18f0 --- /dev/null +++ b/sys/vops/ak/acnvl.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNV -- Vector convolution. The output vector is equal to the sum of its +# initial value and the convolution of the input vector with the kernel. +# This routine assumes boundary extension on the input vector has been provided. +# For short kernels, we unroll the inner do loop into a single statement to +# reduce loop overhead. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 + +procedure acnvl (in, out, npix, kernel, knpix) + +long in[npix+knpix-1] # input vector, including boundary pixels +long out[ARB] # output vector +int npix # length of output vector +long kernel[knpix] # convolution kernel +int knpix # size of convolution kernel + +int i, j +long sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvr.x b/sys/vops/ak/acnvr.x new file mode 100644 index 00000000..b1119c29 --- /dev/null +++ b/sys/vops/ak/acnvr.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNV -- Vector convolution. The output vector is equal to the sum of its +# initial value and the convolution of the input vector with the kernel. +# This routine assumes boundary extension on the input vector has been provided. +# For short kernels, we unroll the inner do loop into a single statement to +# reduce loop overhead. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 + +procedure acnvr (in, out, npix, kernel, knpix) + +real in[npix+knpix-1] # input vector, including boundary pixels +real out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvrd.x b/sys/vops/ak/acnvrd.x new file mode 100644 index 00000000..c6b3fb2f --- /dev/null +++ b/sys/vops/ak/acnvrd.x @@ -0,0 +1,55 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNVR -- Vector convolution with a real kernel. The output vector is equal +# to the sum of its initial value and the convolution of the input vector with +# the kernel. This routine assumes boundary extension on the input vector has +# been provided. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 +# +# See also acnv_, if the kernel is the same datatype as the data vectors. + +procedure acnvrd (in, out, npix, kernel, knpix) + +double in[npix+knpix-1] # input vector, including boundary pixels +double out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel, always type real +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvri.x b/sys/vops/ak/acnvri.x new file mode 100644 index 00000000..290c093b --- /dev/null +++ b/sys/vops/ak/acnvri.x @@ -0,0 +1,55 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNVR -- Vector convolution with a real kernel. The output vector is equal +# to the sum of its initial value and the convolution of the input vector with +# the kernel. This routine assumes boundary extension on the input vector has +# been provided. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 +# +# See also acnv_, if the kernel is the same datatype as the data vectors. + +procedure acnvri (in, out, npix, kernel, knpix) + +int in[npix+knpix-1] # input vector, including boundary pixels +int out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel, always type real +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvrl.x b/sys/vops/ak/acnvrl.x new file mode 100644 index 00000000..44df6dad --- /dev/null +++ b/sys/vops/ak/acnvrl.x @@ -0,0 +1,55 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNVR -- Vector convolution with a real kernel. The output vector is equal +# to the sum of its initial value and the convolution of the input vector with +# the kernel. This routine assumes boundary extension on the input vector has +# been provided. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 +# +# See also acnv_, if the kernel is the same datatype as the data vectors. + +procedure acnvrl (in, out, npix, kernel, knpix) + +long in[npix+knpix-1] # input vector, including boundary pixels +long out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel, always type real +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvrr.x b/sys/vops/ak/acnvrr.x new file mode 100644 index 00000000..83f4143c --- /dev/null +++ b/sys/vops/ak/acnvrr.x @@ -0,0 +1,55 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNVR -- Vector convolution with a real kernel. The output vector is equal +# to the sum of its initial value and the convolution of the input vector with +# the kernel. This routine assumes boundary extension on the input vector has +# been provided. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 +# +# See also acnv_, if the kernel is the same datatype as the data vectors. + +procedure acnvrr (in, out, npix, kernel, knpix) + +real in[npix+knpix-1] # input vector, including boundary pixels +real out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel, always type real +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvrs.x b/sys/vops/ak/acnvrs.x new file mode 100644 index 00000000..b00d4a92 --- /dev/null +++ b/sys/vops/ak/acnvrs.x @@ -0,0 +1,55 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNVR -- Vector convolution with a real kernel. The output vector is equal +# to the sum of its initial value and the convolution of the input vector with +# the kernel. This routine assumes boundary extension on the input vector has +# been provided. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 +# +# See also acnv_, if the kernel is the same datatype as the data vectors. + +procedure acnvrs (in, out, npix, kernel, knpix) + +short in[npix+knpix-1] # input vector, including boundary pixels +short out[ARB] # output vector +int npix # length of output vector +real kernel[knpix] # convolution kernel, always type real +int knpix # size of convolution kernel + +int i, j +real sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/acnvs.x b/sys/vops/ak/acnvs.x new file mode 100644 index 00000000..9a11eda9 --- /dev/null +++ b/sys/vops/ak/acnvs.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ACNV -- Vector convolution. The output vector is equal to the sum of its +# initial value and the convolution of the input vector with the kernel. +# This routine assumes boundary extension on the input vector has been provided. +# For short kernels, we unroll the inner do loop into a single statement to +# reduce loop overhead. +# +# Example: npix=10, kpix=5, 2 pixels out of bounds on either end. +# in[1] corresponds to x = -1 +# +# -1 0 1 2 3 4 5 6 7 8 9 10 11 12 (x coord) +# 1 2 3 4 5 +# 1 2 3 4 5 +# ... +# 1 2 3 4 5 + +procedure acnvs (in, out, npix, kernel, knpix) + +short in[npix+knpix-1] # input vector, including boundary pixels +short out[ARB] # output vector +int npix # length of output vector +short kernel[knpix] # convolution kernel +int knpix # size of convolution kernel + +int i, j +short sum, k1, k2, k3, k4, k5 + +begin + switch (knpix) { + case 3: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + case 5: + k1 = kernel[1] + k2 = kernel[2] + k3 = kernel[3] + k4 = kernel[4] + k5 = kernel[5] + do i = 1, npix + out[i] = out[i] + k1 * in[i] + k2 * in[i+1] + k3 * in[i+2] + + k4 * in[i+3] + k5 * in[i+4] + default: + do i = 1, npix { + sum = out[i] + do j = 1, knpix + sum = sum + (kernel[j] * in[i+j-1]) + out[i] = sum + } + } +end diff --git a/sys/vops/ak/adivd.x b/sys/vops/ak/adivd.x new file mode 100644 index 00000000..73f43925 --- /dev/null +++ b/sys/vops/ak/adivd.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivd (a, b, c, npix) + +double a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adivi.x b/sys/vops/ak/adivi.x new file mode 100644 index 00000000..2237363b --- /dev/null +++ b/sys/vops/ak/adivi.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivi (a, b, c, npix) + +int a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adivkd.x b/sys/vops/ak/adivkd.x new file mode 100644 index 00000000..3758ab33 --- /dev/null +++ b/sys/vops/ak/adivkd.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivkd (a, b, c, npix) + +double a[ARB] +double b +double c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivki.x b/sys/vops/ak/adivki.x new file mode 100644 index 00000000..ef4a3949 --- /dev/null +++ b/sys/vops/ak/adivki.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivkl.x b/sys/vops/ak/adivkl.x new file mode 100644 index 00000000..cb1ae2e4 --- /dev/null +++ b/sys/vops/ak/adivkl.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivkl (a, b, c, npix) + +long a[ARB] +long b +long c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivkr.x b/sys/vops/ak/adivkr.x new file mode 100644 index 00000000..5f47c21e --- /dev/null +++ b/sys/vops/ak/adivkr.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivkr (a, b, c, npix) + +real a[ARB] +real b +real c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivks.x b/sys/vops/ak/adivks.x new file mode 100644 index 00000000..cb821d21 --- /dev/null +++ b/sys/vops/ak/adivks.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivks (a, b, c, npix) + +short a[ARB] +short b +short c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivkx.x b/sys/vops/ak/adivkx.x new file mode 100644 index 00000000..c11a4bfd --- /dev/null +++ b/sys/vops/ak/adivkx.x @@ -0,0 +1,16 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIVK -- Divide a vector by a constant (generic). No divide by zero checking +# is performed. + +procedure adivkx (a, b, c, npix) + +complex a[ARB] +complex b +complex c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b +end diff --git a/sys/vops/ak/adivl.x b/sys/vops/ak/adivl.x new file mode 100644 index 00000000..b449bd31 --- /dev/null +++ b/sys/vops/ak/adivl.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivl (a, b, c, npix) + +long a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adivr.x b/sys/vops/ak/adivr.x new file mode 100644 index 00000000..323d6e55 --- /dev/null +++ b/sys/vops/ak/adivr.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivr (a, b, c, npix) + +real a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adivs.x b/sys/vops/ak/adivs.x new file mode 100644 index 00000000..ed8785bb --- /dev/null +++ b/sys/vops/ak/adivs.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivs (a, b, c, npix) + +short a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adivx.x b/sys/vops/ak/adivx.x new file mode 100644 index 00000000..1aa3013c --- /dev/null +++ b/sys/vops/ak/adivx.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADIV -- Divide two vectors (generic). No divide by zero checking is +# performed. If this is desired, advz should be used instead. + +procedure adivx (a, b, c, npix) + +complex a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] / b[i] +end diff --git a/sys/vops/ak/adotd.x b/sys/vops/ak/adotd.x new file mode 100644 index 00000000..167a82b8 --- /dev/null +++ b/sys/vops/ak/adotd.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +double procedure adotd (a, b, npix) + +double a[ARB], b[ARB] + +double sum + +int npix, i + +begin + sum = 0.0D0 + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/adoti.x b/sys/vops/ak/adoti.x new file mode 100644 index 00000000..7bb6bf29 --- /dev/null +++ b/sys/vops/ak/adoti.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +real procedure adoti (a, b, npix) + +int a[ARB], b[ARB] + +real sum + +int npix, i + +begin + sum = 0 + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/adotl.x b/sys/vops/ak/adotl.x new file mode 100644 index 00000000..0df6d038 --- /dev/null +++ b/sys/vops/ak/adotl.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +double procedure adotl (a, b, npix) + +long a[ARB], b[ARB] + +double sum + +int npix, i + +begin + sum = 0 + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/adotr.x b/sys/vops/ak/adotr.x new file mode 100644 index 00000000..309c4f83 --- /dev/null +++ b/sys/vops/ak/adotr.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +real procedure adotr (a, b, npix) + +real a[ARB], b[ARB] + +real sum + +int npix, i + +begin + sum = 0.0 + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/adots.x b/sys/vops/ak/adots.x new file mode 100644 index 00000000..391fb7ca --- /dev/null +++ b/sys/vops/ak/adots.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +real procedure adots (a, b, npix) + +short a[ARB], b[ARB] + +real sum + +int npix, i + +begin + sum = 0 + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/adotx.x b/sys/vops/ak/adotx.x new file mode 100644 index 00000000..42006e3d --- /dev/null +++ b/sys/vops/ak/adotx.x @@ -0,0 +1,20 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADOT -- Vector inner or dot product. The function value is the sum of the +# products of each pair of elements of the input vectors. + +real procedure adotx (a, b, npix) + +complex a[ARB], b[ARB] + +real sum + +int npix, i + +begin + sum = (0.0,0.0) + do i = 1, npix + sum = sum + a[i] * b[i] + + return (sum) +end diff --git a/sys/vops/ak/advzd.x b/sys/vops/ak/advzd.x new file mode 100644 index 00000000..ca5bb0da --- /dev/null +++ b/sys/vops/ak/advzd.x @@ -0,0 +1,41 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzd (a, b, c, npix, errfcn) + +double a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +double errfcn() # user function, called on divide by zero + +int i +double divisor +double tol +extern errfcn() +errchk errfcn + +begin + tol = 1.0D-20 + + do i = 1, npix { + divisor = b[i] + # The following is most efficient when the data tends to be + # positive. + + if (divisor < tol) + if (divisor > -tol) { + c[i] = errfcn (a[i]) + next + } + c[i] = a[i] / divisor + + } +end diff --git a/sys/vops/ak/advzi.x b/sys/vops/ak/advzi.x new file mode 100644 index 00000000..5aa0810e --- /dev/null +++ b/sys/vops/ak/advzi.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzi (a, b, c, npix, errfcn) + +int a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +int errfcn() # user function, called on divide by zero + +int i +int divisor +extern errfcn() +errchk errfcn + +begin + + do i = 1, npix { + divisor = b[i] + if (divisor == 0) + c[i] = errfcn (a[i]) + else + c[i] = a[i] / divisor + } +end diff --git a/sys/vops/ak/advzl.x b/sys/vops/ak/advzl.x new file mode 100644 index 00000000..22f1a278 --- /dev/null +++ b/sys/vops/ak/advzl.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzl (a, b, c, npix, errfcn) + +long a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +long errfcn() # user function, called on divide by zero + +int i +long divisor +extern errfcn() +errchk errfcn + +begin + + do i = 1, npix { + divisor = b[i] + if (divisor == 0) + c[i] = errfcn (a[i]) + else + c[i] = a[i] / divisor + } +end diff --git a/sys/vops/ak/advzr.x b/sys/vops/ak/advzr.x new file mode 100644 index 00000000..deb36e3c --- /dev/null +++ b/sys/vops/ak/advzr.x @@ -0,0 +1,41 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzr (a, b, c, npix, errfcn) + +real a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +real errfcn() # user function, called on divide by zero + +int i +real divisor +real tol +extern errfcn() +errchk errfcn + +begin + tol = 1.0E-20 + + do i = 1, npix { + divisor = b[i] + # The following is most efficient when the data tends to be + # positive. + + if (divisor < tol) + if (divisor > -tol) { + c[i] = errfcn (a[i]) + next + } + c[i] = a[i] / divisor + + } +end diff --git a/sys/vops/ak/advzs.x b/sys/vops/ak/advzs.x new file mode 100644 index 00000000..98a9603f --- /dev/null +++ b/sys/vops/ak/advzs.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzs (a, b, c, npix, errfcn) + +short a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +short errfcn() # user function, called on divide by zero + +int i +short divisor +extern errfcn() +errchk errfcn + +begin + + do i = 1, npix { + divisor = b[i] + if (divisor == 0) + c[i] = errfcn (a[i]) + else + c[i] = a[i] / divisor + } +end diff --git a/sys/vops/ak/advzx.x b/sys/vops/ak/advzx.x new file mode 100644 index 00000000..e6089049 --- /dev/null +++ b/sys/vops/ak/advzx.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ADVZ -- Vector divide with checking for zero divisors. If the result of a +# divide would be undefined a user supplied function is called to get the +# output pixel value. +# +# NOTE: in the interests of simplicity a somewhat arbitrary tolerance is used +# to check for an undefined divide, i.e., a divide by zero or a divide by a +# number small enough to cause floating point overflow. A better way to do +# this would be to provide a machine dependent version of this operator in +# host$as which catches the hardware exception rather than using a comparison. + +procedure advzx (a, b, c, npix, errfcn) + +complex a[ARB], b[ARB], c[ARB] # numerator, divisor, and output arrays +int npix # number of pixels +complex errfcn() # user function, called on divide by zero + +int i +complex divisor +extern errfcn() +errchk errfcn + +begin + + do i = 1, npix { + divisor = b[i] + if (divisor == (0.0,0.0)) + c[i] = errfcn (a[i]) + else + c[i] = a[i] / divisor + } +end diff --git a/sys/vops/ak/aexpd.x b/sys/vops/ak/aexpd.x new file mode 100644 index 00000000..f0278777 --- /dev/null +++ b/sys/vops/ak/aexpd.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexpd (a, b, c, npix) + +double a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/aexpi.x b/sys/vops/ak/aexpi.x new file mode 100644 index 00000000..0e332a9a --- /dev/null +++ b/sys/vops/ak/aexpi.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexpi (a, b, c, npix) + +int a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/aexpkd.x b/sys/vops/ak/aexpkd.x new file mode 100644 index 00000000..7c6f58b9 --- /dev/null +++ b/sys/vops/ak/aexpkd.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpkd (a, b, c, npix) + +double a[ARB] +double b +double c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpki.x b/sys/vops/ak/aexpki.x new file mode 100644 index 00000000..609b73c1 --- /dev/null +++ b/sys/vops/ak/aexpki.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpki (a, b, c, npix) + +int a[ARB] +int b +int c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpkl.x b/sys/vops/ak/aexpkl.x new file mode 100644 index 00000000..941dade0 --- /dev/null +++ b/sys/vops/ak/aexpkl.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpkl (a, b, c, npix) + +long a[ARB] +long b +long c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpkr.x b/sys/vops/ak/aexpkr.x new file mode 100644 index 00000000..ee083471 --- /dev/null +++ b/sys/vops/ak/aexpkr.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpkr (a, b, c, npix) + +real a[ARB] +real b +real c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpks.x b/sys/vops/ak/aexpks.x new file mode 100644 index 00000000..cfcd1218 --- /dev/null +++ b/sys/vops/ak/aexpks.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpks (a, b, c, npix) + +short a[ARB] +short b +short c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpkx.x b/sys/vops/ak/aexpkx.x new file mode 100644 index 00000000..4251fca2 --- /dev/null +++ b/sys/vops/ak/aexpkx.x @@ -0,0 +1,15 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXPK -- Compute a ** b, where b is a constant of type PIXEL (generic). + +procedure aexpkx (a, b, c, npix) + +complex a[ARB] +complex b +complex c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b +end diff --git a/sys/vops/ak/aexpl.x b/sys/vops/ak/aexpl.x new file mode 100644 index 00000000..493f7bfa --- /dev/null +++ b/sys/vops/ak/aexpl.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexpl (a, b, c, npix) + +long a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/aexpr.x b/sys/vops/ak/aexpr.x new file mode 100644 index 00000000..3e0877ff --- /dev/null +++ b/sys/vops/ak/aexpr.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexpr (a, b, c, npix) + +real a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/aexps.x b/sys/vops/ak/aexps.x new file mode 100644 index 00000000..e0c47207 --- /dev/null +++ b/sys/vops/ak/aexps.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexps (a, b, c, npix) + +short a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/aexpx.x b/sys/vops/ak/aexpx.x new file mode 100644 index 00000000..84d1e4c6 --- /dev/null +++ b/sys/vops/ak/aexpx.x @@ -0,0 +1,13 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AEXP -- Compute a ** b, where b is of type PIXEL (generic). + +procedure aexpx (a, b, c, npix) + +complex a[ARB], b[ARB], c[ARB] +int npix, i + +begin + do i = 1, npix + c[i] = a[i] ** b[i] +end diff --git a/sys/vops/ak/afftrr.x b/sys/vops/ak/afftrr.x new file mode 100644 index 00000000..024f4456 --- /dev/null +++ b/sys/vops/ak/afftrr.x @@ -0,0 +1,34 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AFFTRR -- Forward fourier transform (real transform, real output arrays). +# The forward transform of the real array SR length NPIX is computed and +# returned in the real arrays FR and FI of length NPIX/2+1. Since the real +# transform is being performed the array SI is ignored and may be omitted. +# The transformation may be performed in place if desired. NPIX must be a +# power of 2. + +procedure afftrr (sr, si, fr, fi, npix) + +real sr[ARB], si[ARB] # spatial data (input). SI NOT USED. +real fr[ARB], fi[ARB] # real and imag parts of transform (output) +int npix +int ier +pointer sp, work + +begin + call smark (sp) + call salloc (work, npix + 2, TY_REAL) + + # Copy the real data vector into the work array. + call amovr (sr, Memr[work], npix) + + # Compute the forward transform. + call ffa (Memr[work], npix, ier) + if (ier == 1) + call fatal (1, "afftrr: npix not a power of 2") + + # Unpack the real and imaginary parts into the output arrays. + call aupxr (Memr[work], fr, fi, npix / 2 + 1) + + call sfree (sp) +end diff --git a/sys/vops/ak/afftrx.x b/sys/vops/ak/afftrx.x new file mode 100644 index 00000000..ec43b16a --- /dev/null +++ b/sys/vops/ak/afftrx.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AFFTRX -- Forward fourier transform (real transform, complex output). +# The fourier transform of the real array A of length NPIX pixels is computed +# and the NPIX/2+1 complex transform coefficients are returned in the complex +# array B. The first element of array B upon output contains the dc term at +# zero frequency, and the remaining elements contain the real and imaginary +# components of the harmonics. The transformation may be performed in place +# if desired. NPIX must be a power of 2. +# +# N.B.: The Fortran 77 standard guarantees that a complex datum is represented +# as two reals, and that the first real in storage order is the real part of +# the complex datum and the second real the imaginary part. We have defined +# B to be a type COMPLEX array in the calling program, but FFA expects a +# REAL array containing (real,imag) pairs. The Fortran standard appears to +# guarantee that this will work. + +procedure afftrx (a, b, npix) + +real a[ARB] # data (input) +complex b[ARB] # transform (output). Dim npix/2+1 +int npix +int ier + +begin + # The following is a no-op if A and B are the same array. + call amovr (a, b, npix) + + # Compute the forward real transform. + call ffa (b, npix, ier) + if (ier == 1) + call fatal (1, "afftrx: npix not a power of 2") +end diff --git a/sys/vops/ak/afftxr.x b/sys/vops/ak/afftxr.x new file mode 100644 index 00000000..b09ae0f5 --- /dev/null +++ b/sys/vops/ak/afftxr.x @@ -0,0 +1,27 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AFFTXR -- Forward fourier transform (complex transform, real arrays). +# The fourier transform of the real arrays SR and SI containing complex data +# pairs is computed and the complex transform coefficients are returned in +# the real arrays FR and FI. The transformation may be performed in place if +# desired. NPIX must be a power of 2. + +procedure afftxr (sr, si, fr, fi, npix) + +real sr[ARB], si[ARB] # data, spatial domain (input) +real fr[ARB], fi[ARB] # transform, frequency domain (output) +int npix +int ier + +begin + # The following are no-ops if the transform is being performed + # in place. + + call amovr (sr, fr, npix) + call amovr (si, fi, npix) + + # Compute the forward transform. + call fft842 (0, npix, fr, fi, ier) + if (ier == 1) + call fatal (1, "afftxr: npix not a power of 2") +end diff --git a/sys/vops/ak/afftxx.x b/sys/vops/ak/afftxx.x new file mode 100644 index 00000000..34eedbf9 --- /dev/null +++ b/sys/vops/ak/afftxx.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AFFTXX -- Forward fourier transform (complex transform, complex data). +# The fourier transform of the complex array A of length NPIX pixels is +# computed and the NPIX complex transform coefficients are returned in the +# complex array B. The transformation may be performed in place if desired. +# NPIX must be a power of 2. + +procedure afftxx (a, b, npix) + +complex a[ARB] # data (input) +complex b[ARB] # transform (output) +int npix + +int ier +pointer sp, xr, xi + +begin + call smark (sp) + call salloc (xr, npix, TY_REAL) + call salloc (xi, npix, TY_REAL) + + # Rearrange the elements of the A array as required by FFT842. + # Convert the array A of complex values into an array of reals + # and an array of imaginaries. + + call aupxr (a, Memr[xr], Memr[xi], npix) + + # Compute the forward transform. + call fft842 (0, npix, Memr[xr], Memr[xi], ier) + if (ier == 1) + call fatal (1, "afftxx: npix not a power of 2") + + # Repack the real and imaginary arrays to form the complex output + # array. + call apkxr (Memr[xr], Memr[xi], b, npix) + + call sfree (sp) +end diff --git a/sys/vops/ak/agltc.x b/sys/vops/ak/agltc.x new file mode 100644 index 00000000..4f87a8fc --- /dev/null +++ b/sys/vops/ak/agltc.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 agltc (a, b, npix, low, high, kmul, kadd, nrange) + +char a[ARB], b[ARB], pixval +int npix, i +char 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 diff --git a/sys/vops/ak/agltd.x b/sys/vops/ak/agltd.x new file mode 100644 index 00000000..c307fe7d --- /dev/null +++ b/sys/vops/ak/agltd.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 agltd (a, b, npix, low, high, kmul, kadd, nrange) + +double a[ARB], b[ARB], pixval +int npix, i +double low[nrange], high[nrange] # range limits +double kmul[nrange], kadd[nrange] # linear transformation +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.0D0) + b[i] = kadd[nr] + else + b[i] = (pixval * kmul[nr]) + kadd[nr] + break + } + } +end diff --git a/sys/vops/ak/aglti.x b/sys/vops/ak/aglti.x new file mode 100644 index 00000000..c37a650e --- /dev/null +++ b/sys/vops/ak/aglti.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 aglti (a, b, npix, low, high, kmul, kadd, nrange) + +int a[ARB], b[ARB], pixval +int npix, i +int 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 diff --git a/sys/vops/ak/agltl.x b/sys/vops/ak/agltl.x new file mode 100644 index 00000000..3a416d37 --- /dev/null +++ b/sys/vops/ak/agltl.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 agltl (a, b, npix, low, high, kmul, kadd, nrange) + +long a[ARB], b[ARB], pixval +int npix, i +long low[nrange], high[nrange] # range limits +double kmul[nrange], kadd[nrange] # linear transformation +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.0D0) + b[i] = kadd[nr] + else + b[i] = (pixval * kmul[nr]) + kadd[nr] + break + } + } +end 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 diff --git a/sys/vops/ak/aglts.x b/sys/vops/ak/aglts.x new file mode 100644 index 00000000..ba18d1ac --- /dev/null +++ b/sys/vops/ak/aglts.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 aglts (a, b, npix, low, high, kmul, kadd, nrange) + +short a[ARB], b[ARB], pixval +int npix, i +short 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 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 diff --git a/sys/vops/ak/ahgmc.x b/sys/vops/ak/ahgmc.x new file mode 100644 index 00000000..b0917e8f --- /dev/null +++ b/sys/vops/ak/ahgmc.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgmc (data, npix, hgm, nbins, z1, z2) + +char data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +char z1, z2 # greyscale values of first and last bins + +char z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahgmd.x b/sys/vops/ak/ahgmd.x new file mode 100644 index 00000000..cd75445f --- /dev/null +++ b/sys/vops/ak/ahgmd.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgmd (data, npix, hgm, nbins, z1, z2) + +double data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +double z1, z2 # greyscale values of first and last bins + +double z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahgmi.x b/sys/vops/ak/ahgmi.x new file mode 100644 index 00000000..36c11db8 --- /dev/null +++ b/sys/vops/ak/ahgmi.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgmi (data, npix, hgm, nbins, z1, z2) + +int data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +int z1, z2 # greyscale values of first and last bins + +int z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahgml.x b/sys/vops/ak/ahgml.x new file mode 100644 index 00000000..f515a2e4 --- /dev/null +++ b/sys/vops/ak/ahgml.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgml (data, npix, hgm, nbins, z1, z2) + +long data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +long z1, z2 # greyscale values of first and last bins + +long z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahgmr.x b/sys/vops/ak/ahgmr.x new file mode 100644 index 00000000..a1f90d67 --- /dev/null +++ b/sys/vops/ak/ahgmr.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgmr (data, npix, hgm, nbins, z1, z2) + +real data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +real z1, z2 # greyscale values of first and last bins + +real z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahgms.x b/sys/vops/ak/ahgms.x new file mode 100644 index 00000000..fb656c02 --- /dev/null +++ b/sys/vops/ak/ahgms.x @@ -0,0 +1,39 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +# AHGM -- Accumulate the histogram of the input vector. The output vector +# HGM (the histogram) should be cleared prior to the first call. + +procedure ahgms (data, npix, hgm, nbins, z1, z2) + +short data[ARB] # data vector +int npix # number of pixels +int hgm[ARB] # output histogram +int nbins # number of bins in histogram +short z1, z2 # greyscale values of first and last bins + +short z +real dz +int bin, i + +begin + dz = real (nbins - 1) / real (z2 - z1) + if (abs (dz - 1.0) < (EPSILONR * 2.0)) { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int (z - z1) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } else { + do i = 1, npix { + z = data[i] + if (z >= z1 && z <= z2) { + bin = int ((z - z1) * dz) + 1 + hgm[bin] = hgm[bin] + 1 + } + } + } +end diff --git a/sys/vops/ak/ahivc.x b/sys/vops/ak/ahivc.x new file mode 100644 index 00000000..93a39259 --- /dev/null +++ b/sys/vops/ak/ahivc.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +char procedure ahivc (a, npix) + +char a[ARB] +int npix +char high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivd.x b/sys/vops/ak/ahivd.x new file mode 100644 index 00000000..fb851f95 --- /dev/null +++ b/sys/vops/ak/ahivd.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +double procedure ahivd (a, npix) + +double a[ARB] +int npix +double high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivi.x b/sys/vops/ak/ahivi.x new file mode 100644 index 00000000..41effe58 --- /dev/null +++ b/sys/vops/ak/ahivi.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +int procedure ahivi (a, npix) + +int a[ARB] +int npix +int high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivl.x b/sys/vops/ak/ahivl.x new file mode 100644 index 00000000..a6edb516 --- /dev/null +++ b/sys/vops/ak/ahivl.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +long procedure ahivl (a, npix) + +long a[ARB] +int npix +long high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivr.x b/sys/vops/ak/ahivr.x new file mode 100644 index 00000000..0485e6bf --- /dev/null +++ b/sys/vops/ak/ahivr.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +real procedure ahivr (a, npix) + +real a[ARB] +int npix +real high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivs.x b/sys/vops/ak/ahivs.x new file mode 100644 index 00000000..2613473f --- /dev/null +++ b/sys/vops/ak/ahivs.x @@ -0,0 +1,22 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +short procedure ahivs (a, npix) + +short a[ARB] +int npix +short high, pixval +int i + +begin + high = a[1] + + do i = 1, npix { + pixval = a[i] + if (pixval > high) + high = pixval + } + + return (high) +end diff --git a/sys/vops/ak/ahivx.x b/sys/vops/ak/ahivx.x new file mode 100644 index 00000000..b487aa8d --- /dev/null +++ b/sys/vops/ak/ahivx.x @@ -0,0 +1,26 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AHIV -- Compute the high value (maximum) of a vector. + +complex procedure ahivx (a, npix) + +complex a[ARB] +int npix +complex high, pixval +real abs_high +int i + +begin + high = a[1] + abs_high = abs (high) + + do i = 1, npix { + pixval = a[i] + if (abs (pixval) > abs_high) { + high = pixval + abs_high = abs (high) + } + } + + return (high) +end diff --git a/sys/vops/ak/aiftrr.x b/sys/vops/ak/aiftrr.x new file mode 100644 index 00000000..96789581 --- /dev/null +++ b/sys/vops/ak/aiftrr.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIFTRR -- Inverse fourier transform (real transform, real output arrays). +# The inverse transform of the real arrays FR and FI of length NPIX/2+1 is +# returned in the real array SR of length NPIX. Since the real inverse +# transform is being performed the array SI is ignored and may be omitted. +# The transformation may be performed in place if desired. NPIX must be a +# power of 2. + +procedure aiftrr (fr, fi, sr, si, npix) + +real fr[ARB], fi[ARB] # real and imag parts of transform (input) +real sr[ARB], si[ARB] # spatial data (output). SI NOT USED. +int npix +int ier +pointer sp, work + +begin + call smark (sp) + call salloc (work, npix + 2, TY_REAL) + + # Pack the real and imaginary parts into a complex array as required + # by FFS. + call apkxr (fr, fi, Memr[work], npix / 2 + 1) + + # Compute the inverse transform. + call ffs (Memr[work], npix, ier) + if (ier == 1) + call fatal (1, "aiftrr: npix not a power of 2") + + # The work array now contains the real part of the transform; merely + # copy it to the output array. + call amovr (Memr[work], sr, npix) + + call sfree (sp) +end diff --git a/sys/vops/ak/aiftrx.x b/sys/vops/ak/aiftrx.x new file mode 100644 index 00000000..63a9d53d --- /dev/null +++ b/sys/vops/ak/aiftrx.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIFTRX -- Inverse discreet fourier transform (real transform, complex data +# array in). The input array A of length NPIX/2+1 contains the DC term and +# the NPIX/2 (real,imag) pairs for each of the NPIX/2 harmonics of the real +# transform. Upon output array B contains the NPIX real data pixels from the +# inverse transform. The transform may be performed in place if desired. +# +# N.B.: The Fortran 77 standard guarantees that a complex datum is represented +# as two reals, and that the first real in storage order is the real part of +# the complex datum and the second real the imaginary part. We have defined +# B to be a type COMPLEX array in the calling program, but FFS expects a +# REAL array containing (real,imag) pairs. The Fortran standard appears to +# guarantee that this will work. + +procedure aiftrx (a, b, npix) + +complex a[ARB] # transform, npix/2+1 elements +real b[ARB] # output data array +int npix +int ier + +begin + # The following is a no-op if A and B are the same array. + call amovx (a, b, npix / 2 + 1) + + # Compute the inverse real transform. + call ffs (b, npix, ier) + if (ier == 1) + call fatal (1, "afftrx: npix not a power of 2") +end diff --git a/sys/vops/ak/aiftxr.x b/sys/vops/ak/aiftxr.x new file mode 100644 index 00000000..a9647e7c --- /dev/null +++ b/sys/vops/ak/aiftxr.x @@ -0,0 +1,27 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIFTXR -- Inverse fourier transform (complex transform, real arrays). +# The inverse transform of the real arrays FR and FI containing complex data +# pairs is computed and the complex spatial data coefficients are returned in +# the real arrays SR and SI. The transformation may be performed in place if +# desired. NPIX must be a power of 2. + +procedure aiftxr (fr, fi, sr, si, npix) + +real fr[ARB], fi[ARB] # transform, frequency domain (input) +real sr[ARB], si[ARB] # data, spatial domain (output) +int npix +int ier + +begin + # The following are no-ops if the transform is being performed + # in place. + + call amovr (fr, sr, npix) + call amovr (fi, si, npix) + + # Compute the inverse transform. + call fft842 (1, npix, sr, si, ier) + if (ier == 1) + call fatal (1, "afftxr: npix not a power of 2") +end diff --git a/sys/vops/ak/aiftxx.x b/sys/vops/ak/aiftxx.x new file mode 100644 index 00000000..2871590f --- /dev/null +++ b/sys/vops/ak/aiftxx.x @@ -0,0 +1,45 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIFTXX -- Inverse fourier transform (complex transform, complex array). +# The fourier transform of the complex array A of length NPIX pixels is +# computed and the NPIX complex data points are returned in the complex array +# B. The transformation may be performed in place if desired. NPIX must be +# a power of 2. +# +# N.B.: The Fortran 77 standard guarantees that a complex datum is represented +# as two reals, and that the first real in storage order is the real part of +# the complex datum and the second real the imaginary part. We have defined +# A and B to be type COMPLEX arrays in the calling program, but FFT842 expects +# a REAL array containing (real,imag) pairs. The Fortran standard appears to +# guarantee that this will work. + +procedure aiftxx (a, b, npix) + +complex a[ARB] # transform (input) +complex b[ARB] # data (output) +int npix +int ier +pointer sp, xr, xi + +begin + call smark (sp) + call salloc (xr, npix, TY_REAL) + call salloc (xi, npix, TY_REAL) + + # Rearrange the elements of the A array as required by FFT842. + # Convert the array A of complex values into an array of reals + # and an array of imaginaries. + + call aupxr (a, Memr[xr], Memr[xi], npix) + + # Compute the inverse transform. + call fft842 (1, npix, Memr[xr], Memr[xi], ier) + if (ier == 1) + call fatal (1, "afftxx: npix not a power of 2") + + # Repack the real and imaginary arrays to form the complex output + # array. + call apkxr (Memr[xr], Memr[xi], b, npix) + + call sfree (sp) +end diff --git a/sys/vops/ak/aimgd.x b/sys/vops/ak/aimgd.x new file mode 100644 index 00000000..b99b6aa3 --- /dev/null +++ b/sys/vops/ak/aimgd.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIMG -- Return the imaginary part of a COMPLEX vector. + +procedure aimgd (a, b, npix) + +complex a[ARB] +double b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = aimag (a[i]) +end diff --git a/sys/vops/ak/aimgi.x b/sys/vops/ak/aimgi.x new file mode 100644 index 00000000..7632f2d0 --- /dev/null +++ b/sys/vops/ak/aimgi.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIMG -- Return the imaginary part of a COMPLEX vector. + +procedure aimgi (a, b, npix) + +complex a[ARB] +int b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = aimag (a[i]) +end diff --git a/sys/vops/ak/aimgl.x b/sys/vops/ak/aimgl.x new file mode 100644 index 00000000..34958a6a --- /dev/null +++ b/sys/vops/ak/aimgl.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIMG -- Return the imaginary part of a COMPLEX vector. + +procedure aimgl (a, b, npix) + +complex a[ARB] +long b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = aimag (a[i]) +end diff --git a/sys/vops/ak/aimgr.x b/sys/vops/ak/aimgr.x new file mode 100644 index 00000000..a6e0e910 --- /dev/null +++ b/sys/vops/ak/aimgr.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIMG -- Return the imaginary part of a COMPLEX vector. + +procedure aimgr (a, b, npix) + +complex a[ARB] +real b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = aimag (a[i]) +end diff --git a/sys/vops/ak/aimgs.x b/sys/vops/ak/aimgs.x new file mode 100644 index 00000000..71dbbe67 --- /dev/null +++ b/sys/vops/ak/aimgs.x @@ -0,0 +1,14 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# AIMG -- Return the imaginary part of a COMPLEX vector. + +procedure aimgs (a, b, npix) + +complex a[ARB] +short b[ARB] +int npix, i + +begin + do i = 1, npix + b[i] = aimag (a[i]) +end diff --git a/sys/vops/ak/mkpkg b/sys/vops/ak/mkpkg new file mode 100644 index 00000000..9841f019 --- /dev/null +++ b/sys/vops/ak/mkpkg @@ -0,0 +1,276 @@ +# Make the VOPS vector operators library, procedures a[a-k]*.x. + +$checkout libvops.a lib$ +$update libvops.a +$checkin libvops.a lib$ +$exit + +libvops.a: + aabsd.x + aabsi.x + aabsl.x + aabsr.x + aabss.x + aabsx.x + aaddd.x + aaddi.x + aaddkd.x + aaddki.x + aaddkl.x + aaddkr.x + aaddks.x + aaddkx.x + aaddl.x + aaddr.x + aadds.x + aaddx.x + aandi.x + aandki.x + aandkl.x + aandks.x + aandl.x + aands.x + aavgd.x + aavgi.x + aavgl.x + aavgr.x + aavgs.x + aavgx.x + abavd.x + abavi.x + abavl.x + abavr.x + abavs.x + abavx.x + abeqc.x + abeqd.x + abeqi.x + abeqkc.x + abeqkd.x + abeqki.x + abeqkl.x + abeqkr.x + abeqks.x + abeqkx.x + abeql.x + abeqr.x + abeqs.x + abeqx.x + abgec.x + abged.x + abgei.x + abgekc.x + abgekd.x + abgeki.x + abgekl.x + abgekr.x + abgeks.x + abgekx.x + abgel.x + abger.x + abges.x + abgex.x + abgtc.x + abgtd.x + abgti.x + abgtkc.x + abgtkd.x + abgtki.x + abgtkl.x + abgtkr.x + abgtks.x + abgtkx.x + abgtl.x + abgtr.x + abgts.x + abgtx.x + ablec.x + abled.x + ablei.x + ablekc.x + ablekd.x + ableki.x + ablekl.x + ablekr.x + ableks.x + ablekx.x + ablel.x + abler.x + ables.x + ablex.x + abltc.x + abltd.x + ablti.x + abltkc.x + abltkd.x + abltki.x + abltkl.x + abltkr.x + abltks.x + abltkx.x + abltl.x + abltr.x + ablts.x + abltx.x + abnec.x + abned.x + abnei.x + abnekc.x + abnekd.x + abneki.x + abnekl.x + abnekr.x + abneks.x + abnekx.x + abnel.x + abner.x + abnes.x + abnex.x + abori.x + aborki.x + aborkl.x + aborks.x + aborl.x + abors.x + absud.x + absui.x + absul.x + absur.x + absus.x + achtcc.x + achtcd.x + achtci.x + achtcl.x + achtcr.x + achtcs.x + achtcx.x + achtdc.x + achtdd.x + achtdi.x + achtdl.x + achtdr.x + achtds.x + achtdx.x + achtic.x + achtid.x + achtii.x + achtil.x + achtir.x + achtis.x + achtix.x + achtlc.x + achtld.x + achtli.x + achtll.x + achtlr.x + achtls.x + achtlx.x + achtrc.x + achtrd.x + achtri.x + achtrl.x + achtrr.x + achtrs.x + achtrx.x + achtsc.x + achtsd.x + achtsi.x + achtsl.x + achtsr.x + achtss.x + achtsx.x + achtxc.x + achtxd.x + achtxi.x + achtxl.x + achtxr.x + achtxs.x + achtxx.x + acjgx.x + aclrc.x + aclrd.x + aclri.x + aclrl.x + aclrr.x + aclrs.x + aclrx.x + acnvd.x + acnvi.x + acnvl.x + acnvr.x + acnvrd.x + acnvri.x + acnvrl.x + acnvrr.x + acnvrs.x + acnvs.x + adivd.x + adivi.x + adivkd.x + adivki.x + adivkl.x + adivkr.x + adivks.x + adivkx.x + adivl.x + adivr.x + adivs.x + adivx.x + adotd.x + adoti.x + adotl.x + adotr.x + adots.x + adotx.x + advzd.x + advzi.x + advzl.x + advzr.x + advzs.x + advzx.x + aexpd.x + aexpi.x + aexpkd.x + aexpki.x + aexpkl.x + aexpkr.x + aexpks.x + aexpkx.x + aexpl.x + aexpr.x + aexps.x + aexpx.x + afftrr.x + afftrx.x + afftxr.x + afftxx.x + agltc.x + agltd.x + aglti.x + agltl.x + agltr.x + aglts.x + agltx.x + ahgmc.x <mach.h> + ahgmd.x <mach.h> + ahgmi.x <mach.h> + ahgml.x <mach.h> + ahgmr.x <mach.h> + ahgms.x <mach.h> + ahivc.x + ahivd.x + ahivi.x + ahivl.x + ahivr.x + ahivs.x + ahivx.x + aiftrr.x + aiftrx.x + aiftxr.x + aiftxx.x + aimgd.x + aimgi.x + aimgl.x + aimgr.x + aimgs.x + ; |