source: trunk/SRC/Matrix/congridseb.pro @ 138

Last change on this file since 138 was 136, checked in by pinsard, 18 years ago

some improvements and corrections in some .pro file according to
aspell and idldoc log file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; @file_comments
6; Like congrid but here, it works...
7;        example:
8; IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4)
9;       1 1 1 2 2 2 3 3 3 3 4 4
10;       1 1 1 2 2 2 3 3 3 3 4 4
11;       5 5 5 6 6 6 7 7 7 7 8 8
12;       5 5 5 6 6 6 7 7 7 7 8 8
13; IDL> print, rebin([[1,2,3,4],[5,6,7,8]],12,4)
14;       1 1 1 2 2 2 3 3 3 4 4 4
15;       3 3 3 4 4 4 5 5 5 6 6 6
16;       5 5 5 6 6 6 7 7 7 8 8 8
17;       5 5 5 6 6 6 7 7 7 8 8 8
18; IDL> print, congridseb([[1,2,3,4],[5,6,7,8]],12,4)
19;       1 1 1 2 2 2 3 3 3 4 4 4
20;       1 1 1 2 2 2 3 3 3 4 4 4
21;       5 5 5 6 6 6 7 7 7 8 8 8
22;       5 5 5 6 6 6 7 7 7 8 8 8
23;
24; @categories utilities
25;
26; @param tableau {in}{required}
27; A table 1 ou 2d
28;
29; @param x {in}{required}
30; dimension in x of the result which must be
31; a multiple of the dimension in x of the table.
32;
33; @param y {in}{required}
34; dimension in y of the result which must be
35; a multiple of the dimension in y of the table.
36;
37; @returns
38; a table dim x * y
39;
40; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
41;                      20/3/98
42;                      18/6/1999 supression d''une horrible boucle
43;
44; @version $Id$
45;
46;-
47;------------------------------------------------------------
48;------------------------------------------------------------
49;------------------------------------------------------------
50function congridseb, tableau, x, y
51;
52  compile_opt idl2, strictarrsubs
53;
54   res=tableau
55   taille = size(tableau)
56   CASE N_PARAMS() OF
57      2: begin
58         res=replicate(1,1.*x/taille[1])#res[*]
59         return, res[*]
60      end
61      3: begin
62         res = transpose(res)
63         res = replicate(1, 1.*y/taille[2])#res[*]
64         res = reform(res, y, taille[1], /over)
65         res = transpose(res)
66         res = replicate(1, 1.*x/taille[1])#res[*]
67        return, reform(res, x,y, /overwrite)
68      end
69      else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB')
70   endcase
71end
Note: See TracBrowser for help on using the repository browser.