include include # FIXGRP -- Simulate the effects of overscanning in a single group procedure fixgrp (image, scan, xsteps, ysteps) char image[ARB] # i: Image name int scan # i: Number of points (at each end) affected # by overscanning int xsteps # i: X stepping factor used in spectrum int ysteps # i: Y stepping factor used in spectrum #-- int dist, xstep, ystep long aeon pointer im, inbuf, outbuf, istart, iend data aeon / 0 / long clktime() pointer immap(), imgl1r(), impl1r() real ahivr(), alovr() begin # Open image. im = immap (image, READ_WRITE, NULL) if (IM_NDIM(im) != 1) call error (1, "Image must be one-dimensional") if (mod (IM_LEN(im, 1), ysteps) != 0) call error (1, "Image length must be a multiple of ysteps") # Read the spectrum inbuf = imgl1r (im) outbuf = impl1r (im) # Simulate the effect of overscanning do ystep = 1, ysteps { istart = inbuf + (ystep - 1) * IM_LEN(im, 1) / ysteps iend = (inbuf - 1) + ystep * IM_LEN(im, 1) / ysteps do dist = 1, scan-1 do xstep = 1, xsteps { Memr[istart] = Memr[istart] * real(dist) / real(scan) Memr[iend] = Memr[iend] * real(dist) / real(scan) istart = istart + 1 iend = iend - 1 } } IM_MIN(im) = alovr (Memr[inbuf], IM_LEN(im,1)) IM_MAX(im) = ahivr (Memr[inbuf], IM_LEN(im,1)) IM_LIMTIME(im) = clktime (aeon) # Write output and close the image group. call amovr (Memr[inbuf], Memr[outbuf], IM_LEN(im,1)) call imunmap (im) end