Ignore:
Timestamp:
07/10/06 17:20:19 (18 years ago)
Author:
pinsard
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Matrix/extrac2.pro

    r134 r136  
    44;+ 
    55; 
    6 ; @fie-comments  
    7 ; extractoin of subdomains of matrixes; Even if the subdomain is "pierced" (see the example) 
     6; @file_comments 
     7; extraction of subdomains of matrixes; 
     8; Even if the subdomain is "pierced" (see the example) 
    89; By default, IDL can make extractions of subdomain: 
    910; 
    10 ;      IDL> a=indgen(5,5)  
    11 ;      IDL> print, a  
     11;      IDL> a=indgen(5,5) 
     12;      IDL> print, a 
    1213;             0       1       2       3       4 
    1314;             5       6       7       8       9 
     
    1516;            15      16      17      18      19 
    1617;            20      21      22      23      24 
    17 ;      IDL> print, a[[0,2],3]  
     18;      IDL> print, a[[0,2],3] 
    1819;            15      17 
    19 ;      IDL> print, a[[0,2],*]   
     20;      IDL> print, a[[0,2],*] 
    2021;             0       2 
    2122;             5       7 
     
    2425;            20      22 
    2526; but 
    26 ;      IDL> print, a[[0,2],[3,4]]  
     27;      IDL> print, a[[0,2],[3,4]] 
    2728;            15      22 
    2829; while 
    29 ;      IDL> print, extrac2(a,[0,2],[3,4])   
     30;      IDL> print, extrac2(a,[0,2],[3,4]) 
    3031;            15      17 
    3132;            20      22 
     
    3334; @categories utilities 
    3435; 
    35 ; @param array {in}{required} a 1,2,3 or 4 dim input array 
     36; @param array {in}{required} 
     37; a 1,2,3 or 4 dim input array 
    3638; 
    37 ; @param index1 {in}{required} can have 2 forms: 
    38 ;              1)a vector containing indexes of lines we want to keep 
    39 ;              2)the string '*' if we want to keep all lines. 
     39; @param index1 {in}{required} 
     40; can have 2 forms: 
     41; 1)a vector containing indexes of lines we want to keep 
     42; 2)the string '*' if we want to keep all lines. 
    4043; 
    41 ; @param index2 {in}{required} the same thing that index1 but for dim 2. 
     44; @param index2 {in}{required} 
     45; the same thing that index1 but for dim 2. 
    4246; 
    43 ; @param index3 {in}{required} the same thing that index1 but for dim 3. 
     47; @param index3 {in}{required} 
     48; the same thing that index1 but for dim 3. 
     49; 
     50; @param index4 {in}{required} 
     51; the same thing that index1 but for dim 4. 
     52; 
     53; @returns 
     54; a matrix 1,2,3 or 4d extract from input array 
     55; 
     56; @restrictions 
     57; -1 in case of mistake 
     58; 
     59; @examples 
     60; I have a dim 2 matrix named A. I want extract a small intersection 
     61; matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 
    4462;  
    45 ; @param index4 {in}{required} the same thing that index1 but for dim 4. 
     63; IDL> res=extrac2(A,[2,3,7],[0,1]) 
    4664; 
    47 ; @returns a matrix 1,2,3 or 4d extract from input array 
     65; other ex: 
     66; IDL> print, a 
     67; a b c 
     68; d e f 
     69; g h i 
     70; IDL> print, extrac2(a,[0,2],[0,2]) 
     71; a c 
     72; g i 
    4873; 
    49 ; @restrictions res=-1 in case of mistake 
    50 ; 
    51 ;  
    52 ; @examples I have a dim 2 matrix named A. I want extract a small intersection  
    53 ;          matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 
    54 ;       
    55 ;      res=extrac2(A,[2,3,7],[0,1]) 
    56 ; 
    57 ;other ex: 
    58 ;      IDL> print, a  
    59 ;      a b c 
    60 ;      d e f 
    61 ;      g h i 
    62 ;      IDL> print, extrac2(a,[0,2],[0,2])         
    63 ;      a c 
    64 ;      g i 
    65 ; 
    66 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     74; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 
    6775;                       12/1/1999 
    6876;                       29/4/1999: correction of a bug and complement of the heading 
     
    8694   if n_params() NE taille[0]+1 THEN $ 
    8795    return, report('we need as many indexes as the number of dimensions of the input array') 
    88    IF n_params() GE 5 THEN BEGIN  
     96   IF n_params() GE 5 THEN BEGIN 
    8997      if size(index4,/type) EQ 7 then index4 = lindgen(taille[4]) $ 
    9098      ELSE index4 = long(index4) 
    91       nt = n_elements(index4)  
    92    ENDIF  
    93    IF n_params() GE 4 THEN BEGIN  
     99      nt = n_elements(index4) 
     100   ENDIF 
     101   IF n_params() GE 4 THEN BEGIN 
    94102      if size(index3,/type) EQ 7 then index3 = lindgen(taille[3]) $ 
    95103      ELSE index3 = long(index3) 
    96       nz = n_elements(index3)  
    97    ENDIF  
    98    IF n_params() GE 3 THEN BEGIN  
     104      nz = n_elements(index3) 
     105   ENDIF 
     106   IF n_params() GE 3 THEN BEGIN 
    99107      if size(index2,/type) EQ 7 then index2 = lindgen(taille[2]) $ 
    100108      ELSE index2 = long(index2) 
    101       ny = n_elements(index2)  
     109      ny = n_elements(index2) 
    102110   ENDIF 
    103    IF n_params() GE 2 THEN BEGIN  
     111   IF n_params() GE 2 THEN BEGIN 
    104112      if size(index1,/type) EQ 7 then index1 = lindgen(taille[1]) $ 
    105113      ELSE index1 = long(index1) 
    106       nx = n_elements(index1)  
     114      nx = n_elements(index1) 
    107115   ENDIF 
    108     
     116 
    109117;------------------------------------------------------------ 
    110118; construction of an array of indexes and of results following the size of array 
     
    115123         index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 
    116124         res = array[index] 
    117       END  
     125      END 
    118126      3:BEGIN 
    119127         index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 
     
    121129          +taille[1]*taille[2]*replicate(1, nx*ny)#index3 
    122130         res = array[reform(index, nx, ny, nz, /over)] 
    123       END  
     131      END 
    124132      4:BEGIN 
    125133         index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 
     
    129137          +taille[1]*taille[2]*taille[3]*replicate(1, nx*ny*nz)#index4 
    130138         res = array[reform(index, nx, ny, nz, nz, /over)] 
    131       END  
     139      END 
    132140   endcase 
    133141 
Note: See TracChangeset for help on using the changeset viewer.