HELP ARRAY_WRAP                                 David Young
                                                revised February 2000

LIB * ARRAY_WRAP provides a procedure to copy an array or region of an
array to another region assuming that the data are periodic on the input
region.

array_wrap(arrin, regin, arrout, regout) -> arrout
        arrin is the input array. Arrays of packed byte or float data
        (as created by *newbytearray and *newsfloatarray) are handled
        most efficiently.

        regin is the input region, given as a *boundslist type list.
        Alternatively, it may be <false>, in which case the boundslist
        of arrin is used. regin need not be wholly (or partly) within
        arrin.

        arrout is the output array. If <false> on entry, an array of the
        same type as arrin and with boundslist given by regout is
        created and returned.

        regout is a boundslist-type specification of the output region
        into which data are written. If <false>, arrout must be an
        array, and its boundslist will be used as regout. If both arrout
        and regout are given, then regout must lie wholly within the
        bounds of arrout.

        The result arrout will be set such that

                arrout(x, y, ...) = arrin(a, b, ...)

        if x mod N = a mod N, y mod M = b mod M etc., where N =
        regin(2)-regin(1)+1, M = regin(4)-regin(3)+1 etc., for all
        elements (x, y, ...) within regout, and for which (a, b, ...)
        lies within regin and within the boundslist of arrin. If this
        last condition does not hold, then arrout(x, y, ...) is set to
        zero.

        Note that this means that the input region, not the whole of the
        input array, sets the periodicity and is the unit which tiles
        the output array. The input array is not taken to be periodic,
        so if the input region goes outside its bounds, the missing data
        is set to zero and not taken from another part of the input
        array.


--- $popvision/help/array_wrap
--- Copyright University of Sussex 2000. All rights reserved.
