;+ ; ; @file_comments ; extraction of subdomains of matrices; ; Even if the subdomain is "pierced" (see the example) ; By default, IDL can make extractions of subdomain: ; ; IDL> a=indgen(5,5) ; IDL> print, a ; 0 1 2 3 4 ; 5 6 7 8 9 ; 10 11 12 13 14 ; 15 16 17 18 19 ; 20 21 22 23 24 ; IDL> print, a[[0,2],3] ; 15 17 ; IDL> print, a[[0,2],*] ; 0 2 ; 5 7 ; 10 12 ; 15 17 ; 20 22 ; but ; IDL> print, a[[0,2],[3,4]] ; 15 22 ; while ; IDL> print, extrait(a,[0,2],[3,4]) ; 15 17 ; 20 22 ; ; ; you better use extrac2 ; ; @obsolete ; ; @categories ; Utilities ; ; @param tab {in}{required} ; a 1,2,3 or 4 dim table ; ; @param indicex {in}{required} ; can have 2 forms: ; 1)a vector containing indexes of lines we want to keep ; 2)the string '*' if we want to keep all lines. ; ; @param indicey {in}{required} ; the same thing that indicex but for dim 2. ; ; @param indicez {in}{required} ; the same thing that indicex but for dim 3. ; ; @param indicet {in}{required} ; the same thing that indicex but for dim 4. ; ; @returns ; a matrix 1,2,3 or 4d extract from tab ; -1 in case of mistake ; ; @examples ; I have a dim 2 matrix named A. I want extract a small intersection ; matrix 2d of the line 2,3 and 7 and of the column 0 and 1: ; ; IDL> res=extrait(A,[2,3,7],[0,1]) ; ; other ex: ; IDL> print, a ; a b c ; d e f ; g h i ; IDL> print, extrait(a,[0,2],[0,2]) ; a c ; g i ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 12/1/1999 ; 29/4/1999: correction of a bug and complement of the heading ; ; @version ; $Id$ ; ;- ; FUNCTION extrait, tab, indicex, indicey, indicez, indicet ; compile_opt idl2, strictarrsubs ; case n_params() of 0:return, extrac2() 1:return, extrac2(tab) 2:return, extrac2(tab, indicex) 3:return, extrac2(tab, indicex, indicey) 4:return, extrac2(tab, indicex, indicey, indicez) 5:return, extrac2(tab, indicex, indicey, indicez, indicet) endcase end