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/imio/imsamp.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/imsamp.x')
-rw-r--r-- | sys/imio/imsamp.x | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/sys/imio/imsamp.x b/sys/imio/imsamp.x new file mode 100644 index 00000000..43e144c9 --- /dev/null +++ b/sys/imio/imsamp.x @@ -0,0 +1,61 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# IMSAMP -- Subsample a vector. + +procedure imsamp (a, b, npix, sz_pixel, step) + +char a[ARB], b[ARB] +int npix, sz_pixel, step, i, j, in, out, delta_in + +begin + switch (sz_pixel) { + case SZ_SHORT: + call imsmps (a, b, npix, step) + case SZ_LONG: + call imsmpl (a, b, npix, step) + + default: # flip odd sized elements + in = 0 + out = 0 + delta_in = sz_pixel * step + + do j = 1, npix { + do i = 1, sz_pixel + b[out+i] = a[in+i] + in = in + delta_in + out = out + sz_pixel + } + } +end + + +# IMSMPS -- Sample an array of SHORT sized elements. + +procedure imsmps (a, b, npix, step) + +short a[ARB], b[npix] +int npix, step, ip, op + +begin + ip = 1 + do op = 1, npix { + b[op] = a[ip] + ip = ip + step + } +end + + +# IMSMPL -- Sample an array of LONG sized elements. + +procedure imsmpl (a, b, npix, step) + +long a[ARB], b[npix] +int npix, step, ip, op + +begin + ip = 1 + do op = 1, npix { + b[op] = a[ip] + ip = ip + step + } +end |