# Copyright restrictions apply - see stsdas$copyright.stsdas # include include # SPLIT -- Separate one group into several groups. Consecutive points are # moved together into the same group. # # B.Simon 18-May-88 Original procedure split (in_image, out_ptr, factor) char in_image[ARB] # i: Input image name pointer out_ptr # i: Pointer to output image template int factor # i: Stepping factor #-- char out_image[SZ_FNAME] bool junk int step long aeon pointer imi, imo, inbuf, outbuf, inptr data aeon / 0 / bool tp_fetch() long clktime() pointer immap(), imgl1r(), impl1r() real ahivr(), alovr() begin # Open input image and copy into buffer imi = immap (in_image, READ_ONLY, NULL) inbuf = imgl1r (imi) inptr = inbuf do step = 1, factor { # Open output image as new copy of input image. junk = tp_fetch (out_ptr, out_image) imo = immap (out_image, NEW_COPY, imi) IM_LEN(imo,1) = IM_LEN(imi,1) / factor # Copy pixels from input to output image outbuf = impl1r (imo) call amovr (Memr[inptr], Memr[outbuf], IM_LEN(imo,1)) # Set min and max pixels IM_MIN(imo) = alovr (Memr[outbuf], IM_LEN(imo,1)) IM_MAX(imo) = ahivr (Memr[outbuf], IM_LEN(imo,1)) IM_LIMTIME(imo) = clktime (aeon) inptr = inptr + IM_LEN(imo,1) call imunmap (imo) } call imunmap (imi) end