;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; @file_comment ; Like congrid but here, it works... ; example: ;IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) ; 1 1 1 2 2 2 3 3 3 3 4 4 ; 1 1 1 2 2 2 3 3 3 3 4 4 ; 5 5 5 6 6 6 7 7 7 7 8 8 ; 5 5 5 6 6 6 7 7 7 7 8 8 ;IDL> print, rebin([[1,2,3,4],[5,6,7,8]],12,4) ; 1 1 1 2 2 2 3 3 3 4 4 4 ; 3 3 3 4 4 4 5 5 5 6 6 6 ; 5 5 5 6 6 6 7 7 7 8 8 8 ; 5 5 5 6 6 6 7 7 7 8 8 8 ;IDL> print, congridseb([[1,2,3,4],[5,6,7,8]],12,4) ; 1 1 1 2 2 2 3 3 3 4 4 4 ; 1 1 1 2 2 2 3 3 3 4 4 4 ; 5 5 5 6 6 6 7 7 7 8 8 8 ; 5 5 5 6 6 6 7 7 7 8 8 8 ; ; @categories utilities ; ; @param tableau {in}{required} A table 1 ou 2d ; ; @param x {in}{required} dimension in x of the result which must be ; a multiple of the dimension in x of the table. ; ; @param y {in}{required} dimension in y of the result which must be ; a multiple of the dimension in y of the table. ; ; @returns res a table dim x * y ; ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) ; 20/3/98 ; 18/6/1999 supression d''une horrible boucle ; ; @version $Id$ ; ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ function congridseb, tableau, x, y ; compile_opt idl2, strictarrsubs ; res=tableau taille = size(tableau) CASE N_PARAMS() OF 2: begin res=replicate(1,1.*x/taille[1])#res[*] return, res[*] end 3: begin res = transpose(res) res = replicate(1, 1.*y/taille[2])#res[*] res = reform(res, y, taille[1], /over) res = transpose(res) res = replicate(1, 1.*x/taille[1])#res[*] return, reform(res, x,y, /overwrite) end else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB') endcase end