[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; NAME:CONGRIDSEB |
---|
| 6 | ; |
---|
| 7 | ; PURPOSE:meme chose que congrid mais qui marche ... |
---|
| 8 | ; cf par ex: |
---|
| 9 | ;IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) |
---|
| 10 | ; 1 1 1 2 2 2 3 3 3 3 4 4 |
---|
| 11 | ; 1 1 1 2 2 2 3 3 3 3 4 4 |
---|
| 12 | ; 5 5 5 6 6 6 7 7 7 7 8 8 |
---|
| 13 | ; 5 5 5 6 6 6 7 7 7 7 8 8 |
---|
| 14 | ;IDL> print, rebin([[1,2,3,4],[5,6,7,8]],12,4) |
---|
| 15 | ; 1 1 1 2 2 2 3 3 3 4 4 4 |
---|
| 16 | ; 3 3 3 4 4 4 5 5 5 6 6 6 |
---|
| 17 | ; 5 5 5 6 6 6 7 7 7 8 8 8 |
---|
| 18 | ; 5 5 5 6 6 6 7 7 7 8 8 8 |
---|
| 19 | ;IDL> print, congridseb([[1,2,3,4],[5,6,7,8]],12,4) |
---|
| 20 | ; 1 1 1 2 2 2 3 3 3 4 4 4 |
---|
| 21 | ; 1 1 1 2 2 2 3 3 3 4 4 4 |
---|
| 22 | ; 5 5 5 6 6 6 7 7 7 8 8 8 |
---|
| 23 | ; 5 5 5 6 6 6 7 7 7 8 8 8 |
---|
| 24 | ; |
---|
| 25 | ; CATEGORY:bidouille matrices |
---|
| 26 | ; |
---|
| 27 | ; CALLING SEQUENCE:res=congridseb(tableau,x[,y]) |
---|
| 28 | ; |
---|
| 29 | ; INPUTS:tableau:un tableau 1 ou 2d |
---|
| 30 | ; x:dim en x du resultat doit etre un multiple de dim en x de tableau |
---|
| 31 | ; y:dim en y du resultat doit etre un multiple de dim en y de tableau |
---|
| 32 | ; |
---|
| 33 | ; KEYWORD PARAMETERS: |
---|
| 34 | ; |
---|
| 35 | ; OUTPUTS:res un tableau de dim x * y |
---|
| 36 | ; |
---|
| 37 | ; COMMON BLOCKS: |
---|
| 38 | ; |
---|
| 39 | ; SIDE EFFECTS: |
---|
| 40 | ; |
---|
| 41 | ; RESTRICTIONS: |
---|
| 42 | ; |
---|
| 43 | ; EXAMPLE: |
---|
| 44 | ; |
---|
| 45 | ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
| 46 | ; 20/3/98 |
---|
| 47 | ; 18/6/1999 supression d''une horrible boucle |
---|
| 48 | ;- |
---|
| 49 | ;------------------------------------------------------------ |
---|
| 50 | ;------------------------------------------------------------ |
---|
| 51 | ;------------------------------------------------------------ |
---|
| 52 | function congridseb, tableau, x, y |
---|
| 53 | res=tableau |
---|
| 54 | taille = size(tableau) |
---|
| 55 | CASE N_PARAMS() OF |
---|
| 56 | 2: begin |
---|
| 57 | res=replicate(1,1.*x/taille[1])#res[*] |
---|
| 58 | return, res[*] |
---|
| 59 | end |
---|
| 60 | 3: begin |
---|
| 61 | res = transpose(res) |
---|
| 62 | res = replicate(1, 1.*y/taille[2])#res[*] |
---|
| 63 | res = reform(res, y, taille[1], /over) |
---|
| 64 | res = transpose(res) |
---|
| 65 | res = replicate(1, 1.*x/taille[1])#res[*] |
---|
| 66 | return, reform(res, x,y, /overwrite) |
---|
| 67 | end |
---|
| 68 | else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB') |
---|
| 69 | endcase |
---|
| 70 | end |
---|