FUNCTION F_shift, data, dx, dy ;+ ; NAME: ; F_SHIFT ; PURPOSE: ; Shift a 1 or 2-dimensional array by fractional amounts ; CATEGORY: ; ; CALLING SEQUENCE: ; RESULT = F_SHIFT ( DATA, XSHIFT [, YSHIFT] ) ; INPUTS: ; DATA : 1 or 2-dim array ; XSHIFT : Amount to shift the data in X-direction ; YSHIFT : For 2-d arrays: Amount to shift the data in ; Y-direction. If omitted, 0 is adopted ; OUTPUTS: ; RESULT : Array of same type and dimension as DATA, shifted by ; XSHIFT and YSHIFT resp. ; PROCEDURE: ; For shifting the userlib-routine poly_2d is used. This routine ; only sets up the correct matrices. As stated by the manpage ; for Polywarp, the outlying areas are padded by the last valid ; datavalue, and not wrapped-around like in SHIFT. ; MODIFICATION HISTORY: ; 08-Apr-1993 P.Suetterlin, KIS ;- on_error, 2 IF n_params() LT 2 THEN $ message, 'Use: RESULT = F_SHIFT( DATA, DX [,DY] )' IF n_params() LT 3 THEN dy = 0. p = [-dx, 0., 1., 0.] & q = [-dy, 1., 0., 0.] IF (size(data))(0) EQ 1 THEN BEGIN d = [[data], [data]] return, (poly_2d(d, p, q, 1))(*, 0) ENDIF ELSE $ return, poly_2d(data, p, q, 1) END