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

Last change on this file since 238 was 238, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

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