;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME:CONGRIDSEB ; ; PURPOSE:meme chose que congrid mais qui marche ... ; cf par ex: ;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 ; ; CATEGORY:bidouille matrices ; ; CALLING SEQUENCE:res=congridseb(tableau,x[,y]) ; ; INPUTS:tableau:un tableau 1 ou 2d ; x:dim en x du resultat doit etre un multiple de dim en x de tableau ; y:dim en y du resultat doit etre un multiple de dim en y de tableau ; ; KEYWORD PARAMETERS: ; ; OUTPUTS:res un tableau de dim x * y ; ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) ; 20/3/98 ; 18/6/1999 supression d''une horrible boucle ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ 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