Ignore:
Timestamp:
03/19/07 18:15:51 (17 years ago)
Author:
pinsard
Message:

improvements/corrections of some *.pro headers

File:
1 edited

Legend:

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

    r163 r231  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    52; 
    63; @file_comments 
    7 ; Reading of a Net Cdf file with widgets !  
    8 ; 
    9 ; @categories  
     4; Reading of a Net Cdf file with widgets ! 
     5; 
     6; @categories 
    107; Widget 
    118; 
    12 ; @param NAME {in}{optional}{type=string}  
    13 ; It give the name of the file to be opened. If NAME  
    14 ; does not contain the separating character of directories ('/' under  
     9; @param NAME {in}{optional}{type=string} 
     10; It give the name of the file to be opened. If NAME 
     11; does not contain the separating character of directories ('/' under 
    1512; unix for example), the file will be looked for in the current directory. 
    1613; 
    1714; @keyword IODIR {type=string} 
    1815; It contains the directory where to go look for the file to be read. 
    19 ; If NAME does not contain the separating character of directories ('/' under  
     16; If NAME does not contain the separating character of directories ('/' under 
    2017; unix for example), the file will be called iodir+nom_fichier. 
    2118; 
     
    2926; The widget ID of the widget that calls XNCDF_LEC. When 
    3027; this ID is specified, a death of the caller results in a death 
    31 ; of XNCDF_LEC.  
     28; of XNCDF_LEC. 
    3229; 
    3330; @keyword OFFSET {type=vector}{default=[0, 0,...]} 
     
    3633; 
    3734; @keyword SHIFT {type=vector}{default=[0, 0,...]} 
    38 ; A vector of integers, specifying for each dimension how much we have to shift it.  
    39 ; By default, it is [0,0,...]. See the function shift for more explanations. BEWARE,  
    40 ; the shift is done on the biggest array before a possible reduction determined  
    41 ; by OFFSET and COUNT. On the other hand, it is done after the possible extraction  
     35; A vector of integers, specifying for each dimension how much we have to shift it. 
     36; By default, it is [0,0,...]. See the function shift for more explanations. BEWARE, 
     37; the shift is done on the biggest array before a possible reduction determined 
     38; by OFFSET and COUNT. On the other hand, it is done after the possible extraction 
    4239; created by the STRIDE. 
    4340; 
     
    5148;       1) None attribute has been selected. In this case, res is the array we 
    5249;       wanted to read. 
    53 ;       2) Some attributes has been selected. In this case, res is a structure  
    54 ;       whose the first element having the name of the variable is the values  
     50;       2) Some attributes has been selected. In this case, res is a structure 
     51;       whose the first element having the name of the variable is the values 
    5552;       array and the other arguments are the select arguments. 
    5653; 
     
    6865; $Id$ 
    6966;- 
    70 ;------------------------------------------------------------ 
    71 ;------------------------------------------------------------ 
    72 ;------------------------------------------------------------ 
     67; 
    7368FUNCTION xncdf_lec, name, ATT = att, COUNT = count, GROUP = group, OFFSET = offset, IODIR = iodir, SHIFT = shift,  STRIDE = stride, VAR = var 
    7469; 
     
    10398   mciodir = iodir 
    10499; We complete IODIR with a separating character if needed. 
    105    IF rstrpos(iodir, sep) NE strlen(iodir)-1 THEN iodir = iodir+sep  
     100   IF rstrpos(iodir, sep) NE strlen(iodir)-1 THEN iodir = iodir+sep 
    106101   if n_elements(name) EQ 0 then BEGIN ; If NAME is not defined, we find one thanks to the program dialog_pickfile. 
    107       name = dialog_pickfile(filter = iodir+'*.nc')  
     102      name = dialog_pickfile(filter = iodir+'*.nc') 
    108103      if name[0] EQ '' then return,  -1 ;If we do not have find anything, we go out. 
    109104;We complete NAME by IODIR if NAME does not contain any directory separating character. 
     
    132127;------------------------------------------------------------ 
    133128   base1 = widget_base(base, /column, /align_center) 
    134    rien = widget_label(base1, value = 'Net Cdf filename', /align_center)  
     129   rien = widget_label(base1, value = 'Net Cdf filename', /align_center) 
    135130   rien = widget_text(base1, value = name, /align_center, uvalue=1, /editable) ;File's name we can change 
    136131   rien = widget_label(base1, value = ' ') ; We jump a line 
     
    207202; 
    208203;+ 
     204; 
    209205; @file_comments 
    210206; Procedure called by xmanager when we press on a button of a second widget created by wid_var. 
    211 ;  
     207; 
    212208; @param EVENT {in}{required} 
    213209; A structure caracterizing the type of event which arrive to a widget number1 2 
     
    215211; @uses 
    216212; wididbase,resultat,infovariable,indicewid,motcle 
    217 ;  
     213; 
    218214; @version 
    219215; $Id$ 
    220216;- 
    221 ;------------------------------------------------------------ 
    222 ;------------------------------------------------------------ 
    223 ;------------------------------------------------------------ 
    224 pro wid_var_event,  event 
     217; 
     218PRO wid_var_event,  event 
    225219; 
    226220  compile_opt idl2, strictarrsubs 
     
    246240         if event.y GT (size(table))[2] then return 
    247241         if size(table[event.x, event.y], /type) GE 6 $ 
    248           OR size(table[event.x, event.y], /type) EQ 0 then BEGIN  
     242          OR size(table[event.x, event.y], /type) EQ 0 then BEGIN 
    249243            if event.x EQ 1 then $ 
    250244             widget_control, widbase1, use_table_select = [1, event.y,1, event.y] $ 
     
    347341; We redefine the command allowing to cut dimensions which has not been cut yet (ones we shift). 
    348342            commande = 'res=res[' ; initialization of the command 
    349             for dim = 0, varcontient.ndims-1 do BEGIN  
     343            for dim = 0, varcontient.ndims-1 do BEGIN 
    350344               if mcshift[dim] EQ 0 then commande = commande+'*,' $ 
    351345               ELSE commande=commande+string(mcoffset[dim])+':'+string(mccount[dim]+mcoffset[dim]-1)+',' 
     
    380374   return 
    381375end 
    382 ;------------------------------------------------------------ 
    383 ;------------------------------------------------------------ 
    384 ;------------------------------------------------------------ 
     376; 
    385377;+ 
     378; 
    386379; @file_comments 
    387 ; This procedure manage the second created whiget when we call xncdf_lec.  
     380; This procedure manage the second created whiget when we call xncdf_lec. 
    388381; This widget concern the reading of the variable. 
    389382; 
    390383; @param WIDID_PERE {type=scalar}{in}{required} 
    391 ; It contains the identity of the father widget which was  
     384; It contains the identity of the father widget which was 
    392385; created by xncdf_lec and which has allowed to select the variable to be read. 
    393386; 
    394387; OUTPUTS: indirectement res (le tableau ou la structure resultat) 
    395388; 
    396 ; @uses  
     389; @uses 
    397390; resultat,infovariable,indicewid_var,motcle 
    398391; 
     
    400393; $Id$ 
    401394;- 
    402 ;------------------------------------------------------------ 
    403 ;------------------------------------------------------------ 
    404 ;------------------------------------------------------------ 
     395; 
    405396PRO wid_var, widid_pere 
    406397; 
     
    416407   widbase = widget_base(/column, title='variable: '+varcontient.name, /align_center, group_leader = widid_pere) 
    417408;------------------------------------------------------------ 
    418 ; Opening of the base subwindow  
     409; Opening of the base subwindow 
    419410;------------------------------------------------------------ 
    420411; widbase1 array of offsets 
     
    457448   rien = widget_label(widbase, value = ' ') ; We jump a line 
    458449   widbase2 = widget_base(widbase, /column) 
    459 ; To each attribute, we created a widget (widbase21) containing in line a button  
    460 ; yes/no (widbase211), and two wigdet text (widbase212, widbase213) comprising the  
     450; To each attribute, we created a widget (widbase21) containing in line a button 
     451; yes/no (widbase211), and two wigdet text (widbase212, widbase213) comprising the 
    461452; name and the value of the attribute. 
    462453   widbase21 = lonarr(varcontient.natts) 
     
    492483   return 
    493484end 
    494 ;------------------------------------------------------------ 
    495  
    496 ;------------------------------------------------------------ 
    497 ;------------------------------------------------------------ 
    498 ;------------------------------------------------------------ 
     485; 
    499486;+ 
     487; 
    500488; @file_comments 
    501 ; Procedure called by xmanager when we press a button of the first widget  
     489; Procedure called by xmanager when we press a button of the first widget 
    502490; created by par xncdf_lec 
    503 ;  
     491; 
    504492; @param EVENT 
    505493; A structure caracterising the event type which arrive at the widget number 1. 
     
    511499; $Id$ 
    512500;- 
    513 ;------------------------------------------------------------ 
    514 ;------------------------------------------------------------ 
    515 ;------------------------------------------------------------ 
     501; 
    516502PRO xncdf_lec_event, event 
    517503; 
     
    531517;We call back xncdf_lec 
    532518         res = xncdf_lec(nom[0], ATT = mcatt, COUNT = mccount, OFFSET = mcoffset, IODIR = mciodir $ 
    533                          , SHIFT = mcshift,  STRIDE = mcstride, VAR = mcvar)  
     519                         , SHIFT = mcshift,  STRIDE = mcstride, VAR = mcvar) 
    534520         return 
    535521      END 
Note: See TracChangeset for help on using the changeset viewer.