FUNCTION Congrid1D, array, dimx, dimy, INTREP = interp

;+
; NAME:		
;	Congrid1d
; PURPOSE:	
;	Shrink or expand the size of an image, with the
;	nearest method
; CALLING SEQUENCE:
;	Result = CONGRID1D(Image, Xs, Ys [, Interp = Interp])
; INPUTS:
;	Image = array to resample, 1d or 2d.
;	Xs = desired number of columns for result.
;	Ys = number of rows for result.
; OUTPUTS:
;	Result = Image of same type as input, of size (Xs, Ys).
; SIDE EFFECTS:
;	None.
; PROCEDURE:
;	Nearest neighbour method is used.
;	Simple call POLY_2D with the warping coefficients.
; MODIFICATION HISTORY:
;	Original version: "Congrid", DMS, Sept. 1988.
;	Congrid1d: for 1d arrays also, A.Csillaghy, Jan.91, ETHZ
;-

on_error,2              ;Return to caller if an error occurs

  IF dimy EQ 1 THEN BEGIN
    res = Congrid( [[array],[array]], dimx, 2, INTERP = interp )
    RETURN, res( *, 0 )
  ENDIF ELSE RETURN, Congrid( array, dimx, dimy, INTERP = interp )

END; congrid_1d