Ignore:
Timestamp:
08/09/06 12:12:54 (18 years ago)
Author:
navarro
Message:

english and nicer header (3a)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/TRIANGULATION/tracemask.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:tracemask 
    65; 
    7 ; PURPOSE:dessiner des contour d''un mask 
     6; @file_comments 
     7; Draw contours of a mask 
    88; 
    9 ; CATEGORY:plus simple que tracecote, car ne s''occuppe pas du type de 
    10 ; projection et de la periodicite de la grille 
     9; @categories 
     10; utilities 
     11;  
     12; @param MASKENTREE {in}{required} 
     13; 2d array specifing the mask 
     14;  
     15; @param XIN {in}{required}, 
     16; 2d array specifing longitude coordinates. 
     17;  
     18; @param YIN {in}{required}, 
     19; 2d array specifing latitude coordinates. 
    1120; 
    12 ; CALLING SEQUENCE: tracemask, maskentree, xentree, yentree 
    13 ;  
    14 ; INPUTS:maskentree, xentree, yentree tableaux 2d specifiant le mask 
    15 ; et ses coordonees en longitude te latitude. 
     21; @keyword COAST_COLOR 
     22; The color of the coastline. 
     23; defaut value is 0 => black 
    1624; 
    17 ; KEYWORD PARAMETERS: 
     25; @keyword COAST_THICK 
     26; The thick of the trait to trace continents 
     27; It is 1 by default. 
    1828; 
    19 ;        COAST_COLOR: the color of the coastline. 
    20 ;                     defaut value is 0 => black 
     29; @keyword OVERPLOT 
     30; To do a plot over an other one. 
    2131; 
    22 ;        COAST_THICK: l''epaisseur du trait pour tracer les 
    23 ;        continents. par defaut c''est 1. 
     32; @keyword _EXTRA 
     33; used to pass your keywords 
    2434; 
    25 ; OUTPUTS: none 
     35; @uses 
     36; common.pro 
    2637; 
    27 ; COMMON BLOCKS:common.pro 
     38; @history 
     39; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    2840; 
    29 ; SIDE EFFECTS: 
    30 ; 
    31 ; RESTRICTIONS: 
    32 ; 
    33 ; EXAMPLE: 
    34 ; 
    35 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     41; @version 
     42; $Id$ 
    3643; 
    3744;- 
     
    5158  ENDIF 
    5259;---------------------------------------------------------  
    53    tempsun = systime(1)         ; pour key_performance 
    54 ; on s''afranchit des problemes de bord: 
    55    tempdeux = systime(1)        ; pour key_performance =2 
     60   tempsun = systime(1)         ; For key_performance 
     61; We avoid edging problems: 
     62   tempdeux = systime(1)        ; For key_performance =2 
    5663   tailleentree = size(maskentree) 
    5764   nx = tailleentree[1]+1 
     
    6269  IF n_elements(yin) EQ 0 THEN yentree = findgen(ny-1) ELSE yentree = yin 
    6370  IF (size(yentree))[0] EQ 1 THEN yentree = replicate(1,nx-1)#yentree 
    64 ; on agrandi le mask de une colonne a gauche et de une colonne en bas 
     71; We enlarge the mask by 1 column to the left an d1 line to the bottom 
    6572   mask = intarr(tailleentree[1]+1, tailleentree[2]+1) 
    6673   mask[1:tailleentree[1], 1:tailleentree[2]] = maskentree 
    67 ; les 2 premieres colonnes sont identiques 
     74; The 2 first columns are identical. 
    6875   mask[0, 1:tailleentree[2]] = maskentree[0, *] 
    69 ; les 2 premieres lignes sont identiques 
     76; The 2 first lines are identical. 
    7077   mask[1:tailleentree[1], 0] = maskentree[*, 0] 
    71 ; on calcul la position suivant x des points qui seviront a tracer le 
    72 ; masque. ils sont situes entre chaque points du masque, sauf pour la 
    73 ; derniere colonne que l''on ne peut pas calculer et que l''on met 
    74 ; donc a max(!x.range) 
    75    xrange = !x.range[sort(!x.range)] ; si reverse_x est utilise! 
     78; We calculate the position following x of points which will serve to trace the mask. They are situated between each points of the mask, exept for the last column we can not calculate and so we put at max (!x.range). 
     79   xrange = !x.range[sort(!x.range)] ; if REVERSE_X is used 
    7680   xentree = .5*(xentree+shift(xentree, -1, 0)) 
    7781   IF not keyword_set(overplot) THEN xentree[nx-2, *] = xrange[1] $ 
    7882   ELSE xentree[nx-2, *] = xentree[nx-3, *] 
    79 ; on seuil 
     83; we sill 
    8084   xentree = xrange[0] > xentree < xrange[1] 
    81 ; on agrandit le tableau 
     85; we enlarge the array  
    8286   xf = fltarr(nx, ny) 
    8387   xf[1:nx-1, 1:ny-1] = xentree 
     
    103107    print, 'temps tracemask: determination du mask et des ses coordonnes', systime(1)-tempdeux 
    104108; 
    105 ; on trace les segments verticaux: 
     109; We trace vertical segments: 
    106110; 
    107    tempdeux = systime(1)        ; pour key_performance =2 
     111   tempdeux = systime(1)        ; For key_performance =2 
    108112   liste = where(mask+shift(mask, -1, 0) EQ 1) 
    109113   IF liste[0] NE -1 THEN BEGIN 
    110 ; on recupere lx et ly qui sont les indices ds un tableau 2d des 
    111 ; points donnes par liste 
     114; We recuperate lx and ly which are indexes in a 2d array of points given by list 
    112115      ly = liste/nx & lx = temporary(liste)-nx*ly 
    113       indice = where(ly NE 0)   ; on ne prend pas les points concernant  
    114 ; la premiere ligne car ds ce cas le pt j-1 n''est pas definit 
     116      indice = where(ly NE 0) ; We do not take points concernining  
     117; the first line because in this case, the point j-1 is not defined  
    115118      if indice[0] NE -1 then begin 
    116119         lx = lx[indice] & ly = ly[temporary(indice)] 
    117120         IF testvar(var = key_performance) EQ 2 THEN $ 
    118121          print, 'temps tracemask: liste traits verticaux', systime(1)-tempdeux 
    119          tempdeux = systime(1)  ; pour key_performance =2 
    120 ; boucle sur les points concernes et trace du segment 
    121 ; rq: on utilise plots au lieu de plot car plots est bcp plus rapide. 
     122         tempdeux = systime(1)  ; For key_performance =2 
     123; loop on concerned points and drawing of the segment. 
     124; comments: we use plots instead of plot because plots is faster. 
    122125         for pt = 0L, n_elements(lx)-1 do BEGIN  
    123126            i = lx[pt] & j = ly[pt] 
     
    132135   ENDIF 
    133136; 
    134 ; on trace les segments horizontaux: 
     137; We trace horizontal segments: 
    135138; 
    136    tempdeux = systime(1)        ; pour key_performance =2 
     139   tempdeux = systime(1)        ; For key_performance =2 
    137140   liste = where(mask+shift(mask, 0, -1) EQ 1) 
    138141   IF liste[0] NE -1 THEN BEGIN 
    139142      ly = liste/nx & lx = temporary(liste)-nx*ly 
    140       indice = where(lx NE 0)   ; on ne prend pas les points de la  premiere colonne 
     143      indice = where(lx NE 0)   ; We do not take point sof the first column. 
    141144      if indice[0] EQ -1 then return 
    142145      lx = lx[indice] & ly = ly[temporary(indice)] 
    143146      IF testvar(var = key_performance) EQ 2 THEN $ 
    144147       print, 'temps tracemask: liste traits horizontaux', systime(1)-tempdeux 
    145       tempdeux = systime(1)     ; pour key_performance =2 
     148      tempdeux = systime(1)     ; For key_performance =2 
    146149      for pt = 0L, n_elements(lx)-1 do BEGIN  
    147150         i = lx[pt] & j = ly[pt] 
Note: See TracChangeset for help on using the changeset viewer.