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/imsslv.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/imsslv.x')
-rw-r--r-- | sys/imio/imsslv.x | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/imio/imsslv.x b/sys/imio/imsslv.x new file mode 100644 index 00000000..2cc5e2a8 --- /dev/null +++ b/sys/imio/imsslv.x @@ -0,0 +1,41 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <imhdr.h> +include <imio.h> + +# IMSSLV -- Given two vectors (VS, VE) defining the starting and ending +# physical coordinates of the two pixels defining an image section, +# initialize the "loop index" vector V, and the "loop increment" vector, +# VINC. Compute NPIX, the number of pixels in a line segment. + +procedure imsslv (im, vs, ve, v, vinc, npix) + +pointer im +long vs[IM_MAXDIM], ve[IM_MAXDIM] +long v[IM_MAXDIM], vinc[IM_MAXDIM], npix, step +int i + +begin + # Determine the direction in which each dimension is to be + # traversed. + + do i = 1, IM_NPHYSDIM(im) { + step = abs (IM_VSTEP(im,i)) + if (vs[i] <= ve[i]) + vinc[i] = step + else + vinc[i] = -step + } + + # Initialize the extraction vector (passed to IMRDS? to read a + # contiguous array of pixels). Compute the length of a line, + # allowing for decimation by the step size. + + do i = 1, IM_NPHYSDIM(im) + v[i] = vs[i] + + if (vs[1] > ve[1]) + v[1] = ve[1] + + npix = (ve[1] - vs[1]) / vinc[1] + 1 +end |