Ignore:
Timestamp:
07/21/06 14:47:49 (18 years ago)
Author:
navarro
Message:

english and nicer header (2a)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/LECTURE/ncdf_lec.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:ncdflec 
    65; 
    7 ; PURPOSE:donne des infos sur un fichier netcdf et permet de recupere 
    8 ; les variables qui y sont ecrites  
     6; @file_comments 
     7; Give informations on a file net cdf and allows to recuperate  
     8; variables which are write in. 
    99; 
    10 ; CATEGORY:lecture de fichiers netcdf 
     10; @categories 
     11; Reading 
    1112; 
    12 ; CALLING SEQUENCE: res=ncdflec('nom_de _fichier') 
     13; @param NOM {in}{required} 
     14; Name of a file net cdf situated in the directory stipulated by iodir. 
    1315; 
    14 ; INPUTS:nom_de _fichier:nom d'un fichier net cdf situe ds e repertoire 
    15 ; stipule par iodir 
     16; @keyword ATT 
     17; 'global' or at the name of a variable. Allows to see all attributes  
     18; joined at a variable 
    1619; 
    17 ; KEYWORD PARAMETERS: 
     20; @keyword DIM 
     21; Give the list of dimensions. 
    1822; 
    19 ;       ATT: 'global' ou au nom d'une variable. permet de voir tous les 
    20 ; attributs rattaches a une variable. 
     23; @keyword VAR 
     24;       1) /var: Gove the list of dimensions. 
     25;       2) var='nom de variable': in this case the function send back the variable. 
    2126; 
    22 ;       /DIM:donne la liste des dimensions 
     27; @keyword IODIR 
     28; String containing the directory containing the file to be read 
    2329; 
    24 ;       VAR: 
    25 ;       1) /var: donne la liste des variables 
    26 ;       2) var='nom de variable': ds ce cas la fonction retourne la variable 
     30; @keyword _EXTRA 
     31; Allows to pass keywords defined by IDL to functions NETCDF ( particularly OFFSET  
     32; and COUNT in ncdf_varget) 
    2733; 
    28 ;       IODIR: string contenant le repertoire ou aller chercher le 
    29 ;       fichier a lire. 
     34; @returns 
     35; -1 (exept if var='nom de variable', then the function send back the variable). 
    3036; 
    31 ;       _EXTRA: permet de passer les mots cles definits par IDL pour 
    32 ;       les fonction NETCDF (en particulier OFFSET et COUNT ds ncdf_varget) 
     37; @restrictions 
     38; Variables's names of the program are similar to these used by the IDL manual  
     39; 'scientific data formats' 
    3340; 
    34 ; OUTPUTS:-1 sauf si var='nom de variable' auquel cas la fonction retourne la variable 
     41; @history 
     42; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     43;                       4/1/98 
    3544; 
    36 ; REMARQUE:les noms des variables du programme sont similaires a ceux employes 
    37 ; ds le manuel IDL 'scientific data formats' 
     45; @version 
     46; $Id$ 
    3847; 
    39 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    40 ;                       4/1/98 
    4148;- 
    4249;------------------------------------------------------------ 
     
    5764   endif 
    5865;------------------------------------------------------------ 
    59 ; ouverture du fichier nom 
     66; opening of the file name. 
    6067;------------------------------------------------------------ 
    6168   cdfid=ncdf_open(iodir+nom) 
    6269;------------------------------------------------------------ 
    63 ; que contient le fichier?? 
     70; Wht does the file contain?? 
    6471;------------------------------------------------------------ 
    6572   wathinside=ncdf_inquire(cdfid) 
    66 ;   print,'dans le fichier, ',iodir+nom,', il y a:' 
     73;   print,'in the file, ',iodir+nom,', there are:' 
    6774   if keyword_set(dim) then begin  
    6875      print,'nombre de dimensions: ',strtrim(wathinside.ndims,1) 
     
    7683   endif 
    7784;------------------------------------------------------------ 
    78 ; attributs globaux 
     85; Global attributes 
    7986;------------------------------------------------------------ 
    8087   if keyword_set(att) then begin 
     
    8289      print,'ATTRIBUTS GLOBAUX' 
    8390      for attiq=0,wathinside.ngatts-1 do begin 
    84          name=ncdf_attname(cdfid,attiq,/global) ;nom de l''atribut 
    85          ncdf_attget,cdfid,name,value,/global ;valeur de l''atribut 
     91         name=ncdf_attname(cdfid,attiq,/global) ;attribute's name 
     92         ncdf_attget,cdfid,name,value,/global ;attribute's value 
    8693         print,name,': ',string(value) 
    8794      endfor 
     
    8996nonglobal: 
    9097;------------------------------------------------------------ 
    91 ; affichage des differentes dimensions 
     98; Display of different dimensions. 
    9299;------------------------------------------------------------ 
    93100   if keyword_set(dim) then begin  
     
    98105   tailledim=lonarr(wathinside.ndims) 
    99106   for dimiq=0,wathinside.ndims-1 do begin 
    100       ncdf_diminq,cdfid,dimiq,name,value ; nom et valeur de la dimension 
     107      ncdf_diminq,cdfid,dimiq,name,value ; dimension's name and value 
    101108      nomdim[dimiq]=name 
    102109      tailledim[dimiq]=value 
     
    107114   endfor 
    108115;------------------------------------------------------------ 
    109 ; affichage des differentes variables 
     116; Display of different variables. 
    110117;------------------------------------------------------------ 
    111118; 
    112119   if keyword_set(att) or keyword_set(var) then begin  
    113 ; vature de var ? string ou 1 
     120; var's value? string or 1 
    114121   help, var, output = nature 
    115122   if (strpos(nature, 'STRING'))[0] NE -1 then nature = 'string' ELSE nature = '1' 
    116 ; si on doit juste lire la variable 
     123; If we just have to read the variable. 
    117124   if nature EQ 'string' then begin 
    118125      ncdf_varget, cdfid, var, res, _extra = ex 
    119126      GOTO, sortie 
    120127   ENDIF  
    121 ; si c''est pour avoir des renseignements 
     128; If it is to have pieces of information. 
    122129   if not keyword_set(att) then att='rien' 
    123130      print, '----------------------------' 
    124131      for varid=0,wathinside.nvars-1 do begin 
    125          varcontent=ncdf_varinq(cdfid,varid) ; que contient la variable 
     132         varcontent=ncdf_varinq(cdfid,varid) ; What does variable contain?? 
    126133         if strlowcase(att) eq strlowcase(varcontent.name) or keyword_set(var) $ 
    127134          then begin 
Note: See TracChangeset for help on using the changeset viewer.