source: trunk/SRC/ToBeReviewed/MATRICE/congridseb.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
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;------------------------------------------------------------
52function congridseb, tableau, x, y
53;
54  compile_opt idl2, strictarrsubs
55;
56   res=tableau
57   taille = size(tableau)
58   CASE N_PARAMS() OF
59      2: begin
60         res=replicate(1,1.*x/taille[1])#res[*]
61         return, res[*]
62      end
63      3: begin
64         res = transpose(res)
65         res = replicate(1, 1.*y/taille[2])#res[*]
66         res = reform(res, y, taille[1], /over)
67         res = transpose(res)
68         res = replicate(1, 1.*x/taille[1])#res[*]
69        return, reform(res, x,y, /overwrite)
70      end
71      else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB')
72   endcase           
73end
Note: See TracBrowser for help on using the repository browser.