source: trunk/SRC/Obsolete/extrait.pro @ 134

Last change on this file since 134 was 134, checked in by navarro, 18 years ago

change *.pro file properties (del eof-style, del executable, set keywords Id

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @fie-comments
7; extractoin of subdomains of matrixes; Even if the subdomain is "pierced" (see the example)
8; By default, IDL can make extractions of subdomain:
9;
10;      IDL> a=indgen(5,5)
11;      IDL> print, a
12;             0       1       2       3       4
13;             5       6       7       8       9
14;            10      11      12      13      14
15;            15      16      17      18      19
16;            20      21      22      23      24
17;      IDL> print, a[[0,2],3]
18;            15      17
19;      IDL> print, a[[0,2],*] 
20;             0       2
21;             5       7
22;            10      12
23;            15      17
24;            20      22
25; but
26;      IDL> print, a[[0,2],[3,4]]
27;            15      22
28; while
29;      IDL> print, extrait(a,[0,2],[3,4]) 
30;            15      17
31;            20      22
32;
33;
34; you better use extrac2
35;
36; @obsolete
37;
38; @categories utilities
39;
40; @param tab {in}{required} a 1,2,3 or 4 dim table
41;
42; @param indicex {in}{required} can have 2 forms:
43;              1)a vector containing indexes of lines we want to keep
44;              2)the string '*' if we want to keep all lines.
45;
46; @param indicey {in}{required} the same thing that indicex but for dim 2.
47;
48; @param indicez {in}{required} the same thing that indicex but for dim 3.
49;
50; @param indicet {in}{required} the same thing that indicex but for dim 4.
51;
52; @returns a matrix 1,2,3 or 4d extract from tab
53;
54; @restrictions res=-1 in case of mistake
55;
56;
57; @examples I have a dim 2 matrix named A. I want extract a small intersection
58;          matrix 2d of the line 2,3 and 7 and of the column 0 and 1:
59;     
60;      res=extrait(A,[2,3,7],[0,1])
61;
62;other ex:
63;      IDL> print, a
64;      a b c
65;      d e f
66;      g h i
67;      IDL> print, extrait(a,[0,2],[0,2])       
68;      a c
69;      g i
70;
71; @history Sebastien Masson (smasson@lodyc.jussieu.fr)
72;                       12/1/1999
73;                       29/4/1999: correction of a bug and complement of the heading
74;
75; @version $Id$
76;
77;-
78;------------------------------------------------------------
79;------------------------------------------------------------
80;------------------------------------------------------------
81FUNCTION extrait, tab, indicex, indicey, indicez, indicet
82;------------------------------------------------------------
83;
84  compile_opt idl2, strictarrsubs
85;
86  case n_params() of
87      0:return, extrac2()
88      1:return, extrac2(tab)
89      2:return, extrac2(tab, indicex)
90      3:return, extrac2(tab, indicex, indicey)
91      4:return, extrac2(tab, indicex, indicey, indicez)
92      5:return, extrac2(tab, indicex, indicey, indicez, indicet)
93  endcase
94end
Note: See TracBrowser for help on using the repository browser.