Changeset 133 for trunk/SRC/Obsolete


Ignore:
Timestamp:
07/07/06 11:57:27 (18 years ago)
Author:
navarro
Message:

english and nicer header (1)

Location:
trunk/SRC/Obsolete
Files:
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Obsolete/extrait.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:extrait 
    65; 
    7 ; PURPOSE:extraction de sous domaines de matrices. Meme si le sous 
    8 ; domaine est "troue". cf. : l''exemple 
    9 ; Par defaut IDL peut faire des extractions de sous domaines: 
     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: 
    109; 
    1110;      IDL> a=indgen(5,5)  
     
    2423;            15      17 
    2524;            20      22 
    26 ; mais  
     25; but 
    2726;      IDL> print, a[[0,2],[3,4]]  
    2827;            15      22 
    29 ; alors que 
     28; while 
    3029;      IDL> print, extrait(a,[0,2],[3,4])   
    3130;            15      17 
    3231;            20      22 
    3332; 
    34 ; CATEGORY:bidouille avec les matrices 
    3533; 
    36 ; CALLING SEQUENCE:res=extrait(tab,indicex[,indicey[,indicez,[indicet]]]) 
     34; you better use extrac2 
    3735; 
    38 ; INPUTS: 
    39 ;        tab: un tableau 1,2,3 ou 4 d 
     36; @obsolete 
    4037; 
    41 ;        indicex: indicex peut avoir deux formes: 
    42 ;              1)un vecteur contenant les indices des lignes a garder 
    43 ;              2)le string '*' dans ce cas touts les lignes sont 
    44 ;              gardees 
     38; @categories utilities 
    4539; 
    46 ;        indicey/z/t: la meme chose que indicex mais pour les 
    47 ;        dimensions 2,3 et 4. 
     40; @param tab {in}{required} a 1,2,3 or 4 dim table 
    4841; 
    49 ;        rq: il faut autant de vecteurs indice que tab a de dimensions 
     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. 
    5045; 
    51 ; KEYWORD PARAMETERS: 
     46; @param indicey {in}{required} the same thing that indicex but for dim 2. 
    5247; 
    53 ; OUTPUTS: 
    54 ;         res: une matice 1,2,3 ou 4d extraite a partir de tab 
     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. 
    5551; 
    56 ; COMMON BLOCKS: 
     52; @returns a matrix 1,2,3 or 4d extract from tab 
    5753; 
    58 ; SIDE EFFECTS:res=-1 en cas d''erreur 
     54; @restrictions res=-1 in case of mistake 
    5955; 
    60 ; RESTRICTIONS: 
    61 ; 
    62 ; EXAMPLE: 
    63 ; j''ai une matrice A de dim 2. je veux en extraire une petite matrice 
    64 ; 2d interscetion de la ligne 2,3 et 7 et de la colonne 0 et 1 
     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: 
    6559;       
    6660;      res=extrait(A,[2,3,7],[0,1]) 
    6761; 
    68 ;autre ex: 
     62;other ex: 
    6963;      IDL> print, a  
    7064;      a b c 
     
    7569;      g i 
    7670; 
    77 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     71; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    7872;                       12/1/1999 
    79 ;                       29/4/1999: correction d''un bug et complement 
    80 ;                       de l''en-tete 
     73;                       29/4/1999: correction of a bug and complement of the heading 
     74; 
     75; @version $Id$ 
     76; 
    8177;- 
    8278;------------------------------------------------------------ 
     
    8884  compile_opt idl2, strictarrsubs 
    8985; 
    90    taille = size(tab) 
    91 ;------------------------------------------------------------ 
    92 ; test du nombre de parametres 
    93 ; et de la nature de indice (pour LE cas 'x') 
    94 ;------------------------------------------------------------ 
    95    if n_params() NE taille[0]+1 THEN $ 
    96     return, report('il faut autant d''indices que de dimension du tableau') 
    97    IF n_params() GE 5 THEN BEGIN  
    98       if size(indicet,/type) EQ 7 then indicet = lindgen(taille[4]) $ 
    99       ELSE indicet = long(indicet) 
    100       nt = n_elements(indicet)  
    101    ENDIF  
    102    IF n_params() GE 4 THEN BEGIN  
    103       if size(indicez,/type) EQ 7 then indicez = lindgen(taille[3]) $ 
    104       ELSE indicez = long(indicez) 
    105       nz = n_elements(indicez)  
    106    ENDIF  
    107    IF n_params() GE 3 THEN BEGIN  
    108       if size(indicey,/type) EQ 7 then indicey = lindgen(taille[2]) $ 
    109       ELSE indicey = long(indicey) 
    110       ny = n_elements(indicey)  
    111    ENDIF 
    112    IF n_params() GE 2 THEN BEGIN  
    113       if size(indicex,/type) EQ 7 then indicex = lindgen(taille[1]) $ 
    114       ELSE indicex = long(indicex) 
    115       nx = n_elements(indicex)  
    116    ENDIF 
    117     
    118 ;------------------------------------------------------------ 
    119 ; construction du tableau d''indice et du resultat suivant la taille 
    120 ; de tab 
    121 ;------------------------------------------------------------ 
    122   case taille[0] of 
    123       1:res = tab[indicex] 
    124       2:BEGIN 
    125          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    126          res = tab[indice] 
    127       END  
    128       3:BEGIN 
    129          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    130          indice = temporary(indice[*])#replicate(1, nz) $ 
    131           +taille[1]*taille[2]*replicate(1, nx*ny)#indicez 
    132          res = tab[reform(indice, nx, ny, nz, /over)] 
    133       END  
    134       4:BEGIN 
    135          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    136          indice = temporary(indice[*])#replicate(1, nz) $ 
    137           +taille[1]*taille[2]*replicate(1, nx*ny)#indicez 
    138          indice = temporary(indice[*])#replicate(1, nt) $ 
    139           +taille[1]*taille[2]*taille[3]*replicate(1, nx*ny*nz)#indicet 
    140          res = tab[reform(indice, nx, ny, nz, nz, /over)] 
    141       END  
    142    endcase 
    143  
    144  
    145 ;------------------------------------------------------------ 
    146 ;------------------------------------------------------------ 
    147    return, res 
     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 
    14894end 
  • trunk/SRC/Obsolete/zeroun.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:zeroun 
     5; @file_comments  
     6; Send back a vector or a matrix constituate of 0 and 1 in alternation 
    67; 
    7 ; PURPOSE:renvoie un vecteur ou une matrice constitue de o et de 1 en 
    8 ; alternance 
     8; you better use zero_one 
    99; 
    10 ; CATEGORY:function, matrices 
     10; @obsolete 
    1111; 
    12 ; CALLING SEQUENCE:resultat=zeroun(n1 [,n2]) 
     12; @categories function, matrixes 
    1313; 
    14 ; INPUTS: 
    15 ;       n1=nombre d'elements dans la premiere dimension 
    16 ;       n2=nombre d'elements dans la deuxieme dimension 
     14; @param n1 {in}{required} number of elements in the first dimension 
     15; @param n2 {in}{required} numbre of elements in the second dimension 
    1716; 
    18 ; KEYWORD PARAMETERS: 
     17; @returns resultat 
     18;  
     19; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     20;                       1/12/98 
    1921; 
    20 ; OUTPUTS:resultat 
     22; @version $Id$ 
    2123; 
    22 ; COMMON BLOCKS: 
    23 ; 
    24 ; SIDE EFFECTS: 
    25 ; 
    26 ; RESTRICTIONS: 
    27 ; 
    28 ; EXAMPLE: 
    29 ; 
    30 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    31 ;                       1/12/98 
    3224;- 
    3325;------------------------------------------------------------ 
     
    3830  compile_opt idl2, strictarrsubs 
    3931; 
    40    CASE N_PARAMS() OF 
    41       1:return, findgen(n1) mod 2 
    42       2:BEGIN  
    43          if fix(n1/2) EQ n1/2. then BEGIN ;nombre pair de colonnes 
    44             res = findgen(n1+1,n2) mod 2 
    45             return, res[0:n1-1, *] 
    46          ENDIF ELSE return, findgen(n1,n2) mod 2 ;nombre impair de colonnes 
    47       END 
    48       else: return,  report('Mauvais nombre de parametre dans l''appel de ZEROUN') 
    49    endcase             
     32  case n_params() of 
     33      0:return, zero_one() 
     34      1:return, zero_one(n1) 
     35      2:return, zero_one(n1, n2) 
     36  endcase 
     37 
    5038end 
Note: See TracChangeset for help on using the changeset viewer.