Changeset 150 for trunk/SRC


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

english and nicer header (3a)

Location:
trunk/SRC
Files:
74 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Calendar/daysinmonth.pro

    r137 r150  
    1313; key_caltype = 'greg'. In that case, month and year must have the same 
    1414; number of elements. 
     15; 
     16; @param  
    1517; 
    1618; @returns  
  • trunk/SRC/ReadWrite/read_grads.pro

    r136 r150  
    3838; default value is common variable iodir 
    3939; 
    40 ; @todo 
    4140;--------------- 
    4241; NOT yet available 
  • trunk/SRC/ToBeReviewed/CALCULS/curl.pro

    r142 r150  
    4444;                      adaptation pour marcher avec un domaine reduit 
    4545; 
    46 ;                      21/5/1999: valeurs manquantes a !values.f_nan 
     46;                      21/5/1999: missing values at !values.f_nan 
    4747;periodicite  
    4848;  
  • trunk/SRC/ToBeReviewed/IMAGE/animgif.pro

    r142 r150  
    2525; 
    2626; @restrictions  
    27 ; If we want to delete the \ @common, 
     27; If we want to delete the \@common, 
    2828;               we have to define manually the picture's size  
    2929;               (variables xsize and ysize) just as iodir. 
  • trunk/SRC/ToBeReviewed/LECTURE/GRIB/bit2int.pro

    r134 r150  
     1;+ 
     2; 
     3; @todo 
     4; seb 
     5; 
     6;- 
    17FUNCTION bit2int, bitin, checkneg = checkneg 
    28; 
  • trunk/SRC/ToBeReviewed/LECTURE/read_ftp.pro

    r142 r150  
    3838;+ 
    3939; 
    40 ; Syntax: 
     40; @file_comments 
    4141;   READ_FTP, remote_host [, files] [, directory] [,/FILE] [,DATA=variable] 
    4242;              [,USER=string] [,PASS=string] [,/PTR] 
     
    118118; $Id$ 
    119119; 
    120 ; @todo seb: que fait-on de "syntax" au debut du header? 
     120; @todo  
     121; seb: que fait-on de "syntax" au debut du header? 
     122; give examples with date in year 0 (should not exists but may happen) 
    121123;  
    122124;- 
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro

    r142 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; 
    6 ; PURPOSE:fonction de lecture pour fichier net_cdf. 
    7 ; Ce programme, est moins universel que ncdf_lec (il fait appelle au 
    8 ; variables declarees dans common.pro) mais il est du cop bcp plus 
    9 ; facile d''utilisation. Il prend en compte la declaration des 
    10 ; differents zoom qui ont ete definis (ixminmesh...premierx...) la 
    11 ; declaration de la variable key_shift... bref le resultat de 
    12 ; read_ncdf peut dorectement etre utilise dans plt... 
    13 ; C''est aussi ce programme qui est utilise par defaut dans mes 
    14 ; widgets pour la partie lecture. 
    15 ; 
    16 ; CATEGORY:lecture de fichiers NetCdf 
    17 ; 
    18 ; CALLING SEQUENCE:res = read_ncdf(name,debut[,fin]) 
    19 ;  
    20 ; INPUTS: name: un string definissant le champ a lire. 
    21 ;         debut et fin: sont relatifs a l''axe des temps. Ce peut etre 
    22 ;         - 2 dates du type yyyymmdd et ds ce cas on selectionne les 
    23 ;         dates qui sont comprisent entre ces 2 dates. 
    24 ;         - 2 indices qui definissent entre quel et quel pas de temps 
    25 ;           on doit extraire la dimension temporelle. 
    26 ;         exp: ne sert a rien! 
    27 ; 
    28 ; KEYWORD PARAMETERS: utilisables hors du contexte des widgets 
    29 ; 
    30 ;        BOXZOOM: contient la boxzoom sur laquelle on doit faire la 
    31 ;        lecture 
    32 ;        FILENAME: string contennant le nom du fichier 
    33 ;        /INIT; to call automatically initncdf, filename and thus 
    34 ;        redefine all the grid parameters 
    35 ;        GRID='[UTVWF]' to specify the type of grid. Defaut is (1) 
    36 ;        based on the name of the file if the file ends by 
    37 ;        GRID[._][TUVFW].NC (not case sensible) or (2) T if case (1) 
    38 ;        is not found. 
    39 ;        IODIRECTORY;a string giving the name of iodirectory (see 
    40 ;        isafile.pro for all possibilities). default value is common  
    41 ;        variable iodir 
    42 ;        TIMESTEP:activer pour specifier que debut et fin font 
    43 ;        reference a des indices de l''axe du temps et non pas a des 
    44 ;        dates.  
    45 ;        TOUT: activer si on veut lire le ficher sur l''ensemble du 
    46 ;        domaine sans tenir compte du sous domaine definit par boxzoom 
    47 ;        ou lon1,lon2,lat1,lat2,vert1,vert2. 
    48 ;        NOSTRUCT: activer si on ne veut pas que read_ncdf reourne 
    49 ;        une structure mais uniquement le tableau se rapportant au 
    50 ;        champ.  
    51 ;        TIMEVAR: a string to define the name of the variable that 
    52 ;        contains the time axis. This keyword can be usefull if there 
    53 ;        is no unlimited dimension or if the time axis selected by defaut 
    54 ;        (the first 1D array with unlimited dimension) is not the good one 
    55 ;  
    56 ; 
    57 ; OUTPUTS:une stucture lisible par litchamp.pro ou un simple tableau 
    58 ; si /NOSTRUCT est active  
    59 ; 
    60 ; COMMON BLOCKS:common.pro 
    61 ; 
    62 ; SIDE EFFECTS: 
    63 ; 
    64 ; RESTRICTIONS:le champ doit avoir une dimension temporelle 
    65 ; 
    66 ; EXAMPLE: 
    67 ; 
    68 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    69 ;                      15/10/1999 
     2; @file_comments 
     3; Reading function for the file net_cdf. 
     4; This program is less universal than ncdf_lec (it appeal to declarated  
     5; variables in common.pro) but it is very easier to be used. It considerate 
     6; the declaration of the different zooms which have been defined 
     7; (ixminmesh...premierx...), the declaration of the variable key_shift... 
     8; To put it in a nutshell, the result of read_ncdf can be directly used in plt... 
     9; This is also this program which is used by default inour reading widgets.   
     10; 
     11; @categories 
     12; reading 
     13; 
     14;  
     15; @param NAME {in}{required} 
     16; It is a string defining the field to be read. 
     17; 
     18; @param BEGINNING {in}{required} 
     19; Relative with the time axis. 
     20; These can be 
     21;  - 2 date of the  type yyyymmdd and in this case, we select dates  
     22;  which are included between these two dates. 
     23;  - 2 indexes which define between which and which time step we have  
     24;  to extract the telporal dimension. 
     25; 
     26; @param ENDING  {in}{required} 
     27; Relative with the time axis. 
     28; See BEGINNING. 
     29;  
     30; @param COMPATIBILITY {in}{required} 
     31; Useless 
     32 
     33; @keyword BOXZOOM  
     34; Contain the boxzoom on which we have to do the reading  
     35;  
     36; @keyword FILENAME 
     37; It is a string containing the file's name. 
     38;  
     39; @keyword INIT 
     40; To call automatically initncdf, filename and thus 
     41; redefine all the grid parameters 
     42;  
     43; @keyword GRID 
     44; ='[UTVWF]' to specify the type of grid. Defaut is (1) 
     45; based on the name of the file if the file ends by 
     46; GRID[._][TUVFW].NC (not case sensible) or (2) T if case (1) 
     47; is not found. 
     48;  
     49; @keyword  IODIRECTORY 
     50; It isa string giving the name of iodirectory (see isafile.pro  
     51; for all possibilities). default value is common variable iodir. 
     52;  
     53; @keyword TIMESTEP 
     54; We activate to specify that BEGINNING and ENDING refer to indexes 
     55; of the time axis and not to dates 
     56; 
     57; @keyword TOUT 
     58; We activate it if we want to read the file on the whole domain without  
     59; considerate the sub-domain defined by the boxzoom or  
     60; lon1,lon2,lat1,lat2,vert1,vert2. 
     61;  
     62; @keyword NOSTRUCT 
     63; We activate it if we do not want that read_ncdf send back a structure  
     64; but only the array refering to the field. 
     65;  
     66; @keyword TIMEVAR 
     67; It is a string which define the name of the variable that 
     68; contains the time axis. This keyword can be usefull if there 
     69; is no unlimited dimension or if the time axis selected by defaut 
     70; (the first 1D array with unlimited dimension) is not the good one. 
     71; 
     72; @keyword _EXTRA 
     73; Used to pass your keywords  
     74; 
     75; @returns 
     76; Structure readable by litchamp.pro or an array if NOSRUCT is activated. 
     77;  
     78; @uses 
     79; common.pro 
     80;  
     81; @restrictions 
     82; The field must have a temporal dimension. 
     83;  
     84; @history 
     85; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     86;                      15/10/1999  
     87;  
     88; @version 
     89; $Id$  
    7090;- 
    71 ;------------------------------------------------------------ 
    72 ;------------------------------------------------------------ 
    73 ;------------------------------------------------------------ 
    74 FUNCTION read_ncdf, name, debut, fin, pour_etre_compatible, BOXZOOM = boxzoom, FILENAME = filename $ 
     91;--------------------------------------------------------- 
     92;--------------------------------------------------------- 
     93;--------------------------------------------------------- 
     94 
     95FUNCTION read_ncdf, name, beginning, ending, compatibility, BOXZOOM = boxzoom, FILENAME = filename $ 
    7596                    , PARENTIN = parentin, TIMESTEP = timestep, TIMEVAR = timevar $ 
    7697                    , TOUT = tout, NOSTRUCT = nostruct, CONT_NOFILL = CONT_NOFILL, INIT = init $ 
     
    98119  filename = isafile(filename = filename, IODIRECTORY = iodir, _EXTRA = ex) 
    99120;------------------------------------------------------------ 
    100 ; ouverture du fichier nom 
     121; Opening of the name file 
    101122;------------------------------------------------------------ 
    102123  if size(filename, /type) NE 7 then $ 
     
    118139  if keyword_set(init) THEN initncdf, filename, _extra = ex 
    119140;------------------------------------------------------------ 
    120 ; check the time axis and the debut and fin dates 
    121 ;------------------------------------------------------------ 
    122   if n_elements(debut) EQ 0 then begin 
    123     debut = 0 
     141; check the time axis and the debut and ending dates 
     142;------------------------------------------------------------ 
     143  if n_elements(beginning) EQ 0 then begin 
     144    beginning = 0 
    124145    timestep = 1 
    125146  endif 
    126147  if keyword_set(timestep) then begin 
    127     firsttps = debut[0] 
    128     if n_elements(fin) NE 0 then lasttps = fin[0] ELSE lasttps = firsttps 
     148    firsttps = beginning[0] 
     149    if n_elements(ending) NE 0 then lasttps = ending[0] ELSE lasttps = firsttps 
    129150    jpt = lasttps-firsttps+1 
    130151    time = julday(1, 1, 1) + lindgen(jpt) 
     
    136157      currentfile = (where(filelist EQ filename))[0] 
    137158      time = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).time_counter 
    138       date1 = date2jul(debut[0]) 
    139       if n_elements(fin) NE 0 then date2 = date2jul(fin[0]) ELSE date2 = date1 
     159      date1 = date2jul(beginning[0]) 
     160      if n_elements(ending) NE 0 then date2 = date2jul(ending[0]) ELSE date2 = date1 
    140161      firsttps = where(time EQ date1) & firsttps = firsttps[0] 
    141162      lasttps = where(time EQ date2) & lasttps = lasttps[0] 
     
    159180; we find the FIRST time axis       
    160181        timeid = 0 
    161         repeat BEGIN       ; tant que l''on a pas trouve une variable qui n''a qu'' 
    162                                 ; une dimension: la dimension infinie 
    163           timecontient = ncdf_varinq(cdfid, timeid) ; que contient la variable 
     182        repeat BEGIN       ; As long as we have not find a variable having only one dimension: the infinite one 
     183          timecontient = ncdf_varinq(cdfid, timeid) ; that the variable contain. 
    164184          timeid = timeid+1 
    165185        endrep until (n_elements(timecontient.dim) EQ 1 $ 
     
    188208; 
    189209; now we try to find the attribut called calendar... 
    190 ; the the attribute "calendar" exists? 
     210; the attribute "calendar" exists? 
    191211; If no, we suppose that the calendar is gregorian calendar 
    192212; 
     
    248268        end 
    249269      ENDCASE 
    250       date1 = date2jul(debut[0]) 
    251       if n_elements(fin) NE 0 then date2 = date2jul(fin[0]) ELSE date2 = date1 
     270      date1 = date2jul(beginning[0]) 
     271      if n_elements(ending) NE 0 then date2 = date2jul(ending[0]) ELSE date2 = date1 
    252272      time = double(time) 
    253273      firsttps = where(time GE date1) & firsttps = firsttps[0] 
     
    271291  ENDELSE 
    272292;------------------------------------------------------------ 
    273 ; nom de la grille a laquelle se rapporte le champ 
     293; Name of the grid on which the field refer to. 
    274294;------------------------------------------------------------ 
    275295  IF keyword_set(grid) THEN vargrid = strupcase(grid) ELSE BEGIN 
     
    294314 
    295315;--------------------------------------------------------------- 
    296 ; redefinition du domaine  
     316; redefinition of the  domain 
    297317;--------------------------------------------------------------- 
    298318  if keyword_set(tout) then begin 
     
    331351    ENDIF 
    332352    grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz 
    333     undefine, glam & undefine, gphi & ; on libere un peu de memoire! 
     353    undefine, glam & undefine, gphi & ; We liberate some memoty! 
    334354  ENDELSE 
    335355;--------------------------------------------------------------------- 
    336 ; on initialise les ixmindta, iymindta au besoin 
     356; We initializate ixmindta, iymindta if needed 
    337357;--------------------------------------------------------------------- 
    338358  if n_elements(jpidta) EQ 0 THEN jpidta = jpiglo 
     
    352372  IF izmaxdta EQ -1 then izmaxdta = jpkdta-1 
    353373;---------------------------------------------------------------- 
    354 ; on va lire le fichier 
     374; We will read the file 
    355375;--------------------------------------------------------------- 
    356376  if n_elements(key_stride) LE 2 then key_stride = [1, 1, 1] 
     
    401421    AND (strupcase(vargrid) EQ 'U' OR strupcase(vargrid) EQ 'F') THEN key_shift =  key_shift+1 
    402422;--------------------------------------------------------------------- 
    403 ; on definit les variables globales rattachees a la variable 
     423; We define global variable joined with the variable. 
    404424;--------------------------------------------------------------------- 
    405425; varname 
     
    434454  ENDELSE 
    435455; vardate 
    436 ; on construit une belle date lisible en fonction du langage specifie !!! 
    437   year = long(debut[0])/10000 
    438   month = (long(debut[0])/100) MOD 100 
    439   day = (long(debut[0]) MOD 100) 
     456; We make a legible date in function of the specified language. 
     457  year = long(beginning[0])/10000 
     458  month = (long(beginning[0])/100) MOD 100 
     459  day = (long(beginning[0]) MOD 100) 
    440460  vardate = string(format = '(C(CMoA))', 31*(month-1))+' '+strtrim(day, 1)+', '+strtrim(year, 1) 
    441461  varexp = file_basename(filename) 
     
    446466  if keyword_set(key_zreverse) AND (size(res))[0] EQ 4 THEN res = reverse(temporary(res), 3) 
    447467 
    448 ; on applique la valeur valmask sur les points terre 
     468; We apply the value valmask on land points. 
    449469  if NOT keyword_set(cont_nofill) then begin 
    450470    valmask = 1e20 
     
    482502;    ENDIF ELSE missing = -1 
    483503  ENDIF ELSE missing = -1 
    484 ; on applique les add_offset, scale_factor et missing_value 
     504; we apply add_offset, scale_factor and missing_value  
    485505  if scale_factor NE 1 then res = temporary(res)*scale_factor 
    486506  if add_offset NE 0 then res = temporary(res)+add_offset 
  • trunk/SRC/ToBeReviewed/LECTURE/xncdf_lec.pro

    r134 r150  
     1;------------------------------------------------------------ 
     2;------------------------------------------------------------ 
     3;------------------------------------------------------------ 
     4;+ 
     5; 
     6; @file_comments 
     7; Reading of a Net Cdf file with widgets !  
     8; 
     9; @categories  
     10; widget 
     11; 
     12; @param NAME {in}{optional} 
     13; It is a string giving the name of the file to be opened. If NAME  
     14; does not contain the separating character of directories ('/' under  
     15; unix for example), the file will be looked for in the current directory. 
     16; 
     17; @keyword IODIR 
     18; It is a string containing the directory where to go look for the file to be read. 
     19; If NAME does not contain the separating character of directories ('/' under  
     20; unix for example), the file will be called iodir+nom_fichier. 
     21; 
     22; @keyword COUNT 
     23; An optional vector containing the counts to be used in 
     24; reading Value. COUNT is a 1-based vector with an element for 
     25; each dimension of the data to be written.The default matches 
     26; the size of the variable so that all data is written out. 
     27; 
     28; @keyword GROUP 
     29; The widget ID of the widget that calls XNCDF_LEC. When 
     30; this ID is specified, a death of the caller results in a death 
     31; of XNCDF_LEC.  
     32; 
     33; @keyword OFFSET 
     34; An optional vector containing the starting position 
     35; for the read. The default start position is [0, 0, ...]. 
     36; 
     37; @keyword SHIFT 
     38; A vector of integers, specifing 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 determinated  
     41; by OFFSET and COUNT. On the other hand, it is done after the possible extraction  
     42; created by the STRIDE. 
     43; 
     44; @keyword STRIDE 
     45; An optional vector containing the strides, or sampling 
     46; intervals, between accessed values of the netCDF variable. The 
     47; default stride vector is that for a contiguous read, [1, 1,...]. 
     48; 
     49; @returns 
     50;  2 different cases: 
     51;       1) None attribute has been selected. In this case, res is the array we 
     52;       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  
     55;       array and the other arguments are the select arguments. 
     56; 
     57; @uses 
     58; wididbase, infovariable, resultat, motcle 
     59; 
     60; @examples 
     61; help, xncdf_lec() 
     62; 
     63; @history 
     64; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     65;                      24/8/1999 
     66; 
     67; @version 
     68; $Id$ 
     69;- 
     70;------------------------------------------------------------ 
     71;------------------------------------------------------------ 
     72;------------------------------------------------------------ 
     73FUNCTION xncdf_lec, name, ATT = att, COUNT = count, GROUP = group, OFFSET = offset, IODIR = iodir, SHIFT = shift,  STRIDE = stride, VAR = var 
     74; 
     75  compile_opt idl2, strictarrsubs 
     76; 
     77   COMMON wididbase, base 
     78   COMMON infovariable, cdfid, listename, contient, nomdim, tailledim, varid, varcontient 
     79   COMMON resultat, res 
     80   COMMON motcle, mcatt, mccount, mcoffset, mciodir, mcshift, mcstride, mcvar 
     81;------------------------------------------------------------ 
     82; Trick for using keywords (we pass by variables declarated in a common) 
     83;------------------------------------------------------------ 
     84   res = -1 
     85   if keyword_set(att) then mcatt = att ELSE mcatt = 0 
     86   if keyword_set(count) then mccount =count  ELSE mccount = 0 
     87   if keyword_set(offset) then mcoffset = offset ELSE mcoffset = 0 
     88   if keyword_set(shift) then mcshift = shift ELSE mcshift = 0 
     89   if keyword_set(stride) then mcstride = stride ELSE mcstride = 0 
     90   if keyword_set(var) then mcvar = var ELSE mcvar = 0 
     91;------------------------------------------------------------ 
     92; choice of the file's name 
     93;------------------------------------------------------------ 
     94; What type of machine is used 
     95   thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
     96   CASE thisOS of 
     97      'MAC':sep = ':' 
     98      'WIN':sep = '\' 
     99      ELSE: sep = '/' 
     100   ENDCASE 
     101; If IODIR is not defined, we initialize it at the current directory 
     102   if NOT keyword_set(iodir) then cd,  current = iodir 
     103   mciodir = iodir 
     104; We complete IODIR with a separating character if needed. 
     105   IF rstrpos(iodir, sep) NE strlen(iodir)-1 THEN iodir = iodir+sep  
     106   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')  
     108      if name[0] EQ '' then return,  -1 ;If we do not have find anything, we go out. 
     109;We complete NAME by IODIR if NAME does not contain any directory separating character. 
     110   ENDIF ELSE if strpos(name, sep) EQ -1 then name = iodir+name 
     111   test = findfile(name)         ; Does the name looked for correspond to a file? 
     112   while test[0] EQ '' OR n_elements(test) GT 1 do BEGIN ; We look for one as long as it correspond to nothing! 
     113      test = test[0] 
     114      name = dialog_pickfile(filter = iodir+'*.nc') 
     115      if name EQ '' then return,  -1 
     116      test = findfile(name) 
     117   endwhile 
     118;------------------------------------------------------------ 
     119; Opening of the file name. 
     120;------------------------------------------------------------ 
     121   cdfid=ncdf_open(name) 
     122   contient=ncdf_inquire(cdfid) 
     123;------------------------------------------------------------ 
     124; What does this file contain?? 
     125;------------------------------------------------------------ 
     126; Opening of the base window as columns 
     127   if n_elements(group) EQ 0 then base = widget_base(/column, title='Fichier: '+name, /align_left) $ 
     128   ELSE base = widget_base(/column, title='Fichier: '+name, /align_left, GROUP_LEADER = group) 
     129; Opening of base sub-windows ; 
     130;------------------------------------------------------------ 
     131; base 1 title having the file's name 
     132;------------------------------------------------------------ 
     133   base1 = widget_base(base, /column, /align_center) 
     134   rien = widget_label(base1, value = 'Net Cdf filename', /align_center)  
     135   rien = widget_text(base1, value = name, /align_center, uvalue=1, /editable) ;File's name we can change 
     136   rien = widget_label(base1, value = ' ') ; We jump a line 
     137;------------------------------------------------------------ 
     138; base 2 General informations on the file 
     139;------------------------------------------------------------ 
     140   base2 = widget_base(base, /column) 
     141;------------------------------------------------------------ 
     142; Informations on global attributes 
     143;------------------------------------------------------------ 
     144   if contient.ngatts NE -1 then begin 
     145      rien = widget_label(base2, value = 'Nombre de attributs globaux: '+ strtrim(contient.ngatts,1), /align_left) 
     146      for attiq=0,contient.ngatts-1 do BEGIN ; Loop on  the number of global attributes 
     147         name=ncdf_attname(cdfid,attiq,/global) ;Attribute's name 
     148         ncdf_attget,cdfid,name,value,/global ;Attribute's value 
     149         rien = widget_text(base2, value = name+': '+strtrim(string(value),1), xsize = 60, /scroll, /wrap, /align_right) 
     150      endfor 
     151      rien = widget_label(base2, value = ' ') 
     152   endif 
     153;------------------------------------------------------------ 
     154;  Informations on dimensions 
     155;------------------------------------------------------------ 
     156   rien = widget_label(base2, value = 'Nombre de dimensions: '+strtrim(contient.ndims,1), /align_left) 
     157   if contient.recdim NE -1 then begin ;  Loop on  the number of global attributes 
     158      ncdf_diminq,cdfid,contient.recdim,name,value ; Name and value of the dimension 
     159      rien = widget_label(base2, value = 'name de la dimension infinie: '+name, /align_left) 
     160   endif 
     161; 
     162   nomdim   =strarr(contient.ndims) ; Vector containing dimensions's name 
     163   tailledim=lonarr(contient.ndims) ; Vector containing dimensions's value 
     164   for dimiq=0,contient.ndims-1 do begin ; Loop on the number of dimensions 
     165      ncdf_diminq,cdfid,dimiq,name,value ; Name and value of the dimension 
     166      nomdim[dimiq]=name 
     167      tailledim[dimiq]=value 
     168      rien = widget_label(base2, value = name+' de taille: '+strtrim(value,1), /align_right) 
     169   ENDFOR 
     170   rien = widget_label(base2, value = ' ') ; We jump a line 
     171;------------------------------------------------------------ 
     172; base 3 choice of the variable 
     173;------------------------------------------------------------ 
     174   base3 = widget_base(base, /column) 
     175   rien = widget_label(base3, value = 'Nombre de variables: '+strtrim(contient.nvars,1), /align_left) 
     176   base31 = widget_base(base3, /row, /align_center) 
     177;Creation of a listename containing the name of all file's variables 
     178   listename = strarr(contient.nvars) 
     179   for varid=0,contient.nvars-1 do begin 
     180      varcontient=ncdf_varinq(cdfid,varid) ; that the variable contain 
     181      listename[varid] = varcontient.name 
     182   endfor 
     183   rien= widget_label(base31, value = 'variable') 
     184; Creation of a button with a pop-up menu. 
     185   base311=widget_droplist(base31,value=listename, uvalue=2) 
     186   rien = widget_label(base3, value = '') 
     187;------------------------------------------------------------ 
     188; base 4 button done 
     189;------------------------------------------------------------ 
     190   base4 = widget_base(base, /row) 
     191   base42=widget_button(base4,value='done', uvalue=3, /align_right) 
     192;Execution of the base window and of sub-windows 
     193   widget_control,base,/realize 
     194;------------------------------------------------------------ 
     195   xmanager,'xncdf_lec',base 
     196;------------------------------------------------------------ 
     197;------------------------------------------------------------ 
     198;------------------------------------------------------------ 
     199   return, res 
     200end 
     201; 
    1202; La lecture de ce programme se fait de bas en haut: 
    2203;   1) xncdf_lec 
     
    5206;            --> wid_var_event 
    6207; 
     208;+ 
     209; @file_comments 
     210; Procedure called by xmanager when we press on a button of a second widget created by wid_var. 
     211;  
     212; @param EVENT {in}{required} 
     213; A structure caracterizing the type of event which arrive to a widget number1 2 
     214; 
     215; @uses 
     216; wididbase,resultat,infovariable,indicewid,motcle 
     217;  
     218; @version 
     219; $Id$ 
     220;- 
     221;------------------------------------------------------------ 
     222;------------------------------------------------------------ 
     223;------------------------------------------------------------ 
    7224pro wid_var_event,  event 
    8 ; NAME:wid_var_event 
    9 ; 
    10 ; PURPOSE:procedure appele par xmanager qd on appuie sur un bouton du 
    11 ; 2eme widget cree par wid_var 
    12 ;  
    13 ; INPUTS: event, une structure caracterisant le type d''evenement qui 
    14 ; arrive au widget numero1 2 
    15 ; 
    16 ; COMMON BLOCKS:wididbase,resultat,infovariable,indicewid,motcle 
    17 ;------------------------------------------------------------ 
    18 ;------------------------------------------------------------ 
    19 ;------------------------------------------------------------ 
    20225; 
    21226  compile_opt idl2, strictarrsubs 
     
    27232   COMMON motcle, mcatt, mccount, mcoffset, mciodir, mcshift, mcstride, mcvar 
    28233; 
    29 ; quel est le type d''evenement? 
     234; What is the type of event? 
    30235   widget_control, event.id, get_uvalue=uval 
    31236   tailledimvar = tailledim[varcontient.dim] 
    32237   if n_elements(uval) EQ 0 then return 
    33 ; case sur le type d''evenement 
     238; case on the type of event. 
    34239   case uval OF 
    35       1:BEGIN                   ; on change des valeurs dans le tableau 
    36 ; on controle que les valeurs mises dans le tableau ne sont pas 
    37 ; completement fausses 
     240      1:BEGIN                   ; We change values in the array 
     241; We check that values put in the array are not totally false. 
    38242         widget_control, widbase1, get_value = table 
    39 ; agument du bon type ? 
    40 ; si le type est mauvais on change automatiquement par des valeurs par 
    41 ; defaut 
     243; Is it the good type of argument? 
     244; If the type is wrong, we automatically change it by default values. 
    42245         if event.x GT (size(table))[1] then return 
    43246         if event.y GT (size(table))[2] then return 
     
    50253             , use_table_select = [event.x, event.y, event.x, event.y], set_value = 0 
    51254         endif 
    52 ; agument avec une valeur nom debile? 
     255; Argument with a wrong name value? 
    53256         table = fix(table) 
    54257         case event.x of 
    55             0:BEGIN             ; on a touche a l''offset: 
     258            0:BEGIN             ; We touched the offset 
    56259               if table[0, event.y] LT 0 then BEGIN 
    57260                  table[0, event.y] = 0 
    58261                  widget_control, widbase1, use_table_select = [0, event.y, 0, event.y] $ 
    59262                   , set_value = 0 
    60                endif 
    61 ; si il depasse la dim du tableau on le met au max et le cont a 1 
     263              endif 
     264; If it exceed the dimension of the array, we put it at the max and the cont at 1. 
    62265               if table[0, event.y] GT tailledimvar[event.y]/table[3, event.y] then begin 
    63266                  widget_control, widbase1, use_table_select = [0, event.y,1, event.y] $ 
    64267                   , set_value = [tailledimvar[event.y]/table[3, event.y], 1] 
    65                ENDIF ELSE BEGIN 
    66 ; si avec le nouvel offset le count est trop grand, on le diminue juste 
    67 ; de ce qu''il faut! 
     268              ENDIF ELSE BEGIN 
     269; If, with the new offset, the cont is too big, we reduce it  until it goes well! 
    68270                  if table[1, event.y] GT $ 
    69271                   (tailledimvar[event.y]/table[3, event.y])-table[0, event.y] then begin 
     
    73275               ENDELSE 
    74276            END 
    75             1:BEGIN             ;on a touche au count 
     277            1:BEGIN             ;We touched the cont. 
    76278               if table[1, event.y] LT 1 then BEGIN 
    77279                  table[1, event.y] = 1 
     
    79281                   , set_value = 1 
    80282               endif 
    81 ; si il est trop grand, on le diminue juste de ce qu''il faut! 
     283; If it is too big, we reduce it  until it goes well! 
    82284               if table[1, event.y] GT $ 
    83285                (tailledimvar[event.y]/table[3, event.y])-table[0, event.y] then BEGIN 
     
    86288               endif 
    87289            END 
    88             2:BEGIN             ; on a touche au shift 
     290            2:BEGIN             ;We touched the shift. 
    89291               widget_control, widbase1, use_table_select = [2, event.y, 2, event.y] $ 
    90292                , set_value = table[2, event.y] MOD (tailledimvar[event.y]/table[3, event.y]) 
    91293            END 
    92             3:BEGIN             ; on touche au stride 
     294            3:BEGIN             ;We touched the stride. 
    93295               if table[3, event.y] LT 1 then BEGIN 
    94296                  table[3, event.y] = 1 
     
    96298                   , set_value = 1 
    97299               endif 
    98                if table[3, event.y] EQ 0 then $ ; il ne doit pas etre nul 
     300               if table[3, event.y] EQ 0 then $ ;It must not be null. 
    99301                widget_control, widbase1, use_table_select = [3, event.y, 3, event.y] $ 
    100302                , set_value = 1 
    101 ; il ne doit pas etre trop grand 
     303; It must not be too big. 
    102304               if table[3, event.y] GT tailledimvar[event.y] then $ 
    103305                widget_control, widbase1, use_table_select = [0, event.y,3, event.y] $ 
     
    114316         endcase 
    115317      END 
    116       2111:BEGIN                ;on a touche aux boutons oui/non 
    117 ; on actualise le vecteur selectatt a 0 ou 1 pour l''attribut concerne 
    118 ; (numero event.id) 
     318      2111:BEGIN                ;We touched buttons yes/no 
     319; We update the vector selectatt at 0 or 1 for the concerned attribute (number event.id). 
    119320         selectatt[where(widbase2111 EQ event.id)] = event.select 
    120321      end 
    121       31:BEGIN                  ;on a appuye sur 'get' 
     322      31:BEGIN                  ;We pressed on 'get' 
    122323         widget_control, widbase1, get_value = table 
    123324         table = fix(table) 
     
    126327         mccount = table[1, *] 
    127328         mcstride = table[3, *] 
    128          if mcshift[0] NE -1 then BEGIN ; il y a des shifts 
    129 ; on lit l''integralite des dimensions pour lesquelles il y a un shift 
     329         if mcshift[0] NE -1 then BEGIN ; There are some shifts. 
     330; We read the wholeness of dimensions for which ones there is a shift. 
    130331            mcoffset[mcshift] = 0 
    131332            mccount[mcshift] = tailledimvar[mcshift] 
    132 ; on active pas stride qd il n''y en a pas besoin car ca fait ecrire a 
    133 ; l''ecran qqch de louche... 
     333; We do not activate stride when there is no need because it makes write something weird on the screen. 
    134334            if total(mcstride) EQ n_elements(mcstride) then $ 
    135335             ncdf_varget, cdfid, varid, res, OFFSET = mcoffset, COUNT = mccount $ 
    136336            ELSE $ 
    137337             ncdf_varget, cdfid, varid, res, OFFSET = mcoffset, COUNT = mccount, STRIDE = mcstride 
    138 ; pour faire le shift 
     338; To do the shift 
    139339            mcshift = table[2, *] 
    140340            mcoffset = table[0, *] 
    141341            mccount = table[1, *] 
    142 ; on definit commende qui permet de faire un shift 
     342; We define the command allowing to do a shift. 
    143343            commande = 'res=shift(res' 
    144344            for dim = 0, varcontient.ndims-1 do commande = commande+','+string(table[2,dim]) 
    145345            commande = commande+')' 
    146346            rien = execute(commande) 
    147 ; on redefinit commnade qui permet de couper les dimensions qui n''ont 
    148 ; pas ete encore coupees (c''est celles que l''on shift) 
    149             commande = 'res=res[' ; initialisation de la commende 
     347; We redefine the command allowing to cut dimensions which has not been cut yet (ones we shift). 
     348            commande = 'res=res[' ; initialization of the command 
    150349            for dim = 0, varcontient.ndims-1 do BEGIN  
    151350               if mcshift[dim] EQ 0 then commande = commande+'*,' $ 
     
    154353            commande = strmid(commande, 0, strlen(commande)-1)+']' 
    155354            rien = execute(commande) 
    156 ; cas sans shift, on lit directement le bon bout de tableau 
     355; Case without shift, we read directly the good part of the array. 
    157356         ENDIF ELSE BEGIN 
    158357            if total(mcstride) EQ n_elements(mcstride) then $ 
     
    161360             ncdf_varget, cdfid, varid, res, OFFSET = mcoffset, COUNT = mccount, STRIDE = mcstride 
    162361         ENDELSE 
    163 ; faut-il constituer une structure avec les attributs qui on ete selectionnes 
    164          if total(selectatt) NE 0 then BEGIN ; il y a des attributs selectionnes 
    165             res = create_struct(varcontient.name, res) ; on cree la structure 
    166             selectatt = where(selectatt EQ 1) ; on trouve les attributs selectiones  
    167             for attid = 0,  n_elements(selectatt)-1 do BEGIN ; pour lesquels on prend 
    168                widget_control, widbase212[selectatt[attid]], get_value = attname ; le nom 
    169                widget_control, widbase213[selectatt[attid]], get_value = attvalue ; la valeur 
    170               res = create_struct(res, attname[0], attvalue[0]) ; on concatene la structe 
     362; Do we have to constitute a structure with selected attributes. 
     363         if total(selectatt) NE 0 then BEGIN ; There are selected attributes 
     364            res = create_struct(varcontient.name, res) ; We create the structure 
     365            selectatt = where(selectatt EQ 1) ; We find selected attributes 
     366            for attid = 0,  n_elements(selectatt)-1 do BEGIN ; for which we take 
     367               widget_control, widbase212[selectatt[attid]], get_value = attname ; the name 
     368               widget_control, widbase213[selectatt[attid]], get_value = attvalue ; the value 
     369              res = create_struct(res, attname[0], attvalue[0]) ; We concatenate the structure 
    171370            endfor 
    172371         endif 
    173          widget_control, event.top, /destroy ;on ferme le 2eme widget 
    174          widget_control, base, /destroy ;on ferme le 1eme widget 
     372         widget_control, event.top, /destroy ;We shut the second widget. 
     373         widget_control, base, /destroy ;We shut the first widget. 
    175374         ncdf_close,cdfid 
    176375      END 
    177       32:                       ;cas de l''affichage d''un held (avec xdisplayfile) 
    178       33:widget_control, event.top, /destroy ;on ferme le 2eme widget 
     376      32:                       ;Case of the display of a held (with xdisplayfile) 
     377      33:widget_control, event.top, /destroy ;We shut the second widget. 
    179378      ELSE: 
    180379   endcase 
     
    183382;------------------------------------------------------------ 
    184383;------------------------------------------------------------ 
     384;------------------------------------------------------------ 
     385;+ 
     386; @file_comments 
     387; This procedure manage the second created whiget when we call xncdf_lec.  
     388; This widget concern the reading of the variable. 
     389; 
     390; @param WIDID_PERE {in}{required} 
     391; It is a scalar containing the identity of the father widget which was  
     392; created by xncdf_lec and which has allowed to select the variable to be read. 
     393; 
     394; OUTPUTS: indirectement res (le tableau ou la structure resultat) 
     395; 
     396; @uses  
     397; resultat,infovariable,indicewid_var,motcle 
     398; 
     399; @version 
     400; $Id$ 
     401;- 
     402;------------------------------------------------------------ 
     403;------------------------------------------------------------ 
     404;------------------------------------------------------------ 
    185405PRO wid_var, widid_pere 
    186 ;------------------------------------------------------------ 
    187 ;------------------------------------------------------------ 
    188 ;------------------------------------------------------------ 
    189 ; NAME: wid_var 
    190 ; 
    191 ; PURPOSE: cette procedure gere le 2eme widget cree qd on appelle 
    192 ; xncdf_lec. ce widget concerne la lecture de la variable 
    193 ; 
    194 ; INPUTS: widid_pere: un scalere contenant l'identite du widget pere 
    195 ; qui a etait cree par xncdf_lec et qui a permis de selectionner la 
    196 ; variable a lire. 
    197 ; 
    198 ; OUTPUTS: indirectement res (le tableau ou la structure resultat) 
    199 ; 
    200 ; COMMON BLOCKS:resultat,infovariable,indicewid_var,motcle 
    201 ; 
    202 ;------------------------------------------------------------ 
    203 ;------------------------------------------------------------ 
    204 ;------------------------------------------------------------ 
    205406; 
    206407  compile_opt idl2, strictarrsubs 
     
    212413   res = -1 
    213414;------------------------------------------------------------ 
    214 ; ouverture de la fenetre de base sous forme de colonnes 
    215 ;------------------------------------------------------------ 
     415; Opening of the base window as columns. 
    216416   widbase = widget_base(/column, title='variable: '+varcontient.name, /align_center, group_leader = widid_pere) 
    217417;------------------------------------------------------------ 
    218 ; ouverture de  sous-fenetres de base ; 
    219 ;------------------------------------------------------------ 
    220 ; widbase1 tableau des offsets 
    221 ;------------------------------------------------------------ 
    222    rien = widget_label(widbase, value = ' ') ; on saute une ligne 
    223 ; defintion des lables des lignes du tableau 
     418; Opening of the base subwindow  
     419;------------------------------------------------------------ 
     420; widbase1 array of offsets 
     421;------------------------------------------------------------ 
     422   rien = widget_label(widbase, value = ' ') ; We jump a line 
     423; Definition of labels of lines of the array 
    224424   rowlab = string(tailledim[varcontient.dim]) 
    225425   for i = 0,  n_elements(rowlab)-1 do rowlab[i] = strtrim(rowlab[i], 1) 
    226426   rowlab = nomdim[varcontient.dim]+replicate(': ', n_elements(varcontient.dim))+rowlab 
    227 ; definition des valeurs initiales du tableau 
     427; Definition of array's initial values 
    228428   valinit = lonarr(4, n_elements(varcontient.dim)) 
    229 ; colonne 0 : les offset 
     429; column 0 : offsets 
    230430   if keyword_set(mcoffset) AND n_elements(mcoffset) EQ varcontient.ndims THEN $ 
    231431    valinit[0,*]=mcoffset ELSE valinit[0, *] = 0 
    232 ; colonne 1 : les counts 
     432; colomn 1 : counts 
    233433   if keyword_set(mccount) AND n_elements(mccount) EQ varcontient.ndims THEN  $ 
    234434    valinit[1,*]=mccount ELSE valinit[1, *] = tailledim[varcontient.dim] 
    235 ; colonne 2 : les shifts 
     435; column 2 : shifts 
    236436   if keyword_set(mcshift) AND n_elements(mcshift) EQ varcontient.ndims THEN $ 
    237437    valinit[2,*]=mcshift ELSE valinit[2, *] = 0 
    238 ; colonne 3 : les strides 
     438; column 3 : strides 
    239439   if keyword_set(mcstride) AND n_elements(mcstride) EQ varcontient.ndims THEN $ 
    240440    valinit[3,*]=mcstride ELSE valinit[3, *] = 1 
    241 ; test des valeurs initiales du tableau 
     441; test of initial values of the array 
    242442   valinit = fix(valinit) 
    243    valinit[3, *] = 1 > valinit[3, *] < tailledim[varcontient.dim] ; test des strides 
    244    valinit[0, *] = 0 > valinit[0, *] < tailledim[varcontient.dim] ; test des offsets 
    245 ; test des counts 
     443   valinit[3, *] = 1 > valinit[3, *] < tailledim[varcontient.dim] ; test of strides 
     444   valinit[0, *] = 0 > valinit[0, *] < tailledim[varcontient.dim] ; test of offsets 
     445; test of counts 
    246446   valinit[1, *] = 1 > valinit[1, *] < ((tailledim[varcontient.dim]/valinit[3, *])-valinit[0, *]) 
    247    valinit[2, *] = valinit[2, *] MOD (tailledim[varcontient.dim]/valinit[3, *]) ; test des shifts 
    248 ; declaration du tableau 
     447   valinit[2, *] = valinit[2, *] MOD (tailledim[varcontient.dim]/valinit[3, *]) ; test of shifts 
     448; declaration of the array 
    249449   widbase1 = widget_table(widbase, row_labels = rowlab, value = valinit, /editable $ 
    250450                           , column_labels = ['Offset', 'Count', 'Shift', 'Stride'], uvalue = 1) 
     
    253453   rien = widget_label(widbase, value = 'du tableau ou des textes soient bien prises en compte', /align_center) 
    254454;------------------------------------------------------------ 
    255 ; widbase2 choix des attributs 
    256 ;------------------------------------------------------------ 
    257    rien = widget_label(widbase, value = ' ') ; on saute une ligne 
     455; widbase2 choice of attributes 
     456;------------------------------------------------------------ 
     457   rien = widget_label(widbase, value = ' ') ; We jump a line 
    258458   widbase2 = widget_base(widbase, /column) 
    259 ; pour chaque attribut, on cree un widget (widbase21) qui contient en ligne un 
    260 ; bouton oui/non (widbase211), et deux wigdet text (widbase212, 
    261 ; widbase213)comportant le nom et la valeur de l''attribut. 
     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  
     461; name and the value of the attribute. 
    262462   widbase21 = lonarr(varcontient.natts) 
    263463   widbase211 = lonarr(varcontient.natts) 
    264464   widbase2111 = lonarr(varcontient.natts) 
    265 ; vecteur qui serviera a savoir quels boutons oui/non sont 
    266 ; selectiones. cf. wid_var_event 
     465; Vector which will serve to know which yes/no are selected. see. wid_var_event 
    267466   selectatt = lonarr(varcontient.natts) 
    268467   selectatt[*] = 0 
    269468   widbase212 = lonarr(varcontient.natts) 
    270469   widbase213 = lonarr(varcontient.natts) 
    271    for attid = 0, varcontient.natts-1 do BEGIN ;boucle sur le nombre d''attributs 
     470   for attid = 0, varcontient.natts-1 do BEGIN ;Lop on the number of attribute. 
    272471      widbase21[attid] = widget_base(widbase2, /row) 
    273472      name=ncdf_attname(cdfid,varid,attid) 
     
    279478   endfor 
    280479;------------------------------------------------------------ 
    281 ; widbase3 boutons du bas 
     480; widbase3 buttons of the bottom. 
    282481;------------------------------------------------------------ 
    283482   widbase3 = widget_base(widbase, /row,/align_center) 
     
    286485   widbase33=widget_button(widbase3,value='DONE', uvalue=33) 
    287486;------------------------------------------------------------ 
    288 ;execution de la fentre de base et des sous-fenetres 
     487;execution of the base window and of sub-window. 
    289488;------------------------------------------------------------ 
    290489   widget_control,widbase,/realize 
     
    295494;------------------------------------------------------------ 
    296495 
     496;------------------------------------------------------------ 
     497;------------------------------------------------------------ 
     498;------------------------------------------------------------ 
     499;+ 
     500; @file_comments 
     501; Procedure called by xmanager when we press a button of the first widget  
     502; created by par xncdf_lec 
     503;  
     504; @param EVENT 
     505; A structure caracterising the event type which arrive at the widget number 1. 
     506; 
     507; @uses 
     508; resultat, infovariable, motcle 
     509; 
     510; @version 
     511; $Id$ 
     512;- 
     513;------------------------------------------------------------ 
     514;------------------------------------------------------------ 
     515;------------------------------------------------------------ 
    297516PRO xncdf_lec_event, event 
    298 ;------------------------------------------------------------ 
    299 ;------------------------------------------------------------ 
    300 ;------------------------------------------------------------ 
    301 ; NAME:xncdf_lec_event 
    302 ; 
    303 ; PURPOSE: procedure appele par xmanager qd on appuie sur un bouton du 
    304 ; 1ere widget cree par xncdf_lec 
    305 ;  
    306 ; INPUTS: event, une structure caracterisant le type d''evenement qui 
    307 ; arrive au widget numero1 
    308 ; 
    309 ; COMMON BLOCKS:resultat, infovariable, motcle 
    310 ; 
    311 ;------------------------------------------------------------ 
    312 ;------------------------------------------------------------ 
    313 ;------------------------------------------------------------ 
    314517; 
    315518  compile_opt idl2, strictarrsubs 
     
    318521   COMMON infovariable, cdfid, listename, contient, nomdim, tailledim, varid, varcontient 
    319522   COMMON motcle, mcatt, mccount, mcoffset, mciodir, mcshift, mcstride, mcvar 
    320 ; quel est le type d''evenement? 
     523; What is the type of event? 
    321524   widget_control, event.id, get_uvalue=uval 
    322 ; case sur le type d''evenement 
     525; case on the type of event. 
    323526   case uval of 
    324       1:BEGIN                   ; on veut lire un autre fichier 
    325          widget_control, event.id, get_value = nom ; on recupere le nom 
    326          widget_control, event.top, /destroy ;on ferme le widget 
    327          ncdf_close,cdfid       ; on ferme le mauvais fichier qui a ete ouvert 
    328 ; on reapelle xncdf_lec 
     527      1:BEGIN                   ; We want to read an other file 
     528         widget_control, event.id, get_value = nom ; We recuperate the name. 
     529         widget_control, event.top, /destroy ;We shut the widget. 
     530         ncdf_close,cdfid       ;We shut the wrong file which has been opened. 
     531;We call back xncdf_lec 
    329532         res = xncdf_lec(nom[0], ATT = mcatt, COUNT = mccount, OFFSET = mcoffset, IODIR = mciodir $ 
    330533                         , SHIFT = mcshift,  STRIDE = mcstride, VAR = mcvar)  
    331534         return 
    332535      END 
    333       2:BEGIN                   ; une variable est selectionee 
    334          varid = event.index    ; on recupere son numero ds le fichier Netcdf 
     536      2:BEGIN                   ; A variable is selected. 
     537         varid = event.index    ; We recuperat its number in the file Netcdf 
    335538         varcontient = ncdf_varinq(cdfid,varid) 
    336          wid_var, event.top     ; on appelle le programme qui lance le 2eme widget. cf. + haut 
     539         wid_var, event.top     ; We call the program which launch the second widget. See sooner. 
    337540      END 
    338       3:BEGIN                   ; bouton done 
    339          widget_control, event.top, /destroy ; on tue le widget 
    340          ncdf_close,cdfid       ; on ferme le fichier 
     541      3:BEGIN                   ; button done 
     542         widget_control, event.top, /destroy ; We delete the widget 
     543         ncdf_close,cdfid       ; We shut the file. 
    341544      END 
    342545      ELSE: 
     
    344547   return 
    345548end 
    346 ;------------------------------------------------------------ 
    347 ;------------------------------------------------------------ 
    348 ;------------------------------------------------------------ 
    349 ;+ 
    350 ; NAME: xncdf_lec 
    351 ; 
    352 ; PURPOSE: lecture d''un fichier Net Cdf avec des widgets !  
    353 ; 
    354 ; CATEGORY: lecture de fichiers avec widgets 
    355 ; 
    356 ; CALLING SEQUENCE: res=xncdf_lec([nom_fichier]) 
    357 ;  
    358 ; INPUTS:  
    359 ;      OPTIONNEL, nom_fichier: c''est un string qui donne le nom du 
    360 ;       fichier a ouvrir.Si nomfichier ne contient pas le caractere 
    361 ;       separateur de repertoirte ('/' sous unix par ex), Le fichier 
    362 ;       sera cherche ds le repertoire courant 
    363 ; 
    364 ; KEYWORD PARAMETERS: 
    365 ; 
    366 ;       IODIR: string contenant le repertoire ou aller chercher le 
    367 ;       fichier a lire. Si nomfichier ne contient pas le caractere 
    368 ;       separateur de repertoirte ('/' sous unix par ex), Le fichier 
    369 ;       cherche s''appelera iodir+nom_fichier. 
    370 ; 
    371 ;       COUNT: An optional vector containing the counts to be used in 
    372 ;       reading Value. COUNT is a 1-based vector with an element for 
    373 ;       each dimension of the data to be written.The default matches 
    374 ;       the size of the variable so that all data is written out. 
    375 ; 
    376 ;       GROUP: The widget ID of the widget that calls XNCDF_LEC. When 
    377 ;       this ID is specified, a death of the caller results in a death 
    378 ;       of XNCDF_LEC.  
    379 ; 
    380 ;       OFFSET: An optional vector containing the starting position 
    381 ;       for the read. The default start position is [0, 0, ...]. 
    382 ; 
    383 ;       SHIFT: un vecteur d''entiers, specifiant pour chaque dimension 
    384 ;       de combien il faut la shifter. Par defaut c''est 
    385 ;       [0,0,...]. cf. la fonction shift pour + 
    386 ;       d''explications. ATTENTION, le shift est effectue sur le 
    387 ;       tableau de taille maximum avant la reduction eventuelle 
    388 ;       determinee par OFFSET et COUNT. Par contre il est effectue 
    389 ;       apres l''extraction eventuelle cree par le STRIDE. 
    390 ; 
    391 ;       STRIDE: An optional vector containing the strides, or sampling 
    392 ;       intervals, between accessed values of the netCDF variable. The 
    393 ;       default stride vector is that for a contiguous read, [1, 1, 
    394 ;       ...]. 
    395 ; 
    396 ; OUTPUTS: 2 cas possibles: 
    397 ;       1) aucun attributs n''a ete selectionne. Dans ce cas res est 
    398 ;       le tableau que l''on voulait lire. 
    399 ;       2) Des attributs ont ete selectionnes. Dans ce cas res est une 
    400 ;       structre dont le premier element portant le nom de la variable 
    401 ;       est le tableau de valeurs et les autre auguments sont les 
    402 ;       arguments selectiones 
    403 ; 
    404 ; COMMON BLOCKS: wididbase, infovariable, resultat, motcle 
    405 ; 
    406 ; SIDE EFFECTS: 
    407 ; 
    408 ; RESTRICTIONS: 
    409 ; 
    410 ; EXAMPLE: help, xncdf_lec() 
    411 ; 
    412 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    413 ;                      24/8/1999 
    414 ;- 
    415 ;------------------------------------------------------------ 
    416 ;------------------------------------------------------------ 
    417 ;------------------------------------------------------------ 
    418 FUNCTION xncdf_lec, nom, ATT = att, COUNT = count, GROUP = group, OFFSET = offset, IODIR = iodir, SHIFT = shift,  STRIDE = stride, VAR = var 
    419 ; 
    420   compile_opt idl2, strictarrsubs 
    421 ; 
    422    COMMON wididbase, base 
    423    COMMON infovariable, cdfid, listename, contient, nomdim, tailledim, varid, varcontient 
    424    COMMON resultat, res 
    425    COMMON motcle, mcatt, mccount, mcoffset, mciodir, mcshift, mcstride, mcvar 
    426 ;------------------------------------------------------------ 
    427 ; bidouille pour utiliser les mots cles (on passe par des variables 
    428 ; declarees ds un common) 
    429 ;------------------------------------------------------------ 
    430    res = -1 
    431    if keyword_set(att) then mcatt = att ELSE mcatt = 0 
    432    if keyword_set(count) then mccount =count  ELSE mccount = 0 
    433    if keyword_set(offset) then mcoffset = offset ELSE mcoffset = 0 
    434    if keyword_set(shift) then mcshift = shift ELSE mcshift = 0 
    435    if keyword_set(stride) then mcstride = stride ELSE mcstride = 0 
    436    if keyword_set(var) then mcvar = var ELSE mcvar = 0 
    437 ;------------------------------------------------------------ 
    438 ; choix du nom du fichier 
    439 ;------------------------------------------------------------ 
    440 ; Quel type de machine est utiliee 
    441    thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    442    CASE thisOS of 
    443       'MAC':sep = ':' 
    444       'WIN':sep = '\' 
    445       ELSE: sep = '/' 
    446    ENDCASE 
    447 ; si iodir n''est pas definit on l''initialise au repertoire courant 
    448    if NOT keyword_set(iodir) then cd,  current = iodir 
    449    mciodir = iodir 
    450 ; on complete iodir d''un caractere separateur de repertoire si besoin 
    451 ; est. 
    452    IF rstrpos(iodir, sep) NE strlen(iodir)-1 THEN iodir = iodir+sep  
    453    if n_elements(nom) EQ 0 then BEGIN ; si nom n''est pas definit 
    454 ; on en trouve un grace au programme dialog_pickfile 
    455       nom = dialog_pickfile(filter = iodir+'*.nc')  
    456       if nom[0] EQ '' then return,  -1 ; si on a rien trouve on sort 
    457 ;on complete nom par iodir si nom ne contient pas de caractere 
    458 ;separateur derepertoire 
    459    ENDIF ELSE if strpos(nom, sep) EQ -1 then nom = iodir+nom 
    460    test = findfile(nom)         ; le nom cherche correspond bien a un fichier? 
    461    while test[0] EQ '' OR n_elements(test) GT 1 do BEGIN ; on en cherche un tant qu''il ne correspond a rien! 
    462       test = test[0] 
    463       nom = dialog_pickfile(filter = iodir+'*.nc') 
    464       if nom EQ '' then return,  -1 
    465       test = findfile(nom) 
    466    endwhile 
    467 ;------------------------------------------------------------ 
    468 ; ouverture du fichier nom 
    469 ;------------------------------------------------------------ 
    470    cdfid=ncdf_open(nom) 
    471    contient=ncdf_inquire(cdfid) 
    472 ;------------------------------------------------------------ 
    473 ; que contient le fichier?? 
    474 ;------------------------------------------------------------ 
    475 ; ouverture de la fenetre de base sous forme de colonnes 
    476    if n_elements(group) EQ 0 then base = widget_base(/column, title='Fichier: '+nom, /align_left) $ 
    477    ELSE base = widget_base(/column, title='Fichier: '+nom, /align_left, GROUP_LEADER = group) 
    478 ; ouverture de  sous-fenetres de base ; 
    479 ;------------------------------------------------------------ 
    480 ; base 1 titre portant le nom du fichier 
    481 ;------------------------------------------------------------ 
    482    base1 = widget_base(base, /column, /align_center) 
    483    rien = widget_label(base1, value = 'Net Cdf filename', /align_center) ; blabla 
    484    rien = widget_text(base1, value = nom, /align_center, uvalue=1, /editable) ;nom du fichier que l''on peut changer  
    485    rien = widget_label(base1, value = ' ') ; on saute une ligne 
    486 ;------------------------------------------------------------ 
    487 ; base 2 informations generales sur le fichier 
    488 ;------------------------------------------------------------ 
    489    base2 = widget_base(base, /column) 
    490 ;------------------------------------------------------------ 
    491 ; informations sur les attributs globaux 
    492 ;------------------------------------------------------------ 
    493    if contient.ngatts NE -1 then begin 
    494       rien = widget_label(base2, value = 'Nombre de attributs globaux: '+ strtrim(contient.ngatts,1), /align_left) 
    495       for attiq=0,contient.ngatts-1 do BEGIN ; bouble sur le nombre d'attributs globaux 
    496          name=ncdf_attname(cdfid,attiq,/global) ;nom de l''atribut 
    497          ncdf_attget,cdfid,name,value,/global ;valeur de l''atribut 
    498          rien = widget_text(base2, value = name+': '+strtrim(string(value),1), xsize = 60, /scroll, /wrap, /align_right) 
    499       endfor 
    500       rien = widget_label(base2, value = ' ') 
    501    endif 
    502 ;------------------------------------------------------------ 
    503 ;  informations sur les dimensions 
    504 ;------------------------------------------------------------ 
    505    rien = widget_label(base2, value = 'Nombre de dimensions: '+strtrim(contient.ndims,1), /align_left) 
    506    if contient.recdim NE -1 then begin ; bouble sur le nombre de dimensions 
    507       ncdf_diminq,cdfid,contient.recdim,name,value ; nom et valeur de la dimension 
    508       rien = widget_label(base2, value = 'nom de la dimension infinie: '+name, /align_left) 
    509    endif 
    510 ; 
    511    nomdim   =strarr(contient.ndims) ; vecteur contenant le nom des dimensions 
    512    tailledim=lonarr(contient.ndims) ; vecteur contenant la valeur des dimensions 
    513    for dimiq=0,contient.ndims-1 do begin ; bouble sur le nombre de dimensions 
    514       ncdf_diminq,cdfid,dimiq,name,value ; nom et valeur de la dimension 
    515       nomdim[dimiq]=name 
    516       tailledim[dimiq]=value 
    517       rien = widget_label(base2, value = name+' de taille: '+strtrim(value,1), /align_right) 
    518    ENDFOR 
    519    rien = widget_label(base2, value = ' ') ; on saute une ligne 
    520 ;------------------------------------------------------------ 
    521 ; base 3 choix de la variable 
    522 ;------------------------------------------------------------ 
    523    base3 = widget_base(base, /column) 
    524    rien = widget_label(base3, value = 'Nombre de variables: '+strtrim(contient.nvars,1), /align_left) 
    525    base31 = widget_base(base3, /row, /align_center) 
    526 ;creation d'un vecteur listename contenant le nom de toutes les 
    527 ;variables du fichier 
    528    listename = strarr(contient.nvars) 
    529    for varid=0,contient.nvars-1 do begin 
    530       varcontient=ncdf_varinq(cdfid,varid) ; que contient la variable 
    531       listename[varid] = varcontient.name 
    532    endfor 
    533    rien= widget_label(base31, value = 'variable') 
    534 ; creation d''un bouton a menu deroulant 
    535    base311=widget_droplist(base31,value=listename, uvalue=2) 
    536    rien = widget_label(base3, value = '') 
    537 ;------------------------------------------------------------ 
    538 ; base 4 bouton done 
    539 ;------------------------------------------------------------ 
    540    base4 = widget_base(base, /row) 
    541    base42=widget_button(base4,value='done', uvalue=3, /align_right) 
    542 ;execution de la fentre de base et des sous-fenetres 
    543    widget_control,base,/realize 
    544 ;------------------------------------------------------------ 
    545    xmanager,'xncdf_lec',base 
    546 ;------------------------------------------------------------ 
    547 ;------------------------------------------------------------ 
    548 ;------------------------------------------------------------ 
    549    return, res 
    550 end 
  • trunk/SRC/ToBeReviewed/POSTSCRIPT/calibre.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: calibre 
    6 ; 
    7 ; PURPOSE:a partir d''un rapport d''aspect et des valeurs (en ligne de 
    8 ; characteres) des differentes marges, calcul posfenetre et posbar qui 
    9 ; servent a placer le dessin et la barre de couleur grace a 
    10 ; !p.position sur une feuille ou 
    11 ; sur une sortie ecran dont la fenetre a les memes proportions 
    12 ; 
    13 ; CATEGORY: positionnement du graphe 
    14 ; 
    15 ; CALLING SEQUENCE: 
    16 ;     calibre, rapportyx,marge,margebar, smalldraw,posfenetre, posbar  
    17 ; 
    18 ; INPUTS: 
    19 ;       rapportyx: rapport d''echelle entre la longueur de l''axe des 
    20 ;       y et celle des x. par ex pour une carte xy, 
    21 ;       rapportyx=(lat2-lat1)/(lon2-lon1) 
    22 ; 
    23 ;       marge: vecteur de 4 elements contenant la taille des marges a gauche, 
    24 ; a droite, en bas et en haut devant entourer le graphe. tout est 
    25 ; mesure en lignes de characteres 
    26 ; 
    27 ;       margebar: vecteur de 4 elements contenant la taille des marges a gauche, 
    28 ; a droite, en bas et -ATTENTION- le dernier element est cette fois-ci 
    29 ; la position de coin en haut a droite, devant entourer la barre de 
    30 ; couleur. tout est mesure en lignes de characteres 
    31 ; 
    32 ;       smalldraw: 2 possiblites 
    33 ;             un vecteur de 4 elements donnant (en portrait ou 
    34 ; en landscape) la position de cadre ds lequel doit rentrer le 
    35 ; dessin. cette position est donne par les coordonnes des 2 coins du 
    36 ; cadre: en bas a gauche et en haut a droite. elle s''exprime tjs 
    37 ; (pour un postscript ou une sortie ecran) en cm, l''origine etant le 
    38 ; coin en bas a gauche. 
    39 ;             un vecteur de 3 elements donnant le nombre de colonnes a 
    40 ; faire de le dessin, le nombre de lignes et enfin le numero de la 
    41 ; case que doit occuper le dessin (cf matlab). par ex pour faire 6 
    42 ; dessin en 2 colonnes et 3 lignes et occuper la 4 eme case, small=[2,3,4] 
    43 ; 
    44 ; KEYWORD PARAMETERS: 
    45 ; 
    46 ;       /REMPLI:oblige le dessin a occuper l'espace maximum definit 
    47 ; par smalldraw sans resperter le rapport y sur x. 
    48 ; 
    49 ;       YXASPECT: force le rapport y sur x a prendre la valeur 
    50 ; rapportyx*yxaspect. ce mot cle est utile ds deux cas:  
    51 ;   1) yxaspect=1 : oblige rapportyx a etre bien respecte sinon 
    52 ;         calibre se reserve le droit de changer un peu celui-ci dans 
    53 ;         le cas ou le rapport d''aspect de small dessin est trop 
    54 ;         different de celui de smalldraw. 
    55 ;   2) yxaspect=n : multiplie par n le rapport d''aspect donne par 
    56 ;         defaut.par ex ds plt, rapportyx est calcule pour que le 
    57 ;         repere soit orthonorme, pour avoir un repere ou l''axe des y 
    58 ;         est 2 fois plus dilate que celui des y YXASPECT=2 
     5; @file_comments 
     6; From a rapport of aspect and values (in line of character) of different margins,  
     7; it calculate POSFENETRE and POSBAR which serve to place the drawing and the color  
     8; bar thanks to !p.position on a leaf or a screen output whose the window has the same  
     9; proportion. 
     10; 
     11; @categories  
     12; graphics 
     13; 
     14;  
     15; @param RAPPORTYX {in}{required} 
     16; Scale rapport between the lenght of the y axis and the x one. For example,  
     17; for an xy map: RAPPORTYX=(lat2-lat1)/(lon2-lon1) 
     18; 
     19; @param MARGE {in}{required} 
     20; Vector made of 4 elements containing the size of the left, right, up and  
     21; bottom margin having to surround the graph. All is measured in lines of characters. 
     22; 
     23; @param MARGEBAR {in}{required} 
     24; Vector made of 4 elements containing the size of the left, right and bottom  
     25; margin and -BEWARE- the last element is this time the positio of the right up  
     26; corner, having to surround the color bar. All is measured in lines of characters. 
     27; 
     28; @param SMALLDRAW {in}{required} 
     29; 2 possibilities: 
     30;    It is vector made of 4 elements giving (in portrait or landscape) the position  
     31; of the frame in which the drawing must go in. This position is given by coordinates  
     32; of the 2 corners of the frame: in the left bottom and the right up. It is always  
     33; (for a postscript or a screen output) express in cm, the origin being the  
     34; left bottom corner. 
     35;    It is a vector made of 3 elements giving the number of column to be done in the  
     36; drawing, the number of line and the number of the case the number have to occupy  
     37; (see matlab). For example, to do 6 drawing in 3 columns and 2 lines and occupy  
     38; the 4th case, small=[2,3,4] 
     39; 
     40; @keyword REMPLI 
     41; Force the drawing to occupy the biggest possible place defined by  
     42; SMALLDRAW without respect the rapport y on x. 
     43; 
     44; @keyword YXASPECT 
     45; Force the rapport y on x to take the value RAPPORTYX*YXASPECT.  
     46; This keyword can be used in 2 cases: 
     47;   1) YXASPECT=1 : force RAPPORTYX to be respected otherwise, Calibre take the  
     48;   initiative to change it a little inthe case of the aspect rapport of SMALL  
     49;   is too different of the one of SMALLDRAW.  
     50;   2) YXASPECT=n : multiply by n the aspect rapport given by default.  
     51;   For example in plt, RAPPORTYX is calculated to the reference be orthonormal, 
     52;   to have a reference where the y axis is 2 time bigger than the x one, YXASPECT=2. 
    5953;        
    60 ;       PORTRAIT et LANDSCAPE: mots cles plus utilises mais tjs fonctionnels 
    61 ; 
    62 ; OUTPUTS: 
    63 ;       posfenetre: un vecteur de 4 elements contenant la position de 
    64 ;       cadre contenant les legendes + le graphe en coordonnes 
    65 ;       normalises. Rq: pour positionner le dessin il faut apres 
    66 ;       l''appelle de calibre faire !p.position=posfenetre 
    67 ; 
    68 ;       posbar: cf posfentre mais pour la barre de couleur. meme 
    69 ;       remarque pour positionner la barre de couleur, !p.position=posbar 
    70 ; 
    71 ; COMMON BLOCKS: 
    72 ;       common.pro               
    73 ; 
    74 ; SIDE EFFECTS: 
    75 ; 
    76 ; RESTRICTIONS: 
    77 ; 
    78 ; EXAMPLE: 
    79 ; 
    80 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     54; @keyword PORTRAIT        
     55; Force the page or the window to be in standing position. 
     56;  
     57; @keyword LANDSCAPE        
     58; Force the page or the window on the screen to be in lenthened position. 
     59;  
     60; @keyword _EXTRA 
     61; Used to pass your keywords 
     62; 
     63; @param POSFENETRE 
     64; It is a vector made of 4 elements containing the position of the frame  
     65; containing captions + the graph in normalized coordinates.  
     66; Comment: to position the drawing, we have to do !p.position=POSFENETRE  
     67; after the call of calibre. 
     68; 
     69; @param POSBAR 
     70; See POSFENTRE but for the color bar. Same comment to position the color bar, !p.position=POSBAR 
     71; 
     72; @uses 
     73; common.pro 
     74; 
     75; @history 
     76; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    8177;                       11/12/98 
     78; 
     79; @version 
     80; $Id$ 
    8281;- 
    8382;------------------------------------------------------------ 
     
    9897;--------------------------------------------------------- 
    9998;------------------------------------------------------------ 
    100    tempsun = systime(1)         ; pour key_performance 
     99   tempsun = systime(1)         ; For key_performance 
    101100;------------------------------------------------------------- 
    102101   if keyword_set(portrait) then key_portrait=1 
     
    112111    mipgsz = min(page_size, max = mapgsz) 
    113112;------------------------------------------------------------ 
    114 ; choix de Landscape ou Portrait 
     113; choice of Landscape or Portrait 
    115114;------------------------------------------------------------ 
    116115   if n_elements(key_portrait) eq 0  then begin 
     
    119118   endif 
    120119;------------------------------------------------------------- 
    121 ; si smalldraw est compte comme ds matlab 
     120; If smalldraw is count like in matlab 
    122121;------------------------------------------------------------- 
    123122   if n_elements(smalldraw) EQ 3  then begin 
     
    136135   endif 
    137136;------------------------------------------------------------ 
    138 ; determination de la taille des characteres (!p.charsize) 
     137; determination of the size of characters (!p.charsize) 
    139138;------------------------------------------------------------ 
    140139   nombre_de_mots_ds_titre = 60. 
     
    143142   if !p.charsize gt 1 then !p.charsize=1 
    144143;------------------------------------------------------------ 
    145 ; transfert de marge en cm 
     144; transfert of margin in cm 
    146145;------------------------------------------------------------ 
    147146   cm=1.*!d.x_px_cm 
     
    149148   margebar=1.* margebar * !d.y_ch_size * !p.charsize / cm 
    150149;------------------------------------------------------------ 
    151 ; definition de la portion de feuille ou on dessine 
     150; definition of the part of the leaf where we draw 
    152151;------------------------------------------------------------ 
    153152   if key_portrait eq 0 then begin 
     
    162161   else rapportmax=1.*(small-marge[2]-marge[0])/(big-marge[3]-marge[1]) 
    163162;------------------------------------------------------------ 
    164 ; si yxaspect n'est pas specifie on modifie la valeur de rapportyx pour que 
    165 ; ca colle un peu plus aux proportions de la feuille 
     163; If YXASPECT is not specified, we modify the value of RAPPORTYX  
     164; to it match better with the leaf's proportions. 
    166165;------------------------------------------------------------ 
    167166   if rapportyx le rapportmax then begin 
     
    183182   endelse 
    184183;------------------------------------------------------------ 
    185 ; dans le cas ou on fait un Landscape: 
     184; in the case where we do a Landscape: 
    186185;------------------------------------------------------------ 
    187186   if key_portrait eq 0 then begin        
     
    214213   endif $ 
    215214;------------------------------------------------------------ 
    216 ; dans le cas ou on fait un portrait: 
     215; In the case where we do a portrait: 
    217216;------------------------------------------------------------ 
    218217   else begin        
  • trunk/SRC/ToBeReviewed/POSTSCRIPT/ps.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:ps 
     5; @file_comments 
     6; Redirect the content of the graphic window in a postscript,  
     7; by redoing commands in the postscript's environment. 
    68; 
    7 ; PURPOSE:redirige le contenu de la fenetre graphique ds un postcript, 
    8 ; en reeffectuant les commandes ds l''environnement postscript. 
     9; @categories 
     10; utilities 
     11;  
     12; @restrictions 
     13; We use journal which allows to stock commands we pass.  
    914; 
    10 ; CATEGORY:pour faire un ps 
     15; @restrictions 
     16; Can break down if some wierd commands are passed... 
     17; Comment: we erase Syntax error, Illegal characters, comapatible 
     18; with oups, text_box...  
    1119; 
    12 ; CALLING SEQUENCE:@ps 
    13 ; 
    14 ; INPUTS: 
    15 ; 
    16 ; KEYWORD PARAMETERS: 
    17 ;; 
    18 ; OUTPUTS: 
    19 ; 
    20 ; COMMON BLOCKS: 
    21 ; 
    22 ; SIDE EFFECTS: on utilise journal qui perment de stoker les commandes 
    23 ; que l''on passe.  
    24 ; 
    25 ; RESTRICTIONS:peut planter si des commandes bizarres sont passees... 
    26 ; rq: on efface les Syntax error, les Illegal character, commapatible 
    27 ; avec oups, text_box...  
    28 ; 
    29 ; EXAMPLE: 
    30 ; 
    31 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     20; @history 
     21; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3222;                       5/3/1999 
    3323;- 
     
    3626;------------------------------------------------------------ 
    3727;------------------------------------------------------------ 
    38 ; il faut fermer le journal! 
     28; We have to close the journal! 
    3929;------------------------------------------------------------ 
    40 ;   if !journal EQ 0 then begin 
    41 ;      print, 'Il n''y a pas de journal ouvert !!' 
    42 ;      GOTO, sortie 
     30   if !journal EQ 0 then begin 
     31      print, 'Il n''y a pas de journal ouvert !!' 
     32      GOTO, sortie 
    4333journal 
    4434;------------------------------------------------------------ 
    45 ; on complete le journal ... 
     35; we complete the journal ... 
    4636;------------------------------------------------------------ 
    47 ; on recupere le journal sous la forme d''un vecteur de string: 
     37; We recuperate the journal as a vector of string : 
    4838vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    49 ;FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i] 
     39FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i] 
    5040;------------------------------------------------------------ 
    51 ; on coupe la derniere ligne qui est @ps 
     41; We cut the last line which is \@ps 
    5242;------------------------------------------------------------ 
    5343IF strpos(vectjournal[n_elements(vectjournal)-1],'@ps') ne -1 then $ 
    5444  vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
    5545;------------------------------------------------------------ 
    56 ; on le corrige si besoin est... 
     46; We correct it if needed... 
    5747;------------------------------------------------------------ 
    5848for i = 0, n_elements(vectjournal)-1 do $ 
    5949 if strpos(vectjournal[i],'text_box' ) EQ -1 then $ 
    6050 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2) 
    61 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    62 ;2 lignes sont identiques ?? 
     51FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     52;2 lines are identical ?? 
    6353for i = 0, n_elements(vectjournal)-2 do $ 
    6454 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' ' 
    65 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    66  
     55FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     56; 
    6757for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    6858 if strpos(vectjournal[i],'oups' ) NE -1 $ 
     
    7060 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $ 
    7161 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & endfor 
    72 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     62FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    7363for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    7464 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $ 
     
    7969 OR strpos(vectjournal[i],'print' ) NE -1 $ 
    8070 then  vectjournal[i] = ' ' & endfor 
    81 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     71FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    8272for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    8373 if strpos(strtrim(vectjournal[i], 1),'plt' ) NE -1 THEN BEGIN & $ 
     
    8676 vectjournal[i] = vectjournal[i]+',/noerase' & $ 
    8777 ENDIF & endfor 
    88 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     78FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    8979for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    9080 if strpos(vectjournal[i],'text_box' ) NE -1 then $ 
     
    9282 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor 
    9383 
    94 ; on le complete pour le transformer en une procedure equivalente a plein2dessin 
    95 ;   vectjournal = ['reinitplt, /z,/invert' $ 
     84; We complete it to transform it in a procedure equivalent to plein2dessin 
     85   vectjournal = ['reinitplt, /z,/invert' $ 
    9686   vectjournal = ['openps, infowidget= infowidget' $ 
    9787                  , vectjournal $ 
    9888                  ,'closeps, infowidget= infowidget' $ 
    9989                  ,'printps' ] 
    100 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    101 ; on reecrit idlsave.pro 
     90FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     91; We rewrite idlsave.pro 
    10292   putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    103 ; applique idlsave 
     93; apply idlsave 
    10494   cd,  current = curdir 
    10595   cd, myuniquetmpdir 
    10696@idlsave    
    10797   cd, curdir 
    108 ; on reouvre le journal et on y met les elements de 
    109 ; vectjournal sauf les 2 premieres lignes et les 3 dernieres lignes 
     98; We reopen the journal and we put in it all elements of vectjournal but the 2 first and the 3 last line. 
    11099journal, myuniquetmpdir+'idlsave.pro' 
    111100for i = 2, n_elements(vectjournal)-3 DO $ 
  • trunk/SRC/ToBeReviewed/STATISTICS/a_correlate2d.pro

    r134 r150  
    1 ;+ 
    2 ; NAME: 
    3 ;       A_CORRELATE2d 
    4 ; 
    5 ; PURPOSE: 
    6 ; 
    7 ;       This function computes the autocorrelation Px(K,L) or 
    8 ;       autocovariance Rx(K,L) of a sample population X[nx,ny] as a 
    9 ;       function of the lag (K,L). 
    10 ; 
    11 ; CATEGORY: 
    12 ;       Statistics. 
    13 ; 
    14 ; CALLING SEQUENCE: 
    15 ;       Result = a_correlate2d(X, Lag) 
    16 ; 
    17 ; INPUTS: 
    18 ;       X:    an 2 dimension Array [nx,ny] 
    19 ; 
    20 ;     LAG:    2-element vector, in the intervals [-(nx-2), (nx-2)],[-(ny-2), (ny-2)], 
    21 ;             of type integer that specifies the absolute distance(s) between  
    22 ;             indexed elements of X. 
    23 ; 
    24 ; KEYWORD PARAMETERS: 
    25 ;       COVARIANCE:    If set to a non-zero value, the sample autocovariance 
    26 ;                      is computed. 
    27 ; 
    28 ;       DOUBLE:        If set to a non-zero value, computations are done in 
    29 ;                      double precision arithmetic. 
    30 ; 
    31 ; EXAMPLE: 
    32 ; 
    33 ; PROCEDURE: 
    34 ; 
    35 ; 
    36 ;                          nx-k-1  ny-l-1  
    37 ;                          sigma   sigma  (X[i,j]-Xmean)(X[i+k,j+l]-Ymean) 
    38 ;                           i=0     j=0 
    39 ;   correlation(X,[k,l])=------------------------------------------------------ 
    40 ;                                  nx-1   ny-1                   
    41 ;                                 sigma  sigma  (X[i,j]-Xmean)^2) 
    42 ;                                  i=0    j=0                       
    43 ; 
    44 ; 
    45 ;                          nx-k-1  ny-l-1  
    46 ;                          sigma   sigma  (X[i,j]-Xmean)(Y[i+k,j+l]-Ymean) 
    47 ;                           i=0     j=0 
    48 ;   covariance(X,[k,l])=------------------------------------------------------ 
    49 ;                                            nx*ny 
    50 ; 
    51 ;   Where Xmean is the mens of the sample population 
    52 ;   x=(x[0,0],x[1,0],...,x[nx-1,ny-1]). 
    53 ; 
    54 ; 
    55 ; REFERENCE: 
    56 ; 
    57 ; MODIFICATION HISTORY: 
    58 ;       28/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
    59 ;       Based on the A_CORRELATE procedure of IDL 
    60 ;- 
    611 
    622FUNCTION Auto_Cov2d, X, Lag, Double = Double, zero2nan = zero2nan 
     
    7717 
    7818END 
     19;+ 
     20; 
     21; @file_comments 
     22; This function computes the autocorrelation Px(K,L) or 
     23; autocovariance Rx(K,L) of a sample population X[nx,ny] as a 
     24; function of the lag (K,L). 
     25; 
     26; @categories 
     27; Statistics. 
     28; 
     29; @param X {in}{required} 
     30; An 2 dimension Array [nx,ny] 
     31; 
     32; @param LAG {in}{required} 
     33; 2-element vector, in the intervals [-(nx-2), (nx-2)],[-(ny-2), (ny-2)], 
     34; of type integer that specifies the absolute distance(s) between  
     35; indexed elements of X. 
     36; 
     37; @keyword COVARIANCE 
     38; If set to a non-zero value, the sample autocovariance is computed. 
     39; 
     40; @keyword DOUBLE 
     41; If set to a non-zero value, computations are done in double precision arithmetic. 
     42; 
     43; @history 
     44; 28/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
     45; Based on the A_CORRELATE procedure of IDL 
     46; 
     47; @version 
     48; $Id$ 
     49; 
     50;- 
     51 
    7952 
    8053FUNCTION A_Correlate2d, X, Lag, Covariance = Covariance, Double = Double 
  • trunk/SRC/ToBeReviewed/STATISTICS/a_timecorrelate.pro

    r134 r150  
    1 ;+ 
    2 ; NAME: 
    3 ;       A_TIMECORRELATE 
    4 ; 
    5 ; PURPOSE: 
    6 ;       Same function as A_CORRELATE but accept array (until 4 
    7 ;       dimension) for input and do the autocorrelation or the 
    8 ;       autocovariance along the time dimension which must be the last 
    9 ;       one of the input array. 
    10 ; 
    11 ;       This function computes the autocorrelation Px(L) or autocovariance 
    12 ;       Rx(L) of a sample population X as a function of the lag (L). 
    13 ; 
    14 ; CATEGORY: 
    15 ;       Statistics. 
    16 ; 
    17 ; CALLING SEQUENCE: 
    18 ;       Result = a_timecorrelate(X, Lag) 
    19 ; 
    20 ; INPUTS: 
    21 ;       X:    an Array which last dimension is the time dimension os 
    22 ;       size n. 
    23 ; 
    24 ;     LAG:    A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
    25 ;             of type integer that specifies the absolute distance(s) between  
    26 ;             indexed elements of X. 
    27 ; 
    28 ; KEYWORD PARAMETERS: 
    29 ;       COVARIANCE:    If set to a non-zero value, the sample autocovariance 
    30 ;                      is computed. 
    31 ; 
    32 ;       DOUBLE:        If set to a non-zero value, computations are done in 
    33 ;                      double precision arithmetic. 
    34 ; 
    35 ; EXAMPLE 
    36 ;       Define an n-element sample population. 
    37 ;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
    38 ; 
    39 ;       Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8 
    40 ;         lag = [-3, 0, 1, 3, 4, 8] 
    41 ;         result = a_correlate(x, lag) 
    42 ; 
    43 ;       The result should be: 
    44 ;         [0.0146185, 1.00000, 0.810879, 0.0146185, -0.325279, -0.151684] 
    45 ; 
    46 ; PROCEDURE: 
    47 ; 
    48 ; 
    49 ;                         n-L-1  
    50 ;                         sigma  (X[k]-Xmean)(X[k+L]-Xmean) 
    51 ;                          k=0 
    52 ;   correlation(X,L)=---------------------------------------- 
    53 ;                            n-1                    
    54 ;                           sigma  (X[k]-Xmean)^2 
    55 ;                            k=0                    
    56 ; 
    57 ; 
    58 ; 
    59 ;                        n-L-1  
    60 ;                        sigma  (X[k]-Xmean)(X[k+L]-Xmean) 
    61 ;                         k=0 
    62 ;   covariance(X,L)=------------------------------------------- 
    63 ;                                     n 
    64 ; 
    65 ;   Where Xmean is the Time mean of the sample population 
    66 ;   x=(x[t=0],x[t=1],...,x[t=n-1]) 
    67 ; 
    68 ; 
    69 ; REFERENCE: 
    70 ;       INTRODUCTION TO STATISTICAL TIME SERIES 
    71 ;       Wayne A. Fuller 
    72 ;       ISBN 0-471-28715-6 
    73 ; 
    74 ; MODIFICATION HISTORY: 
    75 ;       24/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
    76 ;       Based on the A_CORRELATE procedure of IDL 
    77 ;- 
    78  
    791FUNCTION TimeAuto_Cov, X, M, nT, Double = Double, zero2nan = zero2nan 
    802;Sample autocovariance function 
     
    10830 
    10931END 
     32;+ 
     33; @file_comments 
     34; Same function as A_CORRELATE but accept array (until 4 
     35; dimension) for input and do the autocorrelation or the 
     36; autocovariance along the time dimension which must be the last 
     37; one of the input array. 
     38; 
     39; This function computes the autocorrelation Px(L) or autocovariance 
     40; Rx(L) of a sample population X as a function of the lag (L). 
     41; 
     42; @categories 
     43; Statistics. 
     44; 
     45; @param X {in}{required} 
     46; An Array which last dimension is the time dimension os 
     47; size n. 
     48; 
     49; @param LAG {in}{required} 
     50; A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
     51; of type integer that specifies the absolute distance(s) between  
     52; indexed elements of X. 
     53; 
     54; @keyword COVARIANCE 
     55; If set to a non-zero value, the sample autocovariance 
     56; is computed. 
     57; 
     58; @keyword DOUBLE 
     59; If set to a non-zero value, computations are done in 
     60; double precision arithmetic. 
     61; 
     62; @examples 
     63;       Define an n-element sample population. 
     64;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
     65; 
     66;       Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8 
     67;         lag = [-3, 0, 1, 3, 4, 8] 
     68;         result = a_correlate(x, lag) 
     69; 
     70;       The result should be: 
     71;         [0.0146185, 1.00000, 0.810879, 0.0146185, -0.325279, -0.151684] 
     72; 
     73; @history 
     74; 24/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
     75; 
     76; Based on the A_CORRELATE procedure of IDL 
     77; INTRODUCTION TO STATISTICAL TIME SERIES 
     78; Wayne A. Fuller 
     79; ISBN 0-471-28715-6 
     80; 
     81; @version 
     82; $Id$ 
     83; 
     84;- 
    11085 
    11186FUNCTION A_TimeCorrelate, X, Lag, COVARIANCE = Covariance, DOUBLE = Double 
  • trunk/SRC/ToBeReviewed/STATISTICS/c_timecorrelate.pro

    r134 r150  
    1 ;+ 
    2 ; NAME: 
    3 ;       C_TIMECORRELATE 
    4 ; 
    5 ; PURPOSE: 
    6 ;       This function computes the "time cross correlation" Pxy(L) or 
    7 ;       the "time cross covariance" between 2 arrays (this is some 
    8 ;       kind of c_correlate but for multidimenstionals arrays) as a 
    9 ;       function of the lag (L). 
    10 ; 
    11 ; CATEGORY: 
    12 ;       Statistics. 
    13 ; 
    14 ; CALLING SEQUENCE: 
    15 ;       Result = c_timecorrelate(X, Y, Lag) 
    16 ; 
    17 ; INPUTS: 
    18 ;       X:   an Array which last dimension is the time dimension of 
    19 ;       size n, float or double. 
    20 ; 
    21 ;       Y:    an Array which last dimension is the time dimension of 
    22 ;       size n, float or double. 
    23 ; 
    24 ;     LAG:    A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
    25 ;             of type integer that specifies the absolute distance(s) between 
    26 ;             indexed elements of X. 
    27 ; 
    28 ; KEYWORD PARAMETERS: 
    29 ;       COVARIANCE:    If set to a non-zero value, the sample cross  
    30 ;                      covariance is computed. 
    31 ; 
    32 ;       DOUBLE:        If set to a non-zero value, computations are done in 
    33 ;                      double precision arithmetic. 
    34 ; 
    35 ; EXAMPLE 
    36 ;       Define two n-element sample populations. 
    37 ;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
    38 ;         y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] 
    39 ; 
    40 ;       Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 
    41 ;         lag = [-5, 0, 1, 5, 6, 7] 
    42 ;         result = c_timecorrelate(x, y, lag) 
    43 ; 
    44 ;       The result should be: 
    45 ;         [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] 
    46 ; 
    47 ; PROCEDURE: 
    48 ; 
    49 ; 
    50 ;   FOR L>=0  
    51 ; 
    52 ;                              n-L-1  
    53 ;                              sigma  (X[k]-Xmean)(Y[k+L]-Ymean) 
    54 ;                               k=0 
    55 ;   correlation(X,Y,L)=------------------------------------------------------ 
    56 ;                              n-1                     n-1 
    57 ;                      sqrt( (sigma  (X[k]-Xmean)^2)*(sigma  (Y[k]-Ymean)^2)) 
    58 ;                              k=0                     k=0 
    59 ; 
    60 ; 
    61 ; 
    62 ;                              n-L-1  
    63 ;                              sigma  (X[k]-Xmean)(Y[k+L]-Ymean) 
    64 ;                               k=0 
    65 ;   covariance(X,Y,L)=------------------------------------------------------ 
    66 ;                                            n 
    67 ; 
    68 ;   FOR L<0 
    69 ; 
    70 ; 
    71 ;                              n-L-1  
    72 ;                              sigma  (X[k+L]-Xmean)(Y[k]-Ymean) 
    73 ;                               k=0 
    74 ;   correlation(X,Y,L)=------------------------------------------------------ 
    75 ;                              n-1                     n-1 
    76 ;                      sqrt( (sigma  (X[k]-Xmean)^2)*(sigma  (Y[k]-Ymean)^2)) 
    77 ;                              k=0                     k=0 
    78 ; 
    79 ; 
    80 ; 
    81 ;                              n-L-1  
    82 ;                              sigma  (X[k+L]-Xmean)(Y[k]-Ymean) 
    83 ;                               k=0 
    84 ;   covariance(X,Y,L)=------------------------------------------------------ 
    85 ;                                            n 
    86 ; 
    87 ;   Where Xmean and Ymean are the time means of the sample populations 
    88 ;   x=(x[t=0],x[t=1],...,x[t=n-1]) and y=(y[t=0],y[t=1],...,y[t=n-1]), 
    89 ;   respectively. 
    90 ; 
    91 ; 
    92 ; 
    93 ; REFERENCE: 
    94 ;       INTRODUCTION TO STATISTICAL TIME SERIES 
    95 ;       Wayne A. Fuller 
    96 ;       ISBN 0-471-28715-6 
    97 ; 
    98 ; MODIFICATION HISTORY: 
    99 ;       - 01/03/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
    100 ;       Based on the C_CORRELATE procedure of IDL 
    101 ;       - August 2003 Sebastien Masson  
    102 ;       update according to the update made in C_CORRELATE by 
    103 ;       W. Biagiotti and available in IDL 5.5 
    104 ;- 
    105  
    1061FUNCTION TimeCross_Cov, Xd, Yd, M, nT, Ndim, Double = Double, ZERO2NAN = zero2nan 
    1072  ;Sample cross covariance function. 
     
    12722 
    12823END 
    129  
     24;+ 
     25; @file_comments 
     26; This function computes the "time cross correlation" Pxy(L) or 
     27; the "time cross covariance" between 2 arrays (this is some 
     28; kind of c_correlate but for multidimenstionals arrays) as a 
     29; function of the lag (L). 
     30; 
     31; @categories 
     32; Statistics. 
     33; 
     34; @param X {in}{required} 
     35; An Array which last dimension is the time dimension of 
     36; size n, float or double. 
     37; 
     38; @param Y {in}{required} 
     39; An Array which last dimension is the time dimension of 
     40; size n, float or double. 
     41; 
     42; @param LAG {in}{required} 
     43; A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
     44; of type integer that specifies the absolute distance(s) between 
     45; indexed elements of X. 
     46; 
     47; @keyword COVARIANCE 
     48; If set to a non-zero value, the sample cross  
     49; covariance is computed. 
     50; 
     51; @keyword DOUBLE 
     52; If set to a non-zero value, computations are done in 
     53; double precision arithmetic. 
     54; 
     55; @examples 
     56;  
     57;       Define two n-element sample populations. 
     58;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
     59;         y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] 
     60; 
     61;       Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 
     62;         lag = [-5, 0, 1, 5, 6, 7] 
     63;         result = c_timecorrelate(x, y, lag) 
     64; 
     65;       The result should be: 
     66;         [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] 
     67; 
     68; @history 
     69;       - 01/03/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 
     70;       Based on the C_CORRELATE procedure of IDL 
     71;       - August 2003 Sebastien Masson  
     72;       update according to the update made in C_CORRELATE by 
     73;       W. Biagiotti and available in IDL 5.5 
     74; 
     75;       INTRODUCTION TO STATISTICAL TIME SERIES 
     76;       Wayne A. Fuller 
     77;       ISBN 0-471-28715-6 
     78; 
     79; @version 
     80; $Id$ 
     81; 
     82;- 
    13083FUNCTION C_Timecorrelate, X, Y, Lag, Covariance = Covariance, Double = Double 
    13184 
  • trunk/SRC/ToBeReviewed/STRUCTURE/chkstru.pro

    r134 r150  
    1 ; $Id$ 
    21;------------------------------------------------------------- 
    32;+ 
    4 ; NAME: 
    5 ;        CHKSTRU  (function) 
     3; @file_comments 
     4; check validity of a structure and test if necessary 
     5; fields are contained 
    66; 
    7 ; PURPOSE: 
    8 ;        check validity of a structure and test if necessary 
    9 ;        fields are contained 
     7; @categories 
     8; tools 
    109; 
    11 ; CATEGORY: 
    12 ;        tools 
     10; @param  STRUCTURE {in}{required} 
     11; The structure to be tested. If STRUCTURE is 
     12; not of type structure, the function will return 0 
    1313; 
    14 ; CALLING SEQUENCE: 
    15 ;        res=CHKSTRU(STRUCTURE,FIELDS [,/VERBOSE])  
     14; @param FIELDS {in}{required} 
     15; A string or string array with field names to  
     16; be contained in STRUCTURE. CHKSTRU returns 1 (true) 
     17; only if all field names are contained in STRUCTURE. 
     18; The entries of FIELDS may be upper or lowercase. 
    1619; 
    17 ; INPUTS: 
    18 ;        STRUCTURE --> the structure to be tested. If STRUCTURE is 
    19 ;             not of type structure, the function will return 0 
     20; @keyword INDEX 
     21; A named variable that will contain the indices of 
     22; the required field names in the structure. They can then 
     23; be assessed through structure.(index[i]) . Index will 
     24; contain -1 for all fields entries that are not in the 
     25; structure. 
    2026; 
    21 ;        FIELDS --> a string or string array with field names to  
    22 ;             be contained in STRUCTURE. CHKSTRU returns 1 (true) 
    23 ;             only if all field names are contained in STRUCTURE. 
    24 ;             The entries of FIELDS may be upper or lowercase. 
     27; @keyword VERBOSE 
     28; set this keyword to return an error message  
     29; in case of an error. 
    2530; 
    26 ; KEYWORD PARAMETERS: 
    27 ;        INDEX --> a named variable that will contain the indices of 
    28 ;             the required field names in the structure. They can then 
    29 ;             be assessed through structure.(index[i]) . Index will 
    30 ;             contain -1 for all fields entries that are not in the 
    31 ;             structure. 
     31; @keyword EXTRACT 
     32; set this keyword to extract a fields from the 
     33; structure.  -1 is return is fields or structure. are 
     34; incorrect. 
    3235; 
    33 ;        /VERBOSE --> set this keyword to return an error message  
    34 ;             in case of an error. 
     36; @returns 
     37; CHKSTRU returns 1 if successful, otherwise 0. 
    3538; 
    36 ;        /EXTRACT --> set this keyword to extract a fields from the 
    37 ;        structure.  -1 is return is fields or structure. are 
    38 ;        incorrect. 
    39 ; 
    40 ; OUTPUTS: 
    41 ;        CHKSTRU returns 1 if successful, otherwise 0. 
    42 ; 
    43 ; SUBROUTINES: 
    44 ; 
    45 ; REQUIREMENTS: 
    46 ; 
    47 ; NOTES: 
    48 ; 
    49 ; EXAMPLE: 
     39; @examples 
    5040;        test = { a:1, b:2, c:3 } 
    5141;        required = ['a','c'] 
     
    5646;               2 
    5747; 
    58 ; MODIFICATION HISTORY: 
     48; @history 
    5949;        mgs, 02 Mar 1998: VERSION 1.00 
    6050;        mgs, 07 Apr 1998: - second parameter (FIELDS) now optional 
    6151;        12 Jan 2001: EXTRACT keyword by S. Masson (smasson@lodyc.jussieu.fr)  
     52; 
     53; @version 
     54; $Id$ 
    6255; 
    6356;- 
  • trunk/SRC/ToBeReviewed/STRUCTURE/extractstru.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:extractstru 
     5; @file_comments 
     6; extract elements of a structure to constitute a new structure. 
    67; 
    7 ; PURPOSE:extrait des elements d''une structure pour constituer une 
    8 ;         nouvelle structure 
     8; @categories 
     9; utilities 
    910; 
    10 ; CATEGORY: dibouille sur les structures 
     11; @param STRU {in}{required} 
     12; A structure 
    1113; 
    12 ; CALLING SEQUENCE: res = extractstru(stru, liste) 
    13 ;  
    14 ; INPUTS: 
     14; @param LISTE {in}{required} 
     15; A vector of string including names of STRU to be deleted  
     16; (by default) or to be kept (if KEEP is activated). 
    1517; 
    16 ;    stru: une structure 
     18; @keyword KEEP 
     19; Specify that the given liste concern elements of STRU to be kept. 
    1720; 
    18 ;    liste: un vecteur de string comportant les noms des elements de 
    19 ;    stru a virer (par DEFAUT) ou a garder (si GARDE est active) 
     21; @keyword DELETE: 
     22; Specify  that the given liste concern elements of STRU to be deleted. 
     23; This keyword is activated by default. 
    2024; 
    21 ; KEYWORD PARAMETERS: 
     25; @returns 
     26; A structure or -1 in case of problem 
    2227; 
    23 ;    /GARDE: specifie que la liste donnee concerne les elements de 
    24 ;    stru a garder 
    25 ; 
    26 ;    /VIRE: specifie que la liste donnee concerne les elements de 
    27 ;    stru a virer. Ce mot cle est active par defaut 
    28 ; 
    29 ; OUTPUTS:une stucture ou -1 en cas de pb 
    30 ; 
    31 ; COMMON BLOCKS: 
    32 ; 
    33 ; SIDE EFFECTS: 
    34 ; 
    35 ; RESTRICTIONS: none !!! 
    36 ;    liste peut contenir des noms d''elements qui ne sont pas ds stru, 
    37 ;    le programme se debrouille avec 
    38 ; 
    39 ; EXAMPLE: 
     28; @examples 
    4029; 
    4130;    IDL> extra=get_extra(/ok, year=1999, age_capitaine=35 ) 
     
    4837;    ** Structure <831afac>, 1 tags, length=2, refs=1: 
    4938;       AGE_CAPITAINE   INT             35 
    50 ;    IDL> help, extractstru(extra,['ok','hhuihi','YEAR'],/garde),/stru 
     39;    IDL> help, extractstru(extra,['ok','hhuihi','YEAR'],/keep),/stru 
    5140;    ** Structure <834bbc4>, 2 tags, length=4, refs=1: 
    5241;       OK              INT              1 
    5342;       YEAR            INT           1999 
    5443; 
    55 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     44; @history 
     45; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    5646;                      8/10/1999 
     47; 
     48; @version 
     49; $Id$ 
     50;  
    5751;- 
    5852;------------------------------------------------------------ 
    5953;------------------------------------------------------------ 
    6054;------------------------------------------------------------ 
    61 FUNCTION extractstru, stru, liste, GARDE = garde, VIRE = vire 
     55FUNCTION extractstru, stru, liste, KEEP = keep, DELETE = delete 
    6256; 
    6357  compile_opt idl2, strictarrsubs 
     
    6559   if size(stru, /type) NE 8 then return,  -1 
    6660   if size(liste, /type) NE 7 then return,  -1 
    67 ; cheking for garde and vire keywords 
    68    garde = keyword_set(garde)*(1-keyword_set(vire)) 
    69    vire = keyword_set(vire)*(1-keyword_set(garde)) +(keyword_set(vire) EQ garde) 
     61; cheking for keep and vire keywords 
     62   keep = keyword_set(keep)*(1-keyword_set(delete)) 
     63   delete = keyword_set(delete)*(1-keyword_set(keep)) +(keyword_set(delete) EQ keep) 
    7064; 
    7165   tname = tag_names(stru) 
    7266   index = make_selection(tname, strupcase(liste), /only_valid, /quiet) 
    7367; 
    74    if garde then BEGIN ; on garde que la liste 
     68   if keep then BEGIN ; We just keep the list 
    7569      if index[0] EQ -1 then return,  -1 
    7670      if n_elements(index) EQ n_elements(tname) then return, stru 
     
    7872      if n_elements(index) GT 1 then for i = 1, n_elements(index)-1 do $ 
    7973            res = create_struct(res, tname[index[i]], stru.(index[i])) 
    80    ENDIF ELSE BEGIN ; on vire la liste 
     74   ENDIF ELSE BEGIN ; We delete the list 
    8175      if n_elements(index) EQ n_elements(tname) then return,  -1 
    8276      if index[0] EQ -1 then return, stru 
    83 ; on prend le complementaire de index pour obtenir les indices que 
    84 ; l''on garde 
     77; We take the complementary one of index to obtain indexes we keep. 
    8578      index = different(indgen(n_elements(tname)), index) 
    8679      res = create_struct(tname[index[0]], stru.(index[0])) 
  • trunk/SRC/ToBeReviewed/STRUCTURE/mixstru.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: mixstru 
    65; 
    7 ; PURPOSE: concatene 2 structures ensemble. La difference avec 
    8 ; CREATE_STRUCT etant que si les 2 stuctures ont les memes noms 
    9 ; d''elements alors mixstru ne plante pas mais choisit pour valeur de 
    10 ; l''element commun celle specifiee par la premiere structure. 
     6; @file_comments 
     7; Concatenate 2 structures together. The difference with CREATE_STRUCT  
     8; is  that if the 2 structure have same elements's name, then mixstru  
     9; do not break down but choose for the common element the value  
     10; specified by the first structure. 
    1111; 
    12 ; CATEGORY: structure 
     12; @categories 
     13; structure 
     14;  
     15; @param STRU1 {in}{required} 
     16; Structure which can have same elements's name than  
     17; STRU2 but with a different value. 
    1318; 
    14 ; CALLING SEQUENCE: rs=mixstru(stru1,stru2) 
    15 ;  
    16 ; INPUTS: stru1 et stu2 sont 2 structures qui peuvent avoir des 
    17 ; elements portant le meme nom mais avec une valeur differente. 
     19; @param STRU2 {in}{required} 
     20; Structure which can have same elements's name than  
     21; STRU1 but with a different value. 
    1822; 
    19 ; KEYWORD PARAMETERS: none 
     23; @returns 
     24; A stucture 
    2025; 
    21 ; OUTPUTS: une stucture 
     26; @restrictions 
     27; If STRU1 or  STRU2 is not a structure, mixstru send back -1 
    2228; 
    23 ; COMMON BLOCKS: 
    24 ; 
    25 ; SIDE EFFECTS: si stru1 ou stru2 ne sont pas des structures mixstru 
    26 ; renvoie -1 
    27 ; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; EXAMPLE: 
     29; @examples 
    3130;      
    3231;     IDL> a=get_extra(/toto,ok=123) 
     
    5352;        YEAR            INT           1999 
    5453; 
    55 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     54; @history 
     55; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    5656;                      7/10/1999 
     57; 
     58; @version 
     59; $Id$ 
     60; 
    5761;- 
    5862;------------------------------------------------------------ 
  • trunk/SRC/ToBeReviewed/STRUCTURE/struct2string.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:struct2string 
     5;  
     6; @file_comments 
     7; Convert a structure to an "executable string" 
    68; 
    7 ; PURPOSE:convert a structure to an "executable string" 
     9; @categories 
     10; utilities 
     11;  
     12; @param STRUCT {in}{required} 
     13; A structure 
    814; 
    9 ; CATEGORY:bidouille 
     15; @keyword MAX_STRUCT_LENGTH 
     16; The maximum length of the structure 
     17; permetted to convert the structure to string. Default is 
     18; 10000l. 
    1019; 
    11 ; CALLING SEQUENCE:sting=struct2string(struct) 
    12 ;  
    13 ; INPUTS:struct: a structure 
     20; @keyword DIRECT2STRING 
     21; To get a string instead an "executable string" 
    1422; 
    15 ; KEYWORD PARAMETERS: 
     23; @keyword CUT_IN_STRING 
     24; Try it 
    1625; 
    17 ;      MAX_STRUCT_LENGTH : the maximum length of the structure 
    18 ;      permetted to convert the structure to string. Default is 
    19 ;      10000l. 
     26; @restrictions 
     27; Use tostr.pro, cf this function header! 
    2028; 
    21 ;      /DIRECT2STRING: to get a string instead an "executable string" 
    22 ; 
    23 ;      /CUT_IN_STRING: try it 
    24 ; 
    25 ; OUTPUTS: 
    26 ; 
    27 ; SIDE EFFECTS:use tostr.pro, cf this function header! 
    28 ; 
    29 ; RESTRICTIONS:use tostr.pro, cf this function header! 
    30 ; 
    31 ; EXAMPLE: 
     29; @examples 
    3230; 
    3331;      IDL> print, struct2string(!d) 
     
    3836;      ,[0,0],'ZOOM',[1,1]) 
    3937; 
    40 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     38; @history 
     39; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    4140;                      2000 07 03 
     41; 
     42; @version 
     43; $Id$ 
     44; 
    4245;- 
    4346;------------------------------------------------------------ 
  • trunk/SRC/ToBeReviewed/STRUCTURE/where_tag.pro

    r134 r150  
    11;+ 
    2 ; NAME: 
    3 ;       WHERE_TAG 
    4 ; PURPOSE: 
    5 ;       Like WHERE but works on structure tag names 
    6 ; EXPLANATION: 
    7 ;       Obtain subscripts of elements in structure array for which 
    8 ;       a particular Tag has values in a range or matching specified values. 
    9 ;       Like the WHERE function but for use with structures 
    10 ; CATEGORY: 
    11 ;                       Structures 
    12 ; CALLING SEQUENCE: 
    13 ;        w = where_tag( struct, [ Nfound,  TAG_NAME=, TAG_NUMBER = , RANGE =,  
    14 ;                               VALUES =, RANGE =, ISELECT =, /NOPRINT ] 
     2; @file_comments 
     3; Like WHERE but works on structure tag names 
     4; Obtain subscripts of elements in structure array for which 
     5; a particular Tag has values in a range or matching specified values. 
     6; Like the WHERE function but for use with structures 
     7;  
     8; @categories 
     9; Structures 
    1510; 
    16 ; INPUTS: 
    17 ;       Struct = structure array to search. 
     11; @param STRUCT {in}{required} 
     12; structure array to search. 
    1813; 
    19 ; INPUT KEYWORDS: 
    20 ;       User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2) 
    21 ;               the VALUES or RANGE to search on 
     14; @keyword TAG_NAME 
     15; Scalar string specifying Tag Name 
     16;  
     17; @keyword TAG_NUMBER 
     18; Otherwise give the Tag Number, 
     19;  
     20; @keyword RANGE 
     21;  [min,max] range to search for in Struct 
     22;  
     23; @keyword VALUES 
     24; One or array of numbers to match for in Struct, 
     25;  
     26; @keyword ISELECT 
     27; Specifies indices to select only part of structure array, 
     28; (use it to recycle subscripts from previous searches). 
     29;  
     30; @keyword NOPRINT 
     31; Suppress informational messages about nothing found. 
    2232; 
    23 ;       TAG_NAME = Scalar string specifying Tag Name 
    24 ;       TAG_NUMBER = otherwise give the Tag Number, 
    25 ;       RANGE = [min,max] range to search for in Struct, 
    26 ;       VALUES = one or array of numbers to match for in Struct, 
    27 ;       ISELECT= specifies indices to select only part of structure array, 
    28 ;               (use it to recycle subscripts from previous searches). 
    29 ;       /NOPRINT = suppress informational messages about nothing found. 
     33; @returns 
     34; Nfound {out} 
     35; # of occurences found. 
     36;  
     37; @restrictions 
     38; User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2) 
     39; the VALUES or RANGE to search on; 
    3040; 
    31 ; OUTPUTS: 
    32 ;       Nfound = # of occurences found. 
    33 ; 
    34 ; RESULT: 
    35 ;       Function returns subscripts (indices) to desired elements. 
    36 ; 
    37 ; EXAMPLES: 
     41; @examples 
    3842;       Suppose STR is a structure with tags CAT_NO:indgen(10), and  
    3943;               NAME:strarr(10).   Find the indices where STR.CAT_NO is 
     
    4347;       IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5])  
    4448; 
    45 ; PROCEDURE: 
    46 ;       Get tag number and apply the WHERE function appropriately. 
    47 ; 
    48 ; MODIFICATION HISTORY: 
     49; @history 
    4950;       written 1990 Frank Varosi STX @ NASA/GSFC 
    5051;       Stop printing "Tag <xxx> not found" with /NOPRINT, CD Pike 8-Jun-93 
     52; 
     53; @version 
     54; $Id$ 
     55;  
    5156;- 
    5257function where_Tag, Struct, Nfound,     TAG_NAME=Tag_Name,      $ 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/ciseauxtri.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: 
    6 ; 
    7 ; PURPOSE:vire les tableaux qui ne doivent pas etre dessines grace a 2 
    8 ; tests: 
    9 ;     1) les coins du tableau doivent etre ds la fenetre 
    10 ;     2) les clongeurs des cotes des triangfles exprimes en 
    11 ;     coordonnees normalisesne doivent pas depasser une certaine 
    12 ;     longueur seuil.  
    13 ; 
    14 ; CATEGORY: 
    15 ; 
    16 ; CALLING SEQUENCE: 
    17 ; 
    18 ; INPUTS: 
    19 ; 
    20 ; KEYWORD PARAMETERS: 
    21 ; 
    22 ; OUTPUTS: 
    23 ; 
    24 ; COMMON BLOCKS: 
    25 ;       common.pro 
    26 ; 
    27 ; SIDE EFFECTS: 
    28 ; 
    29 ; RESTRICTIONS: 
    30 ; 
    31 ; EXAMPLE: 
    32 ; 
    33 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     5; @file_comments  
     6; Delete arrays which do not have to be drawn thanks to 2 tests: 
     7;     1) Corners of the array must be in the window 
     8;     2) Lenghtes of side of triangles expressed in normalized  
     9;        coordinates must not surpass a sill lenght.  
     10; 
     11; @categories 
     12; 
     13; @param TRIANG 
     14;  
     15; @param GLAM  
     16; 
     17; @param GPHI  
     18; 
     19; @keyword ALL 
     20;  
     21; @keyword _EXTRA 
     22; Used to pass your keywords. 
     23; 
     24; @uses 
     25; common.pro 
     26; 
     27; @history 
     28; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3429;                       20/2/99 
     30; 
     31; @version 
     32; $Id$ 
     33;  
    3534;- 
    3635;------------------------------------------------------------ 
    3736;------------------------------------------------------------ 
    3837;------------------------------------------------------------ 
    39 FUNCTION ciseauxtri, triang, glam, gphi, TOUT = tout, _EXTRA = ex 
     38FUNCTION ciseauxtri, triang, glam, gphi, ALL = all, _EXTRA = ex 
    4039;--------------------------------------------------------- 
    4140; 
     
    5251             OR !map.projection EQ 18) THEN return, triang 
    5352; 
    54    tempsun = systime(1)         ; pour key_performance 
     53   tempsun = systime(1)         ; For key_performance 
    5554; 
    5655   taille = size(glam) 
     
    5857   ny = taille[2] 
    5958 
    60    tempdeux = systime(1)        ; pour key_performance =2 
     59   tempdeux = systime(1)        ; For key_performance =2 
    6160   z = convert_coord(glam[*],gphi[*],/data,/to_normal)  
    6261   x = z[0, *] 
     
    6665    print, 'temps ciseauxtri: convert_coord data to_normal', systime(1)-tempdeux 
    6766; 
    68 ; attention, suivant la projection certains points x ou y peuvent 
    69 ; devenir NaN (cf. points deriere la terre ds une projection 
    70 ; orthographique) il faut dans ce cas enlever tous les triangles qui 
    71 ; contiennent un de ces points 
     67; Beware, following the projection, some points x or y can become NaN  
     68; (see points behind the Earth in an orthographic projection).  
     69; In this case, we have to remove all triangle which contain one of these points. 
    7270; 
    7371   if (!map.projection LE 7 AND !map.projection NE 0) $ 
    7472    OR !map.projection EQ 14 OR !map.projection EQ 15 OR !map.projection EQ 18 then begin 
    75       tempdeux = systime(1)     ; pour key_performance =2 
     73      tempdeux = systime(1)     ; For key_performance =2 
    7674; 
    7775      test = (x*y)[triang] 
     
    8886   seuil = 5 < (min([nx, ny])-2) 
    8987; 
    90 ; maintenant on vire les triangles dont un des cotes a une taille 
    91 ; superieure a 1/seuil du domaine reserve au dessin. 
     88; Now we delete tringles whose one side has a size superior to 1/sill from the domain reserved for the drawing. 
    9289; 
    9390 
    9491   if keyword_set(key_periodic)  then begin 
    95       tempdeux = systime(1)     ; pour key_performance =2 
     92      tempdeux = systime(1)     ; For key_performance =2 
    9693; 
    9794      xtri = x[triang] 
     
    111108       print, 'temps ciseauxtri: trouver les triangles trop grands', systime(1)-tempdeux 
    112109; 
    113       tempdeux = systime(1)     ; pour key_performance =2 
     110      tempdeux = systime(1)     ; For key_performance =2 
    114111      if ind[0] NE -1 then triang = triang[*, temporary(ind)] ELSE return,  -1 
    115112      trichanged = 1b 
     
    118115   endif 
    119116; 
    120 ; on supprime les triangles qui sont un peu trop hors du cadre 
    121 ; valable qd /TOUT est active 
     117; We delete all triangle which are out of the valid frame when  on supprime les triangles qui sont un peu trop hors du cadre 
     118; valable qd ALL is activated 
    122119; 
    123120    if keyword_set(key_irregular) then begin 
    124121 
    125        tempdeux = systime(1)     ; pour key_performance =2 
     122       tempdeux = systime(1)     ; For key_performance =2 
    126123       xtri = x[triang] 
    127124       test1 = xtri GE !p.position[0] 
     
    148145    ENDIF 
    149146; 
    150 ;        dernier tri 
     147;        Last sort. 
    151148; 
    152149   if keyword_set(trichanged) then BEGIN 
    153150; 
    154 ; il faut verifier que les triangles que l''on garde ne 
    155 ; forment pas une triangulation dans laquelle 2 triangles ont un 
    156 ; sommet en commun sans avoir de cote de commun. 
    157 ; 
    158 ; on constitue la liste des rectangles que l''on souhaite garder (on 
    159 ; garde un rectangle des qu''il y a un triangle dedans) 
    160 ; 
    161 ; dans definetri, on a construit les triangles tels que le premier et  
    162 ; le dernier sommets soient ceux de la diagonale du rectangle definit 
    163 ; par le maillage. 
    164 ; pour retouver de quel rectangle provient un triangle, on cherche le 
    165 ; min de l''indice suivant x et suivant y de chaque triangle. Apres on 
    166 ; repasse cette indissage suivant x et y en indicage suivant nx*ny 
    167 ; 
    168       tempdeux = systime(1)     ; pour key_performance =2 
    169 ; indices en y des rectangles 
     151; We have to check that triangles we keep do not form a triangulation  
     152; in which 2 triangles have a common summit without have a common side.  
     153; 
     154; We constitute the list of rectangles we want to keep (we keep every  
     155; rectangle containing a triangle) 
     156; 
     157; In definetri, we have construct triangles just so the first and the 
     158; last summit are those of the diagonale of the rectangle defined by 
     159; the mesh size. To find from which rectangle a triangle comes, we look 
     160; for the min of the index folowing x and following y of each triangle. 
     161; Then we go by again this indexion following x and y in an indexion 
     162; following nx*ny/ 
     163; 
     164      tempdeux = systime(1)     ; For key_performance =2 
     165; y indexes of rectangles 
    170166      indytriang = (triang[0, *]/nx) < (triang[2, *]/nx) 
    171 ; indices en x des rectangles 
     167; x indexes of rectangles 
    172168      indxtriang0 = triang[0, *]-nx*(triang[0, *]/nx) 
    173169      indxtriang2 = triang[2, *]-nx*(triang[2, *]/nx) 
    174170      indxmin = indxtriang0 < indxtriang2 
    175 ; attention dans le cas ou la grille est periodique et ou on a tous 
    176 ; les points suivant x, les triangles qui assurent la periodicite en x 
    177 ; ont des indices suivant x qui sont 0 et nx-1. Ils appatienent au 
    178 ; rectangles de la colonne nx-1 et non de la colonne 0 
     171; Beware in the case where the grid is periodic and where we have all points  
     172; following x, triangles which assure the periodicity in x have indexes  
     173; following x which are 0 and nx-1. They belong to rectangles of the column  
     174; nx-1 and not to column 0. 
    179175      if keyword_set(key_periodic) AND nx EQ jpi then BEGIN 
    180176      indxmax = indxtriang0 > indxtriang2 
     
    185181       print, 'temps ciseauxtri: liste des rectangles', systime(1)-tempdeux 
    186182; 
    187 ; maintenant qu''on a cette liste on va s''assuter que l''on a pas de 
    188 ; triangles qui n''ont qu''on sommet en commun. 
     183; Now we have this list, we will make sure that we do not have triangles  
     184; with only a common summit. 
    189185; 
    190186      test = bytarr(nx, ny) 
     
    192188      dejavire = 1b-test 
    193189; 
    194       tempdeux = systime(1)     ; pour key_performance =2 
     190      tempdeux = systime(1)     ; For key_performance =2 
    195191      vire1 = 0 
    196192      vire2 = 0 
     
    198194         vire1 = where( (test*shift(test, -1, -1) $ 
    199195                         *(1-shift(test, 0, -1))*(1-shift(test, -1, 0))) EQ 1) 
    200          if vire1[0] NE -1 THEN test[vire1] = 0 ; on vire le rectangle  
     196         if vire1[0] NE -1 THEN test[vire1] = 0 ; We delete the rectangle 
    201197         vire2 = where( ((1-test)*(1-shift(test, -1, -1)) $ 
    202198                         *shift(test, 0, -1)*shift(test, -1, 0)) EQ 1) 
    203 ; on vire le rectangle du dessus (meme indice x mais egale a 1) 
     199; We delete the top rectangle (same x index but equal to 1) 
    204200         if vire2[0] NE -1 THEN test[vire2+nx] = 0  
    205201      ENDWHILE 
     
    212208; 
    213209      if avirer[0] NE -1 then begin 
    214       tempdeux = systime(1)     ; pour key_performance =2 
     210      tempdeux = systime(1)     ; For key_performance =2 
    215211      indnx = n_elements(listrect) 
    216212      indny = n_elements(avirer) 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/completecointerre.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME: COMPLETECOINTERRE 
    6 ; 
    7 ; PURPOSE: pour colorier proprement les continents! (c''est une longue 
    8 ; histoire...) 
    9 ; 
    10 ; CATEGORY: pour plt 
    11 ; 
    12 ; CALLING SEQUENCE: completecointerre 
    13 ;  
    14 ; INPUTS: non 
    15 ; 
    16 ; KEYWORD PARAMETERS:  _EXTRA  
    17 ; 
    18 ;        CONT_COLOR: the color of the continent. defaut value is 
    19 ;        (!d.n_colors - 1) < 255 => white 
    20 ; 
    21 ; OUTPUTS: non 
    22 ; 
    23 ; COMMON BLOCKS: common.pro 
    24 ; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ; RESTRICTIONS: 
    28 ; 
    29 ; EXAMPLE: 
    30 ; 
    31 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    32 ;                      01/10/1999 
    33 ;- 
    34 ;------------------------------------------------------------ 
    35 ;------------------------------------------------------------ 
    36 ;------------------------------------------------------------ 
    371PRO draw_corner_triangle, lons, lats, seuil, CONT_COLOR = cont_color, _extra = ex 
    382; 
     
    5519;------------------------------------------------------------ 
    5620;------------------------------------------------------------ 
     21;------------------------------------------------------------ 
     22;+ 
     23; 
     24; @file_comments 
     25; To color cleanly continents 
     26; 
     27; @categories 
     28; graphic 
     29; 
     30; @keyword _EXTRA 
     31; Used to pass your keywords  
     32; 
     33; @keyword CONT_COLOR 
     34; The color of the continent. defaut value is 
     35; (!d.n_colors - 1) < 255 => white 
     36; 
     37; @uses 
     38; common.pro 
     39; 
     40; @history 
     41; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     42;                      01/10/1999 
     43; 
     44; @version 
     45; $Id$ 
     46; 
     47;- 
     48;------------------------------------------------------------ 
     49;------------------------------------------------------------ 
     50;------------------------------------------------------------ 
    5751PRO completecointerre, COINMONTE = coinmonte, COINDESCEND = coindescend $ 
    5852                       , CONT_COLOR = cont_color, INDICEZOOM = indicezoom $ 
     
    6660;   if NOT keyword_set(coindescend) then return 
    6761;   if NOT keyword_set(indicezoom) then return 
    68   tempsun = systime(1)          ; pour key_performance 
     62  tempsun = systime(1)          ; For key_performance 
    6963;------------------------------------------------------------ 
    70 ; definitions des vecteurs coinmont et coindesc 
     64; definitions of vectors coinmont and coindesc 
    7165;------------------------------------------------------------ 
    7266  if keyword_set(coinmonte) then coinmont = coinmonte $ 
     
    7670  IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) <  255 
    7771;------------------------------------------------------------ 
    78 ; definition descoordonnees des points numerotes 1,2,3,4,5,6 cf. les 
    79 ; schemas en dessous! 
     72; definition of coordinates of points numbered 1,2,3,4,5,6 (see figures below) 
    8073;------------------------------------------------------------ 
    81   tempdeux = systime(1)         ; pour key_performance =2 
     74  tempdeux = systime(1)         ; For key_performance =2 
    8275  if coinmont[0] NE -1 OR coindesc[0] NE -1 then BEGIN 
    8376    if keyword_set(indicezoom) then BEGIN 
     
    122115; 
    123116; 
    124 ; cas coin terre en montee: 
    125 ;      2 points terre en diagonale montante avec 2 points mer sur 
    126 ;      la diagonale descendante. 
     117; Case land corner in ascent: 
     118;      2 land points in diagonal ascending with 2 ocean points on the descendant diagonal. 
    127119; 
    128120;                     4     
     
    139131; 
    140132  if coinmont[0] NE -1 then BEGIN 
    141     tempdeux = systime(1)       ; pour key_performance =2 
     133    tempdeux = systime(1)       ; For key_performance =2 
    142134    for id = 0, n_elements(coinmont)-1 do BEGIN 
    143135      i = coinmont[id] 
     
    159151  ENDIF 
    160152;------------------------------------------------------------ 
    161 ; cas coin terre en descendante.: 
    162 ;      2 points terre en diagonale descendante avec 2 points mer sur 
    163 ;      la diagonale montante 
    164 ; 
     153; Case land corner in descent: 
     154;      2 land points in diagonal descending with 2 ocean points on the ascendant diagonal. 
     155;  
    165156;                     4 
    166157;     t(i+nx)=1    u(i+nx)       t(i+nx+1)=0 
     
    175166; 
    176167  if coindesc[0] NE -1 then begin 
    177     tempdeux = systime(1)       ; pour key_performance =2 
     168    tempdeux = systime(1)       ; For key_performance =2 
    178169    for id = 0, n_elements(coindesc)-1 do BEGIN 
    179170      i = coindesc[id] 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/definetri.pro

    r134 r150  
    11;+ 
    2 ; NAME:definetri 
    32; 
    4 ; PURPOSE:Define a triangulation array like TRIANGULATE.  
     3; @file_comments 
     4; efine a triangulation array like TRIANGULATE.  
    55;         But in a VERY SIMPLE CASE: 
    66; the points are regulary-gridded on nx*ny array. 
     
    3535; 
    3636; 
    37 ; CATEGORY: to understand how TRIANGULATE and TRIANGULATION work! 
     37; @categories 
     38; utilities 
     39;  
     40; @param NX {in}{required} 
     41; The x dimension array 
    3842; 
    39 ; CALLING SEQUENCE:triangles=definetri(nx, ny [,downward]) 
    40 ;  
    41 ; INPUTS: nx and ny are the array dimensions  
     43; @param NY {in}{required} 
     44; The y dimension array 
    4245; 
    43 ; OPTIONAL INPUTS: 
     46; @param DOWNWARD {in}{optional} 
     47; When downward is undefine all rectangles are cut 
     48; in using the upward diagonal. Downward is a vector which 
     49; contains the rectangles numbers which are cut in using the 
     50; downward diagonal. 
     51; The rectangle number is define by the index (in a nx*ny 
     52; vector) of the lower-left corner of the rectangle. 
    4453; 
    45 ;        downward: When downward is undefine all rectangles are cut 
    46 ;        in using the upward diagonal. Downward is a vector which 
    47 ;        contains the rectangles numbers which are cut in using the 
    48 ;        downward diagonal. 
    49 ;        The rectangle number is define by the index (in a nx*ny 
    50 ;        vector) of the lower-left corner of the rectangle. 
     54; @returns 
     55; triangles is a 2d array and is dimensions are 3 and 
     56; 2*(nx-1)*(ny-1) 
     57; triangles is define like in the TRIANGULATE procedure. 
    5158; 
    52 ; KEYWORD PARAMETERS: 
    53 ; 
    54 ; OUTPUTS: 
    55 ;        triangles is a 2d array and is dimensions are 3 and 
    56 ;        2*(nx-1)*(ny-1) 
    57 ;        triangles is define like in the TRIANGULATE procedure. 
    58 ;         
    59 ; 
    60 ; OPTIONAL OUTPUTS: 
    61 ; 
    62 ; COMMON BLOCKS: 
    63 ; 
    64 ; SIDE EFFECTS: 
    65 ; 
    66 ; RESTRICTIONS: 
    67 ; 
    68 ; PROCEDURE: 
    69 ; 
    70 ; EXAMPLE: 
     59; @examples 
    7160; 
    7261; triangles=definetri(3,3,[1,3]) 
     
    8473; 
    8574; 
    86 ; MODIFICATION HISTORY: sebastien Masson (smlod@ipsl.jussieu.fr) 
     75; @history 
     76; sebastien Masson (smlod@ipsl.jussieu.fr) 
    8777;                       4/3/1999 
    8878; 
     79; @version 
     80; $Id$ 
    8981;- 
    9082FUNCTION definetri, nx, ny, downward 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/definetri_e.pro

    r134 r150  
    1313 
    1414;+ 
    15 ; NAME:definetri 
    1615; 
    17 ; PURPOSE:Define a triangulation array like TRIANGULATE but for a 
     16; @file_comments 
     17; Define a triangulation array like TRIANGULATE but for a 
    1818; E-grid type 
    1919; 
    20 ; CATEGORY: make contours with E-grid type 
     20; @categories 
     21; Make contours with E-grid type 
     22;  
     23; @param NX {in}{required} 
     24; The x dimension array 
    2125; 
    22 ; CALLING SEQUENCE:triangles=definetri(nx, ny [,vertical]) 
    23 ;  
    24 ; INPUTS: nx and ny are the array dimensions  
     26; @param NY {in}{required} 
     27; The y dimension array 
    2528; 
    26 ; OPTIONAL INPUTS: 
     29; @param SINGULAR {in}{optional} 
     30; When singular is undefined all rectangles are cut 
     31; in using the vertical diagonal. Singular is a vector which 
     32; contains the rectangles numbers which are cut in using the 
     33; horizontal diagonal. 
     34; The rectangle number is define by the index (in a nx*ny 
     35; vector) of the lower-left corner of the rectangle. 
    2736; 
    28 ;        vertical: When vertical is undefine all rectangles are cut 
    29 ;        in using the horizontal diagonal. Vertical is a vector which 
    30 ;        contains the rectangles numbers which are cut in using the 
    31 ;        vertical diagonal. 
    32 ;        The rectangle number is define by the index (in a nx*ny 
    33 ;        vector) of the lower-left corner of the rectangle. 
    34 ; 
    35 ; KEYWORD PARAMETERS: 
    36 ; 
    37 ; OUTPUTS: 
    38 ;        triangles is a 2d array and is dimensions are 3 and 
    39 ;        2*(nx-1)*(ny-1) 
    40 ;        triangles is define like in the TRIANGULATE procedure. 
    41 ;         
    42 ; 
    43 ; OPTIONAL OUTPUTS: 
    44 ; 
    45 ; COMMON BLOCKS: 
    46 ; 
    47 ; SIDE EFFECTS: 
    48 ; 
    49 ; RESTRICTIONS: 
    50 ; 
    51 ; PROCEDURE: 
    52 ; 
    53 ; EXAMPLE: 
     37; @keyword SHIFTED 
    5438; 
    5539; 
    56 ; MODIFICATION HISTORY: sebastien Masson (smlod@ipsl.jussieu.fr) 
     40; @returns 
     41; Triangles is a 2d array and is dimensions are 3 and 
     42; (nx-1)*(ny-1) 
     43; Triangles is defined like in the TRIANGULATE procedure. 
     44;         
     45; @history 
     46; Sebastien Masson (smlod@ipsl.jussieu.fr) 
    5747;                       June 2001 
    5848; 
     49; @version 
     50; $Id$ 
     51; 
     52; @todo  
     53; seb: documenter SHIFTED 
    5954;- 
    6055FUNCTION definetri_e, nx, ny, singular, SHIFTED = shifted 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/dessinetri.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:dessinetri 
    65; 
    7 ; PURPOSE:dessine la triangulation 
     6; @file_comments 
     7; Draw the triangulation 
    88; 
    9 ; CATEGORY:pour comprendre comment ca marche 
     9; @categories 
     10; utilities 
     11;  
     12; @param TRI {in}{optional} 
     13; Array which define the triangulation (provided by triangule.pro or triangulate) 
     14;  
     15; @param X {in}{optional} 
     16; The x position of points to which the trangulation refer to  
     17; (see the x array provided in triangulate) 
    1018; 
    11 ; CALLING SEQUENCE:dessinetri [, tri, x, y] 
    12 ;  
    13 ; INPUTS:optionnels 
    14 ;        par defaut on choisit la triangulation qui est utilise pour 
    15 ;        les plots et on la trace aux points definites par vargrid 
     19; @param Y {in}{optional} 
     20; The y position of points to which the trangulation refer to  
     21; (see the y array provided in triangulate) 
    1622; 
    17 ;        sinon il faut fournir les tableaux  
    18 ;        tri definissant la triangulation (fournis par triangule.pro 
    19 ;        ou triangulate)  
    20 ;        x et y qui sont les positions de points a laquelle se raporte 
    21 ;        la triangulation (cf. les tableau x et y fournis ds 
    22 ;        triangulate) 
     23; @keyword WAIT 
     24; =x. to call wait x second between each triangle draw. 
    2325; 
    24 ; KEYWORD PARAMETERS:  
     26; @keyword ONEBYONE 
     27; To draw the triangles one by one 
    2528; 
    26 ;        All plots or polyfill keywords. 
     29; @keyword FILL 
     30; To fill the triangles (using polyfill) instead of plotting them 
    2731; 
    28 ;        WAIT=x. to call wait x second between each triangle draw. 
     32; @keyword CHANGECOLOR 
     33; =n. To change the color of each traingle. n colors 
     34; will be used and repeted if necessary. 
    2935; 
    30 ;        /ONEBYONE: to draw the triangles one by one 
     36; @uses 
     37; common.pro 
    3138; 
    32 ;        /FILL: to fill the triangles (using polyfill) instead of plotting them 
     39; @history 
     40; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3341; 
    34 ;        CHANGECOLOR=n. to change the color of each traingle. n colors 
    35 ;        will be used and repeted if necessary. 
    36 ; 
    37 ; 
    38 ; OUTPUTS: 
    39 ; 
    40 ; COMMON BLOCKS:common.pro 
    41 ; 
    42 ; SIDE EFFECTS: 
    43 ; 
    44 ; RESTRICTIONS: 
    45 ; 
    46 ; EXAMPLE: 
    47 ; 
    48 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     42; @version 
     43; $Id$ 
    4944; 
    5045;- 
     
    5853; 
    5954@common 
    60    tempsun = systime(1)         ; pour key_performance 
     55   tempsun = systime(1)         ;  For key_performance 
    6156   a = '' 
    6257   if n_params() EQ 3 then BEGIN 
     
    9994     color = color#replicate(1, n_elements(tri)/3/n_elements(color)+1)  
    10095; 
    101    tempdeux = systime(1)         ; pour key_performance =2 
     96   tempdeux = systime(1)         ; For key_performance =2 
    10297   for i = 0L, n_elements(tri)/3-1 do begin 
    10398      t = [tri[*, i], tri[0, i]] 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/drawcoast_c.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param MASK 
     9; 
     10;  
     11; @param XF 
     12;  
     13; 
     14; @param YF 
     15;  
     16; 
     17; @param NX 
     18;  
     19; 
     20; @param NY 
     21;  
     22; 
     23; @keyword COAST_COLOR 
     24; The color of the coastline. 
     25; defaut value is 0 => black 
     26; 
     27; @keyword COAST_THICK 
     28; The thick of the trait to trace continents 
     29; By default, it is 1. 
     30; 
     31; @keyword XSEUIL 
     32; To eliminate segments of coasts which are to big (which link points which can  
     33; be close on the sphere but distant on the drawing). We delete all segments  
     34; whose the size surpass the size of the window following X/XSEUIL. By default,  
     35; XSEUIL=5. But it can be to big if we do a big zoom or a little one for some  
     36; projections... We specify it the keyword thanks to this keyword! 
     37; 
     38; @keyword YSEUIL 
     39; See XSEUIL 
     40;  
     41; @keyword _EXTRA 
     42; Used to pass our keywords 
     43 
     44; @returns 
     45;  
     46;  
     47; @uses 
     48;  
     49;  
     50; @restrictions 
     51;  
     52;  
     53; @examples 
     54;  
     55;  
     56; @history 
     57;  
     58;  
     59; @version  
     60;  
     61; @todo  
     62; Seb: remplir le header 
     63; 
     64;- 
     65;--------------------------------------------------------- 
    166PRO drawcoast_c, mask, xf, yf, nx, ny, COAST_COLOR = coast_color, COAST_THICK = coast_thick, YSEUIL = yseuil, XSEUIL = xseuil, _extra = ex 
    2 ;--------------------------------------------------------- 
    367; 
    468  compile_opt idl2, strictarrsubs 
     
    1074  ENDIF 
    1175;--------------------------------------------------------- 
    12    tempsun = systime(1)         ; pour key_performance 
     76   tempsun = systime(1)         ; For key_performance 
    1377;--------------------------------------------------------- 
    1478; 
    15 ; on trace les segments verticaux: 
     79; We trace vertical segments: 
    1680; 
    1781   if NOT keyword_set(yseuil) then yseuil = 5. < (min([nx, ny])-2) 
    1882   distanceseuil = (!p.position[3]-!p.position[1])/yseuil 
    19 ; liste: liste des points i pourlesquels on va tracer un segment entre 
    20 ; le point i,j-1 et i,j 
    21    tempdeux = systime(1)        ; pour key_performance =2 
     83; list: list of points i for which we will trace a segment between the point i,j-1 and i,j 
     84   tempdeux = systime(1)        ; For key_performance =2 
    2285   liste = where((mask+shift(mask, -1, 0)) EQ 1 $ 
    2386                 AND ((xf-shift(xf, 0, 1))^2+(yf-shift(yf, 0, 1))^2) LE distanceseuil^2) 
    2487   IF liste[0] NE -1 THEN BEGIN 
    25 ; on recupere lx et ly qui sont les indices ds un tableau 2d des 
    26 ; points donnes par liste 
     88; We recuperate lx an dly which are indexes in a 2d array of points given by list 
    2789      ly = liste/nx & lx = temporary(liste)-nx*ly 
    28       indice = where(ly NE 0)   ; on ne prend pas les points concernant 
     90      indice = where(ly NE 0)   ; We do not take points concerning 
    2991      if indice[0] NE -1 then begin 
    30 ; la premiere ligne car ds ce cas le pt j-1 n''est pas definit 
     92; the first line because in this case, the point j-1 is undefined. 
    3193         lx = lx[indice] & ly = ly[temporary(indice)] 
    32 ; boucle sur les points concernes et trace du segment 
    33 ; rq: on utilise plost au lieu de plot car plots est bcp plus rapide. 
     94; Loop on concerned points and drawing of the segment. 
     95; Comment: we use plots instead of plot because plots goes faster. 
    3496         IF testvar(var = key_performance) EQ 2 THEN $ 
    3597          print, 'temps tracecote: determiner liste des points concernes par un trait vertical', systime(1)-tempdeux 
    36          tempdeux = systime(1)  ; pour key_performance =2 
     98         tempdeux = systime(1)  ; For key_performance =2 
    3799         for pt = 0L, n_elements(lx)-1 do BEGIN  
    38100            i = lx[pt] & j = ly[pt] 
     
    45107   ENDIF 
    46108; 
    47 ; pour le trace des segments horizontaux, c''est la meme chose sauf 
    48 ; qu'il faut faire attention si on est periodique:  
     109; For the drawing of horizontal segments , it is the same thing but we have to be careful if it is periodic. 
    49110; 
    50 ; si on est periodique on duplique la premiere colonne et on la met a 
    51 ; la fin. (ceci est fait non pas pour le shift qui est par defaut 
    52 ; periodique mais pour le plots  
    53    tempdeux = systime(1)        ; pour key_performance =2 
     111; If it is periodic, we duplicate the first column and we put it at the end.  
     112; (This is made not for the shift which is periodic by default but for the plots) 
     113   tempdeux = systime(1)        ; For key_performance =2 
    54114   if keyword_set(key_periodic) AND nx EQ jpi then begin 
    55115      mask = [mask, mask[0, *]] 
     
    66126      indice = where(ly NE ny-1 AND lx NE 0) 
    67127      if indice[0] NE -1 then begin 
    68 ; on ne prend pas les points de la  
    69 ; premiere colonne et de la derniere ligne (car on l''a rajoute artificiellement!)) 
     128; We do not take points of the first column and of the last line (because we added artificially) 
    70129         lx = lx[indice] & ly = ly[temporary(indice)] 
    71130         IF testvar(var = key_performance) EQ 2 THEN $ 
    72131          print, 'temps tracecote: determiner liste des points concernes par un trait horizontal', systime(1)-tempdeux 
    73          tempdeux = systime(1)  ; pour key_performance =2 
     132         tempdeux = systime(1)  ; For key_performance =2 
    74133         for pt = 0L, n_elements(lx)-1 do BEGIN  
    75134            i = lx[pt] & j = ly[pt] 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/drawcoast_e.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param MASK 
     9; 
     10;  
     11; @param XF 
     12;  
     13; 
     14; @param YF 
     15;  
     16; 
     17; @param NX 
     18;  
     19; 
     20; @param NY 
     21;  
     22; 
     23; @keyword COAST_COLOR 
     24; The color of the coastline. 
     25; defaut value is 0 => black 
     26; 
     27; @keyword COAST_THICK 
     28; The thick of the trait to trace continents 
     29; By default, it is 1. 
     30; 
     31; @keyword XSEUIL 
     32; To eliminate segments of coasts which are to big (which link points which can  
     33; be close on the sphere but distant on the drawing). We delete all segments  
     34; whose the size surpass the size of the window following X/XSEUIL. By default,  
     35; XSEUIL=5. But it can be to big if we do a big zoom or a little one for some  
     36; projections... We specify it the keyword thanks to this keyword! 
     37; 
     38; @keyword YSEUIL 
     39; See XSEUIL 
     40; 
     41; @keyword _EXTRA 
     42; Used to pass our keywords 
     43 
     44; @returns 
     45;  
     46;  
     47; @uses 
     48;  
     49;  
     50; @restrictions 
     51;  
     52;  
     53; @examples 
     54;  
     55;  
     56; @history 
     57;  
     58;  
     59; @version  
     60; 
     61; @todo 
     62; Seb: remplir le header 
     63;  
     64;- 
     65 
    166PRO drawcoast_e, mask, xf, yf, nx, ny, COAST_COLOR = coast_color, COAST_THICK = coast_thick, YSEUIL = yseuil, XSEUIL = xseuil, onemore = onemore, _extra = ex 
    267;--------------------------------------------------------- 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/drawsectionbottom.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:drawsectionbottom 
    65; 
    7 ; PURPOSE:fill and draw the bottom continents for a real section. 
     6; @file_comments 
     7; Fill and draw the bottom continents for a real section. 
    88; 
    9 ; CATEGORY: 
     9; @categories 
     10;  
     11; @param MASKIN {in}{requierd} 
    1012; 
    11 ; CALLING SEQUENCE: 
    12 ;  
    13 ; INPUTS: 
     13; @param XXAXISIN {in}{requierd}  
    1414; 
    15 ; KEYWORD PARAMETERS: 
     15; @param DEPTHSIN {in}{requierd} 
    1616; 
    17 ;        COAST_COLOR: the color of the coastline. 
    18 ;                     defaut value is 0 => black 
     17; @keyword COAST_COLOR 
     18; The color of the coastline. 
     19; defaut value is 0 => black 
    1920; 
    20 ;        COAST_THICK: the thickness of the coastline. 
    21 ;                     defaut value is 1 
     21; @keyword COAST_THICK 
     22; The thickness of the coastline. 
     23; defaut value is 1 
    2224; 
    23 ;        CONT_COLOR: the color of the continent. defaut value is 
    24 ;        (!d.n_colors - 1) < 255 => white 
     25; @keyword CONT_COLOR 
     26; The color of the continent. defaut value is 
     27; (!d.n_colors - 1) < 255 => white 
    2528; 
    26 ; OUTPUTS: 
     29; @uses 
     30; common.pro 
    2731; 
    28 ; COMMON BLOCKS:common.pro 
    29 ; 
    30 ; SIDE EFFECTS: 
    31 ; 
    32 ; RESTRICTIONS:simple way to fill continents for a section (using the 
     32; @restrictions 
     33; Simple way to fill continents for a section (using the 
    3334; fact that continents are wider at the bottom than at the top).  
    3435; 
    35 ; EXAMPLE: 
     36; @history 
     37; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     38;                      June 14, 2002 
    3639; 
    37 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    38 ;                      June 14, 2002 
     40; @version 
     41; $Id$ 
     42; 
     43; @todo 
     44; Seb: definir params 
    3945;- 
    4046;------------------------------------------------------------ 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/fillcornermask.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: FILLCORNERMASK 
    65; 
    7 ; PURPOSE: pour colorier proprement les continents! (c''est une longue 
    8 ; histoire...) 
     6; @file_comments 
     7; To color cleanly continents 
    98; 
    10 ; CATEGORY: pour plt 
     9; @categories 
     10; graphic 
    1111; 
    12 ; CALLING SEQUENCE: completecointerre 
    13 ;  
    14 ; INPUTS: non 
     12; @keyword _EXTRA 
     13; Used to pass your keywords  
    1514; 
    16 ; KEYWORD PARAMETERS:  _EXTRA  
     15; @keyword CONT_COLOR 
     16; The color of the continent. defaut value is 
     17; (!d.n_colors - 1) < 255 => white 
    1718; 
    18 ;        CONT_COLOR: the color of the continent. defaut value is 
    19 ;        (!d.n_colors - 1) < 255 => white 
     19; @uses 
     20; common.pro 
    2021; 
    21 ; OUTPUTS: non 
     22; @history 
     23; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     24;                      8/8/2002 
    2225; 
    23 ; COMMON BLOCKS: common.pro 
     26; @version 
     27; $Id$ 
    2428; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ; RESTRICTIONS: 
    28 ; 
    29 ; EXAMPLE: 
    30 ; 
    31 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    32 ;                      8/8/2002 
    3329;- 
    3430;------------------------------------------------------------ 
     
    4541  if NOT keyword_set(coinmonte) AND NOT keyword_set(coindescend) then return 
    4642; 
    47   tempsun = systime(1)          ; pour key_performance 
     43  tempsun = systime(1)          ; For key_performance 
    4844; 
    4945  IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) <  255     
    5046;------------------------------------------------------------ 
    51 ; definition descoordonnees des points numerotes 1,2,3,4,5,6 cf. les 
    52 ; schemas en dessous! 
     47; definition of coordinates of points numbered 1,2,3,4,5,6 (see figures below) 
    5348;------------------------------------------------------------ 
    5449; 
     
    6459; 
    6560; 
    66 ; cas coin terre en montee: 
    67 ;      2 points terre en diagonale montante avec 2 points mer sur 
    68 ;      la diagonale descendante. 
     61; Case land corner in ascent: 
     62;      2 land points in diagonal ascending with 2 ocean points on the descendant diagonal. 
    6963; 
    7064;                     3     
     
    9690  endif 
    9791;------------------------------------------------------------ 
    98 ; cas coin terre en descendante.: 
    99 ;      2 points terre en diagonale descendante avec 2 points mer sur 
    100 ;      la diagonale montante 
     92; Case land corner in descent: 
     93;      2 land points in diagonal descending with 2 ocean points on the ascendant diagonal. 
    10194; 
    10295;                     4 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/section.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; NAME: 
    6 ; 
    7 ; PURPOSE: 
    8 ; 
    9 ; CATEGORY: 
    10 ; 
    11 ; CALLING SEQUENCE: 
    12 ;  
    13 ; INPUTS: 
    14 ; 
    15 ; KEYWORD PARAMETERS: 
    16 ; 
    17 ; OUTPUTS: 
    18 ; 
    19 ; COMMON BLOCKS:common.pro 
    20 ; 
    21 ; SIDE EFFECTS: 
    22 ; 
    23 ; RESTRICTIONS: 
    24 ; 
    25 ; EXAMPLE: 
    26 ; 
    27 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    28 ; 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param FIELD 
     9; 
     10;  
     11; @param RES 
     12; 
     13;  
     14; @param GLAMAXE 
     15; 
     16;  
     17; @param GPHIAXE 
     18; 
     19;  
     20; @keyword ENDPOINTS  
     21;  
     22;  
     23; @keyword BOXZOOM 
     24; 
     25;  
     26; @keyword TYPE  
     27; 
     28; 
     29; @keyword WDEPTH 
     30; 
     31; 
     32; @keyword DIREC 
     33; 
     34; 
     35; @keyword SHOWBUILD 
     36; 
     37; 
     38; @keyword ONLYBOX 
     39; 
     40; 
     41; @keyword _EXTRA  
     42; Used to pass your keywords 
     43;  
     44; @returns 
     45;  
     46;  
     47; @uses 
     48; common.pro 
     49;  
     50; @restrictions 
     51;  
     52;  
     53; @examples 
     54;  
     55;  
     56; @history 
     57; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     58;  
     59; @version  
     60;  
    2961;- 
    30 ;------------------------------------------------------------ 
    31 ;------------------------------------------------------------ 
    32 ;------------------------------------------------------------ 
    3362 
    3463PRO section, field, res, glamaxe, gphiaxe, ENDPOINTS = endpoints $ 
     
    5281;--------------------- 
    5382;--------------------- 
    54 ; definition de boxzoom en fonction de endpoints 
    55 ; puis redefinition du domaine 
     83; definition of boxzoom in function of endpoints, then redefinition of the domain 
    5684  boxzoom2d = [min([endpoints[0], endpoints[2]], max = ma02), ma02 $ 
    5785               , min([endpoints[1], endpoints[3]], max = ma13), ma13] 
     
    83111; how can we find a good test value? 
    84112  IF nx * ny LE 10 THEN domdef, GRIDTYPE = grillechoice, _extra = ex 
    85 ; on redefinit lon1, ... au cas ou findalways ait ete utilise ds domdef 
     113; We redefine lon1, ... in case findalways has been used in domdef 
    86114  lon1 = min([endpoints[0], endpoints[2]], max = lon2) 
    87115  lat1 = min([endpoints[1], endpoints[3]], max = lat2) 
     
    89117; until its bottom part. 
    90118  if strpos(type, 'z') NE -1 THEN BEGIN 
    91 ;on garde les yranges (axe z) avant de changer la boxzoom. 
     119; We keep yranges (axis z) before changing the boxzoom. 
    92120    !y.range = [localbox[nelbox-1], localbox[nelbox-2]]  
    93121    if vargrid EQ 'W' OR keyword_set(wdepth) then BEGIN 
     
    105133  ENDIF 
    106134  !y.range = [localbox[nelbox-1], localbox[nelbox-2]]  
    107 ; on recupere la grille sur la boxzoom 
     135; We recuperate the grid on the boxzoom. 
    108136; 
    109137  IF NOT keyword_set(onlybox) THEN saveboxparam, 'boxparam4section.dat' 
     
    126154 
    127155;--------------------- 
    128 ; on definit la triangulation qui va nous permetre de determiner la 
    129 ; section. on la recalcule car elle doit etre definie sur la terre 
    130 ; aussi bien que sur la mer. suivant le sens de la section -plutot 
    131 ; longitude ou plutot latitude- on definit la facon de trianguler 
     156; We define the triangulation which will allows us to determinate the section.  
     157; We recalculate it because it must be defined on the Earth and on oceans. 
     158; Following the direction of the section -rather longitude or rather latitude-  
     159; we define the way to triangulate. 
    132160  if strpos(type, 'x') NE -1 then BEGIN  
    133161    downward = (lindgen(nx, ny))[0:nx-2, 0:ny-2] 
     
    146174  ENDIF 
    147175;--------------------- 
    148 ; equation de la droite suivant laquelle on fait la section 
     176; Equation of the line on which we do the section. 
    149177;--------------------- 
    150178  abc = linearequation(endpoints[0:1], endpoints[2:3]) 
    151179  glamtri = glam[tri] 
    152180  gphitri = gphi[tri] 
    153 ; quels sont les points de la triangulation qui sont au dessus et au 
    154 ; dessous de la droite ? 
     181; Which points of the triangulation are above and below the line? 
    155182  if abc[1] NE 0 THEN $ 
    156183    test = temporary(gphitri) GE (-abc[0]/abc[1]*temporary(glamtri)-abc[2]/abc[1]) $ 
     
    158185 
    159186  zero123 = total(test, 1) 
    160 ; to keep: triangles de la triangulation qui sont a cheval sur la droite. 
     187; to keep: triangles of the triangulation which are over the line. 
    161188  tokeep1 = where(zero123 EQ 1) 
    162189  tokeep2 = where(temporary(zero123) EQ 2) 
     
    165192  test = test[*, tokeep] 
    166193  tri = tri[*, tokeep] 
    167 ; quel est le sommet du triangle qui est seul d''un cote de la droite? 
     194; Which summit of the triangle is alone in a side of the line? 
    168195  single1 = where(test[*, 0:n_elements(tokeep1)-1] EQ 1) 
    169196  single1 = single1-(single1/3)*3 
     
    177204 
    178205  single = [temporary(single1), temporary(single2)] 
    179 ; points1 le point du triangles qui est seul d''un cote de la droite. 
    180 ; point2 l''autre point du triangle de l''autre cote de la droite 
     206; points1 the point (of the triangle) alone in a side of the line. 
     207; point2 the other point of the triangle in the other side of the line. 
    181208  point1 = [single, single] 
    182209  point2 = [single EQ 0, 1 + (single LE 1)] 
     
    189216  points1 = tri[point1, index] 
    190217  points2 = tri[point2, temporary(index)] 
    191 ; points : complexe contenant les couples de points de part et 
    192 ; d''autre de la droite. Ils faut supprimer les doublons. 
     218; points : complex containing couples of points in a side and the other  
     219; side of the line. We have to delete duplicates. 
    193220  points = dcomplex(points1, points2) 
    194221  points = points[uniq(points, sort(points))] 
    195222  symetrique = dcomplex(imaginary(points), double(points)) 
    196223  points = points[where(points-shift(temporary(symetrique), 1) NE 0)] 
    197 ; points1 les coordnnees du point du triangles qui est seul d''un cote de la droite. 
    198 ; point2 les coordnnees de l''autre point du triangle de l''autre cote de la droite 
     224; points1 coordinates of the point of the triangle which is alone in a side of the line. 
     225; point2 coordinates of the other point of the triangle in the other side of the line. 
    199226  points1 = complex(glam[   double(points)], gphi[   double(points)]) 
    200227  points2 = complex(glam[imaginary(points)], gphi[imaginary(points)]) 
    201 ; droites les equations des droites dont on cherche l''intersection 
    202 ; avec la section. 
     228; droites equations of line whose we look for the intersection wit the section. 
    203229  droites = linearequation(points1, points2) 
    204230  inter = lineintersection(droites, abc#replicate(1, n_elements(points1) ) ) 
    205231 
    206 ; les ccordonnes geographiques des points que l''on cherche sur la section. 
     232; Geographic coordinates of points we look for on the section. 
    207233  glamaxe = float(inter) 
    208234  gphiaxe = imaginary(inter) 
    209 ; on les range ds l''ordre croissant entre les bornes de la section 
     235; We arrange them in the growing order between boundaries of the section. 
    210236  if strpos(type, 'x') NE -1 then BEGIN  
    211237    sort = sort(glamaxe) 
     
    272298      poids = poids#replicate(1, nz) 
    273299      res = poids*value1+(1-poids)*value2 
    274 ; moyenne suivant z ? 
     300; average following z ? 
    275301      if strpos(type, 'z') EQ -1 then begin 
    276302        nan = where(finite(res) EQ 0) 
     
    319345      poids = reform(poids, npoints, nz, jpt, /over) 
    320346      res = poids*value1+(1-poids)*value2 
    321 ; moyenne suivant z ? 
     347; average following z ? 
    322348      if strpos(type, 'z') EQ -1 then begin 
    323349        nan = where(finite(res) EQ 0) 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/tracecote.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:tracecote 
    65; 
    7 ; PURPOSE: dessine les cotes ds plt 
     6; @file_comments 
     7; Draw coasts in plt. 
    88; 
    9 ; CATEGORY: pour faire un joli dessin 
     9; @categories 
     10; graphic 
    1011; 
    11 ; CALLING SEQUENCE:tracecote,mask 
    1212;  
    1313; INPUTS:mask le tableau mask sur la zone consideree pour le dessin 
    1414; 
    15 ; KEYWORD PARAMETERS:  
     15; @keyword SURFACE_COASTLINE 
     16; To draw the surface coast line instead of 
     17; the coast line at level firstz[tw]. Usefull only for deep 
     18; plots! 
    1619; 
    17 ;        COAST_COLOR: the color of the coastline. 
    18 ;                     defaut value is 0 => black 
     20; @keyword _EXTRA 
     21; used to pass your keywords 
    1922; 
    20 ;        COAST_THICK: l''epaisseur du trait pour tracer les 
    21 ;        continents. par defaut c''est 1. 
     23; @uses 
     24; common.pro 
    2225; 
    23 ;        /SURFACE_COASTLINE: to draw the furface coast line instead of 
    24 ;        the coast line at level firstz[tw]. Usefull only for deep 
    25 ;        plots! 
     26; @history 
     27; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     28;                      30/9/1999 
    2629; 
    27 ;        XSEUIL: pour eliminer les segments de cote qui sont trop 
    28 ;        grand (qui relient des points qui peuvent etre tres proches 
    29 ;        sur la sphere mais tres eloignes sur le dessin) on supprime 
    30 ;        tous les egments dot la taille depasse: 
    31 ;              taille de la fenetre suivant X/ xseuil. 
    32 ;        Par defaut xseuil est egale a 5. masi peut etre trop grand si 
    33 ;        on fait un fort zoom ou trout petit pour certaines 
    34 ;        projections... le specifier alors a l''aide de ce mot cle! 
     30; @version 
     31; $Id$ 
    3532; 
    36 ;        YSEUIL: cf. xseuil 
    37 ; 
    38 ; OUTPUTS: rien 
    39 ; 
    40 ; COMMON BLOCKS:common.pro 
    41 ; 
    42 ; SIDE EFFECTS: 
    43 ; 
    44 ; RESTRICTIONS: 
    45 ; 
    46 ; EXAMPLE: 
    47 ; 
    48 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    49 ;                      30/9/1999 
    5033;- 
    5134;------------------------------------------------------------ 
     
    6447  ENDIF 
    6548;-------------------------------------------------------------- 
    66    tempsun = systime(1)         ; pour key_performance 
     49   tempsun = systime(1)         ; For key_performance 
    6750   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c' 
    6851; 
    69 ; on agrandi un peu le cadre definit par les premier..., dernier... de 
    70 ; facon a bien recuperer les bords de cote qui sont en bordure du 
    71 ; domaine a tracer 
     52; We enlarge a bit the frame defined by firsts..., lasts... in order to  
     53; recuperate edges of the coast which are in the edging of the domain. 
    7254;    
    73    tempdeux = systime(1)        ; pour key_performance =2 
     55   tempdeux = systime(1)        ; For key_performance =2 
    7456   firstx = 0 > (min([firstxt, firstxf])-1) 
    7557   lastx = (max([lastxt, lastxf])+1) < (jpi-1) 
     
    7860   nx = lastx-firstx+1 
    7961   ny = lasty-firsty+1 
    80 ; quel niveau vertical choisir ? 
     62; Which vertical level choose? 
    8163   IF keyword_set(surface_coastline) THEN firstz = 0 ELSE $ 
    8264     IF strupcase(vargrid) eq 'W' THEN firstz = firstzw ELSE firstz = firstzt 
    83 ; attribution du masque et des coordonnes delimitant les limites de la 
    84 ; terre (coordonnees f) 
     65; Attribution of the mask and of coordinates  delimiting limits of the land (coordinates f). 
    8566   mask = tmask[firstx:lastx, firsty:lasty, firstz] 
    8667   xf = glamf[firstx:lastx, firsty:lasty] 
     
    9071; 
    9172   if key_gridtype EQ 'e' then onemore = xf[0, 0] gT xf[0, 1] 
    92 ; on passe en coordonnee normaliser pour pouvoir s'affranchir du type 
    93 ; de projection choisie et du suport surlequel on fait le dessin 
    94 ; (ecran ou postscript) 
     73; We pass in normalized coordinates to be able to become independant from the projection's  
     74; type choosen and from the support on which we do the drawing (screen or postscript) 
    9575   z = convert_coord(xf[*],yf[*],/data,/to_normal)  
    9676   xf = reform(z[0, *], nx, ny) 
     
    9878   tempvar = SIZE(TEMPORARY(z)) 
    9979; 
    100 ; attention, suivant la projection certains points x ou y peuvent 
    101 ; devenir NaN (cf. points deriere la terre ds une projection 
    102 ; orthographique) 
     80; Beware, following the projection, some points x or y can become NaN (see point  
     81; behind the earth in an orthographic projection). 
    10382; 
    104 ; on met les points a eliminer a une tres gande valeur comme ca il ne 
    105 ; passerons pas le test avec distanceseuil (cf. plus bas) 
     83; We put points to be eliminated at a very big value so that they will not pass the  
     84; test with distanceseuil (see further). 
    10685; 
    10786   if (!map.projection LE 7 AND !map.projection NE 0) $ 
     
    11796   ind = where(yf LT !p.position[1] OR yf GT !p.position[3]) 
    11897   IF ind[0] NE -1 THEN yf[ind] = 1e5 
    119    tempvar = SIZE(TEMPORARY(ind)) ; on efface ind 
     98   tempvar = SIZE(TEMPORARY(ind)) ; we delete ind 
    12099; 
    121100   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c' 
  • 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] 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/triangule.pro

    r134 r150  
     1;------------------------------------ 
     2;+ 
     3; 
     4; @todo 
     5; seb 
     6; 
     7;- 
     8;------------------------------------ 
    19FUNCTION triangule, maskentree, BASIC = basic, COINMONTE = coinmonte, COINDESCEND = coindescend, _extra = ex 
    210; 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/triangule_c.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:triangule_c 
    6 ; 
    7 ; PURPOSE:construit le tableau de triangulation. 
    8 ; 
    9 ; L''idee est de 
    10 ; construire une liste de triangles qui relient les points entre 
    11 ; eux. Ceci est fait automatiquement avec la fonction TRIANGULATE. 
    12 ;  ICI: 
    13 ; on tient compte du fait que les points sont disposes sur une grille 
    14 ; (reguliere ou pas, mais pas destructuree, cad que les points sont 
    15 ; ecrits suivant une matrice rectangulaire). Un moyen tres simple de 
    16 ; faire des triangles entre tous les points est alors: 
    17 ; 
    18 ;     pour chaque point (i,j) de la matrice -sauf ceux de la derniere 
    19 ;     ligne et de la derniere colonne- on on appelle le rectangle 
    20 ;     (i,j) le rectangle forme par les 4 points (i,j), (i+1,j), 
    21 ;     (i,j+1), (i+1,j+1). Pour tracer tous les triangles, il suffit de 
    22 ;     tracer les 2 triangles contenus ds les rectangles (i,j) 
    23 ; 
    24 ; au passage on remarque que chaque rectangle (i,j) possede 2 diagonales (si 
    25 ; si faites un dessin c''est vrai), il y a donc 2 choix possibles pour 
    26 ; chaque rectangles qd on veut le couper en 2 triangles... 
     5; 
     6; @file_comments 
     7; Construct the triangulation array. 
     8; 
     9; The idea is: construct a list of triangle which link points between them.  
     10; This is automatically done by the function TRIANGULATE 
     11;  Here: 
     12; we consider the fact that points are disposed on a grid (regular or not,  
     13; but not unstructured, that is to say that points are written following a  
     14; rectangular matrix). A easy way to do triangles between all points is then:  
     15; 
     16;     for each point (i,j) of the matrix -exept those of the last line and of 
     17;     the last column- we call rectangle (i,j) the rectangle made of the four 
     18;     points (i,j), (i+1,j), (i,j+1), (i+1,j+1). To trace all triangle, we just 
     19;     have to trace the 2 triangles contained in rectangles (i,j) 
     20; 
     21; We notice that each rectangle (i,j) have 2 diagonals (it is true... Make a 
     22; drawing to make sure!!), so there are two possible choice for each rectangle 
     23; we want to cut in 2 triangles... 
    2724;  
    28 ; C''est grace a ce choix que l''on va pouvoir tracer les cotes avec 
    29 ; des angles droits. A chaque angle de cote remarquable par 
    30 ; l''existance d''un unique point terre ou d''un unique point mer sur 
    31 ; les 4 cotes d''un rectangle (i,j), il faut couper le rectangle 
    32 ; suivant la diagonale qui qui passe par le point singulier. 
     25; It is thanks to this choice that we will be able to trace coast with right 
     26; angles. At each angle of coast remarkable by the existence of an unique land 
     27; point or of an unique ocean point on one of the four summit of a rectangle (i,j), 
     28; we have to cut the rectangle following the diagonal passing by this point. 
    3329;  
    34 ; CATEGORY:pour faire de beaux graphiques masques 
    35 ; 
    36 ; CALLING SEQUENCE:res=triangule([mask]) 
    37 ; 
    38 ; INPUTS:optionnel:mask c''est le tableau 2d qui sevira a masquer le 
    39 ; champ que l''on tracera apres avec CONTOUR, 
     30; @categories 
     31; graphic 
     32; 
     33; @param MASKENTREE {in}{optional} 
     34; It is a 2d array which will serve to mask the field we will trace after with CONTOUR,  
    4035; ...TRIANGULATION=triangule(mask) 
    41 ; si cet argument n''est pas specifie, la function utilise tmask. 
    42 ; 
    43 ; KEYWORD PARAMETERS: 
    44 ; 
    45 ;       /BASIC: specifie que le masque est sur une grille basice 
    46 ;       (utiliser pour la triangulation ds les coupes verticales et 
    47 ;       des hovmoellers) 
    48 ; 
    49 ;       /KEEP_CONT: to keep the triangulation even on the continents 
    50 ; 
    51 ;       COINMONTE=tableau, pour obtenir le tableau de "coins de terre 
    52 ;       montant" a traiter avec completecointerre.pro ds la variable 
    53 ;       tableau plutot que de la faire passer par la variable globale 
    54 ;       twin_corners_up. 
    55 ; 
    56 ;       COINDESCEND=tableau cf COINMONTE 
    57 ; 
    58 ; OUTPUTS: 
    59 ;       res: tableau 2d (3,nbre de triangles). 
    60 ;    chaque ligne de res represente les indices des points 
    61 ;    constituants les sommets d''un triangle. 
    62 ;    cf. comment on trace les triangles ds dessinetri.pro 
    63 ; 
    64 ; COMMON BLOCKS: 
    65 ;       common.pro different.pro definetri.pro 
    66 ; 
    67 ; SIDE EFFECTS: 
    68 ; 
    69 ; RESTRICTIONS:les donnees dont un veut ensuite faire le contour 
    70 ; doivent etre disposees dans une matrice. Par contre dans la matrice, 
    71 ; la disposition des points peut ne pas etre irreguliere. Si les 
    72 ; donnees sont disposees completement de facon irreguliere, utiliser 
    73 ; TRIANGULE. 
    74 ; 
    75 ; EXAMPLE: 
    76 ; 
    77 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     36; If this argument is not specified, the function use tmask 
     37; 
     38; @keyword BASIC 
     39; Specify that the mask is on a basic grid (use the triangulation for vertical cuts and hovmoellers) 
     40; 
     41; @keyword KEEP_CONT 
     42; To keep the triangulation even on the continents 
     43; 
     44; @keyword COINMONTE 
     45; It is an array. To obtain the array of "ascending land corner" to be treated with  
     46; completecointerre.pro in the variable array instead of make it pass by the global  
     47; variable twin_corners_up. 
     48; 
     49; @keyword COINDESCEND 
     50; It is an array. See COINMONTE 
     51; 
     52; @returns 
     53; res: tableau 2d (3,nbre de triangles). 
     54; Each line of res represent indexes of points constituing summits of a triangle.  
     55; See how we trace triangles in definetri.pro 
     56; 
     57; @uses 
     58; common.pro 
     59; different.pro 
     60; definetri.pro 
     61; 
     62; @restrictions 
     63; Datas whose we want to do the contour must be disposed in a matrix.  
     64; On the other hand, in the matrix, the points's arrangement can not be  
     65; irregular. If it is, use TRIANGULE. 
     66; 
     67; @history 
     68; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    7869;                       26/4/1999 
     70; 
     71; @version 
     72; $Id$ 
     73; 
     74; @todo 
     75; seb L.267->268 je ne pense pas que ce soit ce que tu voulais dire mais  
     76; c'est la traduction de ce qu'il y avait écrit. Correction si besoin. 
    7977;- 
    8078;------------------------------------------------------------ 
     
    8381FUNCTION triangule_c, maskentree, COINMONTE = coinmonte, COINDESCEND = coindescend, BASIC = basic, KEEP_CONT = keep_cont 
    8482; 
    85   compile_opt idl2, strictarrsubs 
    86 ; 
    87    tempsun = systime(1)         ; pour key_performance 
     83compile_opt idl2, strictarrsubs 
     84; 
     85tempsun = systime(1)            ; For key_performance 
    8886;--------------------------------------------------------- 
    8987@cm_4mesh 
    90   IF NOT keyword_set(key_forgetold) THEN BEGIN 
     88IF NOT keyword_set(key_forgetold) THEN BEGIN 
    9189@updatenew 
    92   ENDIF 
    93 ;------------------------------------------------------------ 
    94 ; le masque est donne ou il faut prendre tmask? 
    95 ;------------------------------------------------------------ 
    96 ; 
    97    msk = maskentree 
    98    taille = size(msk) 
    99    nx = taille[1] 
    100    ny = taille[2] 
    101 ; 
    102    IF n_elements(keep_cont) EQ 0 THEN keep_cont = 1-key_irregular 
    103 ;------------------------------------------------------------ 
    104    if keyword_set(key_periodic)*(nx EQ jpi) $ 
    105     AND NOT keyword_set(basic) then BEGIN  
    106       msk = [msk, msk[0, *]] 
    107       nx = nx+1 
    108    ENDIF 
    109 ;------------------------------------------------------------ 
    110 ; on va trouver la liste des rectangles (i,j) (reperes par leur coin 
    111 ; en bas a gauche) qu''il faut couper suivant une diagonale descendante 
    112 ; on appellera cette liste : pts_downward 
     90ENDIF 
     91;------------------------------------------------------------ 
     92; Is the mask given or do we have to take tmask? 
     93;------------------------------------------------------------ 
     94; 
     95msk = maskentree 
     96taille = size(msk) 
     97nx = taille[1] 
     98ny = taille[2] 
     99; 
     100IF n_elements(keep_cont) EQ 0 THEN keep_cont = 1-key_irregular 
     101;------------------------------------------------------------ 
     102if keyword_set(key_periodic)*(nx EQ jpi) $ 
     103  AND NOT keyword_set(basic) then BEGIN  
     104    msk = [msk, msk[0, *]] 
     105    nx = nx+1 
     106ENDIF 
     107;------------------------------------------------------------ 
     108; We will find the list of rectangles (i,j)(located by their left  
     109; bottom corner) we have to cut folowing a descendant diagonal.  
     110; We will call this list : pts_downward 
    113111;  
    114    pts_downward = 0 
    115  
    116 ; on construit le test qui permet de trouver un tel triangle: 
     112pts_downward = 0 
     113 
     114; We construct the test which allow to find this triangle : 
    117115; 
    118116; 
     
    124122;             msk---------------------shift(msk, -1,  0) 
    125123; 
    126    sum1 = msk+shift(msk, -1, 0)+shift(msk, -1, -1) ;pts qui entourrent le pt en haut a gauche 
    127    sum2 = msk+shift(msk, 0, -1)+shift(msk, -1, -1) ;pts qui entourrent le pt en bas a droite 
    128  
    129  
    130    tempdeux = systime(1)        ; pour key_performance =2 
    131 ; pt terre en haut a gauche entoure de pts mer 
    132    liste = where( (4-sum1)*(1-shift(msk, 0, -1)) EQ 1 ) 
    133    if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
    134 ; pt mer en haut a gauche entoure de pts terre 
    135    liste = where( (1-sum1)*shift(msk, 0, -1) EQ 1) 
    136    if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
    137 ; pt terre en bas a droite entoure de pts mer 
    138    liste = where( (4-sum2)*(1-shift(msk, -1,  0)) EQ 1) 
    139    if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
    140 ; pt mer en bas a droite entoure de pts terre 
    141    liste = where( (1-sum2)*shift(msk, -1,  0) EQ 1) 
    142    if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
    143    undefine, liste 
    144 ; 
    145    IF testvar(var = key_performance) EQ 2 THEN $ 
    146     print, 'temps triangule: trouver pts_downward', systime(1)-tempdeux 
    147 ; 
    148    if (NOT keyword_set(basic)) OR keyword_set(coinmonte) OR keyword_set(coindescend) then begin 
    149       tempdeux = systime(1)     ; pour key_performance =2 
    150 ;2 points terre en diagonale montante avec 2 points mer sur la diagonale descendante 
    151       coinmont = where( (1-msk)*(1-shift(msk, -1, -1)) $ 
    152                         *(shift(msk, 0, -1)*shift(msk, -1,  0) EQ 1) ) 
    153       if coinmont[0] NE -1 THEN pts_downward = [pts_downward, coinmont] 
    154 ; 
    155       IF testvar(var = key_performance) EQ 2 THEN $ 
    156        print, 'temps triangule: trouver coinmont', systime(1)-tempdeux 
    157       tempdeux = systime(1)     ; pour key_performance =2 
    158 ; 
    159 ;2 points terre en diagonale descendante avec 2 points mer sur la diagonale montante 
    160       coindesc = where( ((1-shift(msk,  0, -1))*(1-shift(msk, -1, 0)) $ 
    161                          *msk*shift(msk, -1, -1) EQ 1) ) 
    162 ; 
    163       IF testvar(var = key_performance) EQ 2 THEN $ 
    164        print, 'temps triangule: trouver coindesc', systime(1)-tempdeux 
    165 ; 
    166     ENDIF 
    167 ; 
    168    if n_elements(pts_downward) EQ 1 then BEGIN  
    169       tempdeux = systime(1)     ; pour key_performance =2 
    170 ; 
    171       triang = definetri(nx, ny) 
    172 ; 
    173       IF testvar(var = key_performance) EQ 2 THEN $ 
    174        print, 'temps triangule: definetri', systime(1)-tempdeux 
    175       coinmont = -1 
    176       coindesc = -1 
    177    ENDIF ELSE BEGIN  
    178       tempdeux = systime(1)     ; pour key_performance =2 
    179       pts_downward = pts_downward[1:n_elements(pts_downward)-1] 
    180       pts_downward = pts_downward[uniq(pts_downward, sort(pts_downward))] 
    181 ; aucun rectangle ne peut avoir comme coin en bas a gauche un element 
    182 ; de la derniere colonne ou de la derniere ligne. 
    183 ; il faut donc enlever ces points si ils ont ete selectionnes dans 
    184 ; pts_downward. 
    185       derniere_colonne = (lindgen(ny)+1)*nx-1  
    186       derniere_ligne = lindgen(nx)+(ny-1)*nx  
    187       pts_downward =different(pts_downward,derniere_colonne ) 
    188       pts_downward =different(pts_downward,derniere_ligne ) 
    189       if (NOT keyword_set(basic)) OR keyword_set(coinmonte) OR keyword_set(coindescend) then begin 
    190          if coinmont[0] NE -1 then begin 
     124sum1 = msk+shift(msk, -1, 0)+shift(msk, -1, -1)    ;points which surround the left top point. 
     125sum2 = msk+shift(msk, 0, -1)+shift(msk, -1, -1)    ;points which surround the right bottom point. 
     126 
     127 
     128tempdeux = systime(1)           ; For key_performance =2 
     129; The left top land point surrounded by ocean points 
     130liste = where( (4-sum1)*(1-shift(msk, 0, -1)) EQ 1 ) 
     131if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
     132; The left top ocean point surrounded by land points 
     133liste = where( (1-sum1)*shift(msk, 0, -1) EQ 1) 
     134if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
     135; The right bottom land point surrounded by ocean points 
     136liste = where( (4-sum2)*(1-shift(msk, -1,  0)) EQ 1) 
     137if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
     138; The right bottom ocean point surrounded by land points 
     139liste = where( (1-sum2)*shift(msk, -1,  0) EQ 1) 
     140if liste[0] NE -1 THEN pts_downward = [pts_downward,liste ] 
     141undefine, liste 
     142; 
     143IF testvar(var = key_performance) EQ 2 THEN $ 
     144  print, 'temps triangule: trouver pts_downward', systime(1)-tempdeux 
     145; 
     146if (NOT keyword_set(basic)) OR keyword_set(coinmonte) OR keyword_set(coindescend) then begin 
     147    tempdeux = systime(1)       ; For key_performance =2 
     148;2 land points in ascendant diagonal with 2 ocean points in descendant diagonal. 
     149    coinmont = where( (1-msk)*(1-shift(msk, -1, -1)) $ 
     150                      *(shift(msk, 0, -1)*shift(msk, -1,  0) EQ 1) ) 
     151    if coinmont[0] NE -1 THEN pts_downward = [pts_downward, coinmont] 
     152; 
     153    IF testvar(var = key_performance) EQ 2 THEN $ 
     154      print, 'temps triangule: trouver coinmont', systime(1)-tempdeux 
     155    tempdeux = systime(1)       ; pour key_performance =2 
     156; 
     157    coindesc = where( ((1-shift(msk,  0, -1))*(1-shift(msk, -1, 0)) $ 
     158                       *msk*shift(msk, -1, -1) EQ 1) ) 
     159; 
     160;2 land points in descendant diagonal with 2 ocean points in ascendant diagonal. 
     161    IF testvar(var = key_performance) EQ 2 THEN $ 
     162      print, 'temps triangule: trouver coindesc', systime(1)-tempdeux 
     163; 
     164ENDIF 
     165; 
     166if n_elements(pts_downward) EQ 1 then BEGIN  
     167    tempdeux = systime(1)       ; For key_performance =2 
     168; 
     169    triang = definetri(nx, ny) 
     170; 
     171    IF testvar(var = key_performance) EQ 2 THEN $ 
     172      print, 'temps triangule: definetri', systime(1)-tempdeux 
     173    coinmont = -1 
     174    coindesc = -1 
     175ENDIF ELSE BEGIN  
     176    tempdeux = systime(1)       ; For key_performance =2 
     177    pts_downward = pts_downward[1:n_elements(pts_downward)-1] 
     178    pts_downward = pts_downward[uniq(pts_downward, sort(pts_downward))] 
     179; None rectangle can have an element of the last column or of the  
     180; last line as left bottom corner. 
     181; so we have to remove these points if they has been selected in pts_downward. 
     182    derniere_colonne = (lindgen(ny)+1)*nx-1  
     183    derniere_ligne = lindgen(nx)+(ny-1)*nx  
     184    pts_downward =different(pts_downward,derniere_colonne ) 
     185    pts_downward =different(pts_downward,derniere_ligne ) 
     186    if (NOT keyword_set(basic)) OR keyword_set(coinmonte) OR keyword_set(coindescend) then begin 
     187        if coinmont[0] NE -1 then begin 
    191188            coinmont =different(coinmont,derniere_colonne ) 
    192189            coinmont =different(coinmont,derniere_ligne ) 
    193          endif 
    194          if coindesc[0] NE -1 then begin 
     190        endif 
     191        if coindesc[0] NE -1 then begin 
    195192            coindesc =different(coindesc,derniere_colonne ) 
    196193            coindesc =different(coindesc,derniere_ligne ) 
    197          endif 
    198       ENDIF ELSE BEGIN  
    199          coinmont = -1 
    200          coindesc = -1 
    201       ENDELSE  
    202       IF testvar(var = key_performance) EQ 2 THEN $ 
    203        print, 'temps triangule: menage ds pts_downward coinmont et coindesc', systime(1)-tempdeux 
    204 ; 
    205       tempdeux = systime(1)     ; pour key_performance =2 
    206       if  pts_downward[0] EQ -1 then triang = definetri(nx, ny) $ 
    207       ELSE triang = definetri(nx, ny, pts_downward) 
    208       IF testvar(var = key_performance) EQ 2 THEN $ 
    209        print, 'temps triangule: definetri', systime(1)-tempdeux 
    210    ENDELSE  
    211 ;------------------------------------------------------------ 
    212 ; on vire les triangles qui ne contiennent que des points terre 
    213 ;------------------------------------------------------------ 
    214 ; 
    215 ;  tres bonne idee qui ne marche pas encore a 200% avec IDL 5.2 
    216 ;  ca devrait aller mieux dans les prochaines versions d''IDL... 
    217 ; 
    218    if (NOT keyword_set(basic)) AND (NOT keyword_set(keep_cont)) then begin 
    219       tempdeux = systime(1)     ; pour key_performance =2 
    220 ; on enleve les rectangles qui sont entierement dans la terre 
    221       recdsterre = where((1-msk)*(1-shift(msk, -1, 0))*(1-shift(msk, 0, -1))*(1-shift(msk, -1, -1)) EQ 1) 
    222       IF testvar(var = key_performance) EQ 2 THEN $ 
    223        print, 'temps triangule: tous les recdsterre', systime(1)-tempdeux 
    224  
    225 ; en attendant une version qui marche parfaitement, on est contraint 
    226 ; de faire un nouveau tri: 
    227 ; il ne faut pas enlever les rectangles qui n''ont qu''un sommet en 
    228 ; commun. 
     194        endif 
     195    ENDIF ELSE BEGIN  
     196        coinmont = -1 
     197        coindesc = -1 
     198    ENDELSE  
     199    IF testvar(var = key_performance) EQ 2 THEN $ 
     200      print, 'temps triangule: menage ds pts_downward coinmont et coindesc', systime(1)-tempdeux 
     201; 
     202    tempdeux = systime(1)       ; For key_performance =2 
     203    if  pts_downward[0] EQ -1 then triang = definetri(nx, ny) $ 
     204    ELSE triang = definetri(nx, ny, pts_downward) 
     205    IF testvar(var = key_performance) EQ 2 THEN $ 
     206      print, 'temps triangule: definetri', systime(1)-tempdeux 
     207ENDELSE  
     208;------------------------------------------------------------ 
     209; We delete land points which only contain land points. 
     210;------------------------------------------------------------ 
     211; 
     212 
     213if (NOT keyword_set(basic)) AND (NOT keyword_set(keep_cont)) then begin 
     214    tempdeux = systime(1)       ; For key_performance =2 
     215; We delete rectangles which are entirely in the land. 
     216    recdsterre = where((1-msk)*(1-shift(msk, -1, 0))*(1-shift(msk, 0, -1))*(1-shift(msk, -1, -1)) EQ 1) 
     217    IF testvar(var = key_performance) EQ 2 THEN $ 
     218      print, 'temps triangule: tous les recdsterre', systime(1)-tempdeux 
     219 
     220; We do an other sort : 
     221; We have to do not remove rectangles which only have one common summit. 
    229222; t1 = systime(1) 
    230       indice = intarr(nx, ny) 
    231       trimask = intarr(nx, ny) 
    232       trimask[0:nx-2, 0:ny-2] = 1 
    233       IF recdsterre[0] NE -1 then BEGIN  
    234          tempdeux = systime(1)  ; pour key_performance =2 
    235          indice[recdsterre] = 1 
    236 ;      if NOT keyword_set(basic) then begin 
    237          vire1 = 0 
    238          vire2 = 0 
    239          while (vire1[0] NE -1 OR vire2[0] NE -1) ne 0 do begin 
    240 ; vire sont les rectangles qu''il faut retirer de recsterre (en fait 
    241 ; qu''il faut garder bien qu''ils soient entirement dans la terre)   
    242             vire1 = where( (indice*shift(indice, -1, -1) $ 
    243                             *(1-shift(indice, 0, -1))*(1-shift(indice, -1, 0))*trimask) EQ 1) 
    244             if vire1[0] NE -1 THEN BEGIN  
    245                indice[vire1] = 0 
     223    indice = intarr(nx, ny) 
     224    trimask = intarr(nx, ny) 
     225    trimask[0:nx-2, 0:ny-2] = 1 
     226    IF recdsterre[0] NE -1 then BEGIN  
     227        tempdeux = systime(1)   ; For key_performance =2 
     228        indice[recdsterre] = 1 
     229        if NOT keyword_set(basic) then begin 
     230            vire1 = 0 
     231            vire2 = 0 
     232            while (vire1[0] NE -1 OR vire2[0] NE -1) ne 0 do begin 
     233; Delete rectangles we have to remove from recsterre (in fact those we have  
     234; to keep although they ar eentirely in the land). 
     235                vire1 = where( (indice*shift(indice, -1, -1) $ 
     236                                *(1-shift(indice, 0, -1))*(1-shift(indice, -1, 0))*trimask) EQ 1) 
     237                if vire1[0] NE -1 THEN BEGIN  
     238                    indice[vire1] = 0 
    246239;               indice[vire1+nx+1] = 0 
    247             endif 
    248              
    249             vire2 = where( ((1-indice)*(1-shift(indice, -1, -1)) $ 
    250                             *shift(indice, 0, -1)*shift(indice, -1, 0)*trimask) EQ 1) 
    251             if vire2[0] NE -1 THEN BEGIN  
    252                indice[vire2+1] = 0 
     240                endif 
     241                 
     242                vire2 = where( ((1-indice)*(1-shift(indice, -1, -1)) $ 
     243                                *shift(indice, 0, -1)*shift(indice, -1, 0)*trimask) EQ 1) 
     244                if vire2[0] NE -1 THEN BEGIN  
     245                    indice[vire2+1] = 0 
    253246;               indice[vire2+nx] = 0 
    254             endif 
    255          endwhile 
    256          IF testvar(var = key_performance) EQ 2 THEN $ 
    257           print, 'temps triangule: trier les recdsterre', systime(1)-tempdeux 
    258 ;      endif 
    259          indice[*, ny-1] = 1    ; la deriere colonne te la derniere ligne 
    260          indice[nx-1, *] = 1    ; ne peuvent definir de rectangle. 
    261 ; 
    262          tempdeux = systime(1)  ; pour key_performance =2 
    263          recgarde = where(indice EQ 0) 
    264 ; on recupere les numeros des triangles que l'' on va garder 
    265          trigarde = 2*[recgarde-recgarde/nx] 
    266          trigarde = transpose(temporary(trigarde)) 
    267          trigarde = [trigarde, trigarde+1] 
     247                endif 
     248            endwhile 
     249            IF testvar(var = key_performance) EQ 2 THEN $ 
     250              print, 'temps triangule: trier les recdsterre', systime(1)-tempdeux 
     251        endif 
     252        indice[*, ny-1] = 1     ; The last column and the last line 
     253        indice[nx-1, *] = 1     ; can not define any rectangle. 
     254; 
     255        tempdeux = systime(1)   ; For key_performance =2 
     256        recgarde = where(indice EQ 0) 
     257; We recuperate numbers of triangles we will keep. 
     258        trigarde = 2*[recgarde-recgarde/nx] 
     259        trigarde = transpose(temporary(trigarde)) 
     260        trigarde = [trigarde, trigarde+1] 
    268261;  
    269          triang = triang[*, temporary(trigarde[*])] 
    270          IF testvar(var = key_performance) EQ 2 THEN $ 
     262        triang = triang[*, temporary(trigarde[*])] 
     263        IF testvar(var = key_performance) EQ 2 THEN $ 
    271264          print, 'temps triangule: virer les triangle de la liste', systime(1)-tempdeux 
    272       endif 
    273    endif 
     265    endif 
     266endif 
    274267; print, 'temps tri triangles', systime(1)-t1  
    275268;------------------------------------------------------------ 
    276 ; quand key_periodic eq 1, triang est une liste d''indice d'un 
    277 ; tableau qui a une colonne de trop. 
    278 ; il faut ramener ca a la matrice initiale en mettant les indivces de 
    279 ; la derniere colonne egaux a ceux de la derniere colonne... 
    280 ;------------------------------------------------------------ 
    281    tempdeux = systime(1)        ; pour key_performance =2 
    282    if keyword_set(key_periodic)*(nx-1 EQ jpi) $ 
    283     AND NOT keyword_set(basic) then BEGIN  
    284       indicey = triang/nx 
    285       indicex = triang-indicey*nx 
    286       nx = nx-1 
    287       liste = where(indicex EQ nx) 
    288       if liste[0] NE -1 then indicex[liste] = 0 
    289       triang = indicex+nx*indicey 
    290       nx = nx+1 
    291       if coinmont[0] NE -1 then begin 
    292          indicey = coinmont/nx 
    293          indicex = coinmont-indicey*nx 
    294          nx = nx-1 
    295          liste = where(indicex EQ nx) 
    296          if liste[0] NE -1 THEN indicex[liste] = 0 
    297          coinmont = indicex+nx*indicey 
    298          nx = nx+1 
    299       endif 
    300       if coindesc[0] NE -1 then begin 
    301          indicey = coindesc/nx 
    302          indicex = coindesc-indicey*nx 
    303          nx = nx-1 
    304          liste = where(indicex EQ nx) 
    305          if liste[0] NE -1 THEN indicex[liste] = 0 
    306          coindesc = indicex+nx*indicey 
    307          nx = nx+1 
    308       endif 
    309    endif 
    310    IF testvar(var = key_performance) EQ 2 THEN $ 
    311     print, 'temps triangule: finitions', systime(1)-tempdeux 
    312  
    313 ;------------------------------------------------------------ 
    314    if keyword_set(coinmonte) THEN coinmonte = coinmont ELSE twin_corners_up = coinmont 
    315    if keyword_set(coindescend) THEN coindescend = coindesc ELSE twin_corners_dn = coindesc 
    316 ;------------------------------------------------------------ 
    317   IF NOT keyword_set(key_forgetold) THEN BEGIN 
     269; When key_periodic equal 1, triang is a list of indexes's array which  
     270; have a surplus column. 
     271; We have to put it back to the initial matrix by putting indexes of  
     272; the last column equal to these of the last column... 
     273;------------------------------------------------------------ 
     274tempdeux = systime(1)           ; For key_performance =2 
     275if keyword_set(key_periodic)*(nx-1 EQ jpi) $ 
     276  AND NOT keyword_set(basic) then BEGIN  
     277    indicey = triang/nx 
     278    indicex = triang-indicey*nx 
     279    nx = nx-1 
     280    liste = where(indicex EQ nx) 
     281    if liste[0] NE -1 then indicex[liste] = 0 
     282    triang = indicex+nx*indicey 
     283    nx = nx+1 
     284    if coinmont[0] NE -1 then begin 
     285        indicey = coinmont/nx 
     286        indicex = coinmont-indicey*nx 
     287        nx = nx-1 
     288        liste = where(indicex EQ nx) 
     289        if liste[0] NE -1 THEN indicex[liste] = 0 
     290        coinmont = indicex+nx*indicey 
     291        nx = nx+1 
     292    endif 
     293    if coindesc[0] NE -1 then begin 
     294        indicey = coindesc/nx 
     295        indicex = coindesc-indicey*nx 
     296        nx = nx-1 
     297        liste = where(indicex EQ nx) 
     298        if liste[0] NE -1 THEN indicex[liste] = 0 
     299        coindesc = indicex+nx*indicey 
     300        nx = nx+1 
     301    endif 
     302endif 
     303IF testvar(var = key_performance) EQ 2 THEN $ 
     304  print, 'temps triangule: finitions', systime(1)-tempdeux 
     305 
     306;------------------------------------------------------------ 
     307if keyword_set(coinmonte) THEN coinmonte = coinmont ELSE twin_corners_up = coinmont 
     308if keyword_set(coindescend) THEN coindescend = coindesc ELSE twin_corners_dn = coindesc 
     309;------------------------------------------------------------ 
     310IF NOT keyword_set(key_forgetold) THEN BEGIN 
    318311   @updateold 
    319  ENDIF  
    320  
    321    IF keyword_set(key_performance) THEN print, 'temps triangule', systime(1)-tempsun  
    322  
    323    return, triang 
     312ENDIF  
     313 
     314IF keyword_set(key_performance) THEN print, 'temps triangule', systime(1)-tempsun  
     315 
     316return, triang 
    324317 
    325318END  
  • trunk/SRC/ToBeReviewed/TRIANGULATION/triangule_e.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:triangule_e 
    6 ; 
    7 ; PURPOSE:buid the triangulation for a E-grid type 
    8 ; 
    9 ; CATEGORY: 
    10 ; 
    11 ; CALLING SEQUENCE: 
    12 ;  
    13 ; INPUTS: 
    14 ; 
    15 ; KEYWORD PARAMETERS: 
    16 ; 
    17 ; OUTPUTS: 
    18 ; 
    19 ; COMMON BLOCKS:common.pro 
    20 ; 
    21 ; SIDE EFFECTS: 
    22 ; 
    23 ; RESTRICTIONS: 
    24 ; 
    25 ; EXAMPLE: 
    26 ; 
    27 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     5; @file_comments 
     6; Buid the triangulation for a E-grid type 
     7; 
     8; @categories 
     9; graphic 
     10;  
     11; @param MASKENTREE {in}{optional} 
     12; It is a 2d array which will serve to mask the field we will trace after with CONTOUR,  
     13; ...TRIANGULATION=triangule(mask) 
     14; If this argument is not specified, the function use tmask 
     15;  
     16; @keyword BASIC 
     17; Specify that the mask is on a basic grid (use the triangulation for vertical cuts and hovmoellers) 
     18;  
     19; @keyword COINMONTE 
     20; It is an array. To obtain the array of "ascending land corner" to be treated with  
     21; completecointerre.pro in the variable array instead of make it pass by the global  
     22; variable twin_corners_up. 
     23; 
     24; @keyword COINDESCEND 
     25; It is an array. See COINMONTE 
     26; 
     27; @keyword SHIFTED 
     28;  
     29; @uses 
     30; common.pro 
     31;  
     32; @history 
     33; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    2834;                      june 2001 
     35;  
     36; @version  
     37; $Id$ 
     38;  
     39; @todo 
     40; seb L.152->153 je ne pense pas que ce soit ce que tu voulais dire mais  
     41; c'est la traduction de ce qu'il y avait écrit. Correction si besoin. 
    2942;- 
    3043;------------------------------------------------------------ 
     
    4255  ENDIF 
    4356;--------------------------------------------------------- 
    44    tempsun = systime(1)         ; pour key_performance 
    45 ;------------------------------------------------------------ 
    46 ; le masque est donne ou il faut prendre tmask? 
     57   tempsun = systime(1)         ; For key_performance 
     58;------------------------------------------------------------ 
     59; Is the mask given or do we have to take tmask? 
    4760;------------------------------------------------------------ 
    4861; 
     
    138151; ; 
    139152;------------------------------------------------------------ 
    140 ; quand key_periodic eq 1, triang est une liste d''indice d'un 
    141 ; tableau qui a une colonne de trop. 
    142 ; il faut ramener ca a la matrice initiale en mettant les indivces de 
    143 ; la derniere colonne egaux a ceux de la derniere colonne... 
    144 ;------------------------------------------------------------ 
    145    tempdeux = systime(1)        ; pour key_performance =2 
     153; When key_periodic equal 1, triang is a list of indexes's array which  
     154; have a surplus column. 
     155; We have to put it back to the initial matrix by putting indexes of  
     156; the last column equal to these of the last column... 
     157;------------------------------------------------------------ 
     158   tempdeux = systime(1)        ; For key_performance =2 
    146159   if keyword_set(key_periodic)*(nx-1 EQ jpi) $ 
    147160    AND NOT keyword_set(basic) then BEGIN  
     
    176189 
    177190;------------------------------------------------------------ 
    178 ;    if arg_present(coinmonte) THEN coinmonte = coinmont ELSE twin_corners_up = coinmont 
    179 ;    if arg_present(coindescend) THEN coindescend = coindesc ELSE twin_corners_dn = coindesc 
    180 ; 
    181 ;   IF NOT keyword_set(key_forgetold) THEN BEGIN 
    182 ;    @updateold 
    183 ;   ENDIF 
     191    if arg_present(coinmonte) THEN coinmonte = coinmont ELSE twin_corners_up = coinmont 
     192    if arg_present(coindescend) THEN coindescend = coindesc ELSE twin_corners_dn = coindesc 
     193 
     194   IF NOT keyword_set(key_forgetold) THEN BEGIN 
     195    @updateold 
     196   ENDIF 
    184197;------------------------------------------------------------ 
    185198 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/get_extra.pro

    r134 r150  
    11;+ 
    2 ; @todo seb 
     2; @todo  
     3; seb 
    34;- 
    45; 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/oups.pro

    r134 r150  
    77;         mistake, I execute this program and i can redo the only plot missed. 
    88; 
    9 ; @categories utilities 
     9; @categories  
     10; utilities 
    1011; 
    11 ; @restrictions compatible with @ps @vzoom text_box... 
     12; @restrictions  
     13; compatible with \@ps \@vzoom text_box... 
    1214; 
    13 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     15; @history  
     16; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    1417; 
    1518; 
    16 ; @version $Id$ 
     19; @version  
     20; $Id$ 
    1721; 
    18 ; @todo seb 
     22; @todo  
     23; seb 
    1924; 
    2025;- 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/vzoom.pro

    r134 r150  
    88; ZOOM prewritten by IDL which just get pixels bigger. 
    99; 
    10 ; @categories utilities 
     10; @categories  
     11; utilities 
    1112; 
    12 ; @restrictions use the journal. 
    13 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     13; @restrictions  
     14; use the journal. 
     15;  
     16; @history 
     17; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    1418;          29/4/1999 
    1519; 
    16 ; @version $Id$  
     20; @version  
     21; $Id$  
    1722; 
    18 ; @todo seb 
     23; @todo 
     24; seb 
    1925; 
    2026;- 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:buildcmd 
    6 ; 
    7 ; PURPOSE:cette fonction reourne un string qui contient la commande de 
    8 ; lecture et les parametres du trace. 
    9 ; 
    10 ; CATEGORY: 
    11 ; 
    12 ; CALLING SEQUENCE: 
    13 ;  
    14 ; INPUTS: 
    15 ; 
    16 ; KEYWORD PARAMETERS: 
    17 ; 
    18 ; OUTPUTS: 
    19 ; 
    20 ; COMMON BLOCKS: 
    21 ; 
    22 ; SIDE EFFECTS: 
    23 ; 
    24 ; RESTRICTIONS: 
    25 ; 
    26 ; EXAMPLE: 
    27 ; 
    28 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     5; 
     6; @file_comments 
     7; This function send back a string which contain the reading command  
     8; and drawing's parameters. 
     9; 
     10; @param BASE {in}{required} 
     11; 
     12; @keyword BOXZOOM 
     13; Vector indicating the geographic zone on which we want to cut the map.  
     14; If BOXZOOM has :  
     15;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     16;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     17;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     18;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     19;   6 elements: The extraction is made on Boxzoom  
     20; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     21; 
     22; @keyword FORCETYPE 
     23; 
     24; @history 
     25; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     26; 
     27; @version 
     28; $Id$ 
     29; 
     30; @todo 
     31; seb: documenter le param BASE et le keyword FORCETYPE 
    2932; 
    3033;- 
     
    5659;------------------------------------------------------------ 
    5760;--------------- 
    58 ; on determine quelle procedure on va etre appele pour faire le dessin 
    59 ; et le type 
     61; We determinate which procedure we will call to do the drawing and the type 
    6062;--------------- 
    6163  IF keyword_set(forcetype) THEN type = forcetype $ 
     
    8183  endcase 
    8284; 
    83 recherche des options 
     85Search of options 
    8486; 
    8587  options = extractatt(top_uvalue, 'options')    
     
    9496  alreadyvector = extractatt(top_uvalue, 'alreadyvector') 
    9597  alreadyover = extractatt(top_uvalue, 'alreadyoer') 
    96 ; que devons-nous lire ? 
     98; What must we read ? 
    9799  case 1 of 
    98100    alreadyover NE -1:BEGIN 
     
    340342;----------------------- 
    341343;--------------- 
    342 ; determination du nom de la boxzoom  
    343 ;--------------- 
     344; determination of the boxzoom's name. 
    344345  if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom 
    345 ; ecriture de celle-ci sous forme d''un string 
     346; Writting of this one as a string 
    346347  box = '['+strtrim(boxzoom[0], 1) 
    347348  for i = 1, (n_elements(boxzoom)-1) < (3+2*(strpos(type, 'z') EQ -1)) do $ 
    348349    box = box+', '+strtrim(boxzoom[i], 1) 
    349 ; pour les [plots en z, box doit avoir par defaut 0,profmax 
     350; For [plots in z, box must have by default 0,profmax 
    350351  if strpos(type, 'z') NE -1 then BEGIN 
    351 ; si + de 1 niveau est selectionne: 
     352; If more than 1 level is selected:  
    352353    widget_control, widget_info(base, find_by_uname = 'dthlv1'), get_value = niv1 
    353354    niv1 = niv1.combobox_index 
     
    372373  ENDIF 
    373374;--------------- 
    374 ; on determine typein 
     375; We determinate typein 
    375376;--------------- 
    376377    IF strpos(type, ' diag ') NE -1 THEN typein = ''''+strmid(type, 0, 4)+'''' $ 
     
    378379;--------------- 
    379380;--------------- 
    380 ; determination de small 
     381; determination of small 
    381382;--------------- 
    382383  ssmall = tostr(smallout) 
    383384;------------------------------------------------------------ 
    384 ; on va definir le string qui contiendra la commande a executer par widgetdessine.pro 
     385; We will define the string which will contain the command to be executed by widgetdessine.pro 
    385386;------------------------------------------------------------ 
    386387  Cmd = [readCmd, procedure+ ', field $' $ 
     
    395396;    print, '---------------' 
    396397;--------------- 
    397 ; on complete et/ou actualise la structure top_uvalue... 
     398; We complete and/or update the structure top_uvalue... 
    398399;--------------- 
    399400  (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessinout] = procedure 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcmd.pro

    r148 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; NAME:buildreadcmd 
     2;  
     3; @param BASE {in}{required}  
     4; The id of the widget where apply the drawing. 
    65; 
    7 ; PURPOSE: 
     6; @param SNAMEEXP {in}{required} 
    87; 
    9 ; CATEGORY: 
    108; 
    11 ; CALLING SEQUENCE: 
     9; @param PROCEDURE {in}{required} 
     10; 
     11; 
     12; @param TYPE {in}{required} 
     13; 
    1214;  
    13 ; INPUTS: 
     15; @keyword BOXZOOM 
     16; Vector indicating the geographic zone on which we want to cut the map.  
     17; If BOXZOOM has :  
     18;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     19;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     20;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     21;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     22;   6 elements: The extraction is made on Boxzoom  
     23; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
    1424; 
    15 ; KEYWORD PARAMETERS: 
     25; @keyword COMPLETE 
    1626; 
    17 ; OUTPUTS: 
     27 
     28; @keyword NAMEFIELD 
    1829; 
    19 ; COMMON BLOCKS:common.pro 
    2030; 
    21 ; SIDE EFFECTS: 
     31; @uses 
     32; common.pro 
     33;  
     34; @history 
     35; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     36;  
     37; @version  
     38; $Id$ 
    2239; 
    23 ; RESTRICTIONS: 
    24 ; 
    25 ; EXAMPLE: 
    26 ; 
    27 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     40; @todo 
     41; seb: documenter les param et les keyword qui ne le sont pas. 
    2842; 
    2943;- 
    30 ;------------------------------------------------------------ 
    31 ;------------------------------------------------------------ 
    32 ;------------------------------------------------------------ 
    3344FUNCTION buildreadcmd, base, snameexp, procedure, type, BOXZOOM = boxzoom $ 
    3445                       , COMPLETE = complete, NAMEFIELD = namefield 
     
    135146;------------------------------------------------------------ 
    136147;------------------------------------------------------------ 
    137 ; on va definir le string qui contiendra la commande a executer pour 
    138 ; la lecture 
     148; We will define the string which will contain the command to be executed for the reading. 
    139149;------------------------------------------------------------ 
    140150    Cmd = ['; Definition of extra structure:', 'extra = '+sextra $ 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param BASE {in}{required} 
     9; The id of the widget where apply the drawing. 
     10; 
     11; @param NEWFIELDNAME 
     12; 
     13;  
     14; @keyword BOXZOOM 
     15; Vector indicating the geographic zone on which we want to cut the map.  
     16; If BOXZOOM has :  
     17;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     18;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     19;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     20;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     21;   6 elements: The extraction is made on Boxzoom  
     22; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     23;  
     24; @returns 
     25;  
     26;  
     27; @uses 
     28;  
     29;  
     30; @restrictions 
     31;  
     32;  
     33; @examples 
     34;  
     35;  
     36; @history 
     37;  
     38;  
     39; @version  
     40; $Id$ 
     41; 
     42; @todo 
     43; seb 
     44; 
     45;- 
    146PRO changefield, base, newfieldname, BOXZOOM = boxzoom 
    247; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefile.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param BASE {in}{required} 
     9; The id of the widget where apply the drawing. 
     10; 
     11; @param NEWFILENAME 
     12; 
     13;  
     14; @keyword BOXZOOM 
     15; Vector indicating the geographic zone on which we want to cut the map.  
     16; If BOXZOOM has :  
     17;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     18;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     19;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     20;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     21;   6 elements: The extraction is made on Boxzoom  
     22; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     23;  
     24; @keyword DATE1 
     25;  
     26; @keyword DATE2 
     27; 
     28; @keyword FIELDNAME 
     29;  
     30;  
     31; @returns 
     32;  
     33;  
     34; @uses 
     35;  
     36;  
     37; @restrictions 
     38;  
     39;  
     40; @examples 
     41;  
     42;  
     43; @history 
     44;  
     45;  
     46; @version  
     47; $Id$ 
     48; 
     49; @todo 
     50; seb 
     51; 
     52;- 
    153PRO changefile, base, newfilename, BOXZOOM = boxzoom, DATE1 = date1, DATE2 = date2, FIELDNAME = fieldname 
    254; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/createhistory.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param BASE {in}{required} 
     9; The id of the widget where apply the drawing. 
     10; 
     11; @param SMALL 
     12; Vector composed of 3 or 4 elements, applyed to make a drawing on a small  
     13; portion of a page or screen. It delimit the zone where the drawing will  
     14; be done. If there is 4 elements: then is constituated of coordinates (expressed  
     15; in cm located from the up and left corner of the page or the window (in portrait  
     16; like in lanscape)) of the bottom and left corner and of the up and right corner  
     17; of the drawing zone. If there is 3 elements: in this case, we divide the page or  
     18; the screen in small[0] columns and in small[1] lines the drawing made in the box  
     19; numbered small[2]. The numerotation starting up and left by the number 1 and then,  
     20; following the writing direction. By default, we make the largest drawing we can do,  
     21; conserving the aspect rapport (exept when REMPLI is activated). 
     22;  
     23; @returns 
     24;  
     25;  
     26; @uses 
     27;  
     28;  
     29; @restrictions 
     30;  
     31;  
     32; @examples 
     33;  
     34;  
     35; @history 
     36;  
     37;  
     38; @version  
     39; $Id$ 
     40; 
     41; @todo 
     42; seb: je ne suis pas sur pour les param, 
     43; documenter le reste. 
     44; 
     45;- 
    146PRO createhistory, base, small 
    247; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/cutcmd.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param WIDCMD 
     9; 
     10; 
     11; @param TOREAD 
     12; 
     13; 
     14; @param NUMBEROFREAD 
     15; 
     16; 
     17; @param PREFIX 
     18; 
     19; 
     20; @param NAMEEXP 
     21; 
     22; 
     23; @param ENDING 
     24; 
     25;  
     26; @returns 
     27;  
     28;  
     29; @uses 
     30;  
     31;  
     32; @restrictions 
     33;  
     34;  
     35; @examples 
     36;  
     37;  
     38; @history 
     39;  
     40;  
     41; @version  
     42; $Id$ 
     43;  
     44; @todo 
     45; seb 
     46; 
     47;- 
    148PRO cutcmd, widcmd, toread, numberofread, prefix, nameexp, ending 
    249; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/definedefaultextra.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param NOMVARIABLE 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133FUNCTION definedefaultextra, nomvariable 
    234; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133PRO doubleclickaction, event 
    234;------------------------------------------------------------ 
     
    638   widget_control, event.id , get_uvalue = uval 
    739   widget_control, event.top, get_uvalue = top_uvalue 
    8 ; on active la bonne fenetre  
     40; We activate the right window 
    941   widget_control, event.id, get_value = win 
    1042   wset, win 
    11 ; quel est le dessin selectionne?? 
     43; What is the selected drawing? 
    1244   smallin = extractatt(top_uvalue, 'smallin') 
    1345   smallout = extractatt(top_uvalue, 'smallout') 
     
    1749   numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1 
    1850   numdessin = numcolonne+numligne*smallin[0]+1 
    19 ; choix du type d''action 
     51; Choice of the type of action. 
    2052   case uval.press of 
    2153      1:BEGIN 
     
    4678         inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $ 
    4779          , '; end of '+strtrim(numdessin, 2) 
    48 ; remise a 0 des attributs de la uvalue concernant ce dessin: 
     80; Putting at 0 of attributes of the value concerning the drawing:  
    4981 
    5082         numdessin = numdessin-1 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/extractatt.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param TOP_UVALUE 
     9; 
     10; 
     11; @param NAME 
     12; 
     13;  
     14; @returns 
     15;  
     16;  
     17; @uses 
     18;  
     19;  
     20; @restrictions 
     21;  
     22;  
     23; @examples 
     24;  
     25;  
     26; @history 
     27;  
     28;  
     29; @version  
     30; $Id$ 
     31;  
     32; @todo 
     33; seb 
     34; 
     35;- 
    136FUNCTION extractatt, top_uvalue, name 
    237; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/findline.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param TOP_UVALUE 
     9; 
     10; 
     11; @param NAME 
     12; 
     13;  
     14; @returns 
     15;  
     16;  
     17; @uses 
     18;  
     19;  
     20; @restrictions 
     21;  
     22;  
     23; @examples 
     24;  
     25;  
     26; @history 
     27;  
     28;  
     29; @version  
     30; $Id$ 
     31;  
     32; @todo 
     33; seb 
     34; 
     35;- 
    136FUNCTION findline, top_uvalue, name 
    237; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133FUNCTION identifyclick, event 
    234; 
     
    739   if thisEvent EQ 'WIDGET_TIMER' then press = 0 ELSE press = event.press 
    840; 
    9 ;  d/0/>1 -------->t/1/0--------->**d/2/0**       long click 
    10 ;         -------->d/1/0--------->**t/2/0**  click normal 
     41;  d/0/>1 -------->t/1/0--------->**d/2/0**    long click 
     42;         -------->d/1/0--------->**t/2/0**  normal click 
    1143;                       --------->**d/2/>1**-------->d/3/0----->t/0/0  double click 
    1244;                                           -------->t/3/0----->d/0/0  double click 
    1345   type = 'inutile' 
    1446   case 1 OF 
    15 ; d/0/0 1er remonte 
     47; d/0/0 1er reascending 
    1648      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 0 AND press EQ 0: 
    17 ; d/0/>1 1er appuie de la serie 
     49; d/0/>1 1er click of the series 
    1850      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 0 AND press ge 1:BEGIN 
    1951         uval.x = [event.x, 0] 
     
    2355         widget_control, event.id, timer = .3 
    2456      END 
    25 ; d/1/0 1er remonte 
     57; d/1/0 1er reascending 
    2658      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 1 AND press EQ 0:uval.click = 2 
    27 ; d/2/0 fin long click 
     59; d/2/0 End of the long click 
    2860      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 2 AND press EQ 0:BEGIN 
    2961         type = 'long' 
     
    3971         uval.click = 3 
    4072      END 
    41 ; d/3/0 remonte et fin de double click 
     73; d/3/0 reascending and end of the double click 
    4274      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 3 AND press EQ 0:uval.click = 0 
    43 ; t/0/0 fin de double click 
     75; t/0/0 End of the double click 
    4476      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 0 AND press EQ 0: 
    4577; t/1/0 long click 
    4678      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 1 AND press EQ 0:uval.click = 2 
    47 ; t/2/0 click normal 
     79; t/2/0 normal click 
    4880      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 2 AND press EQ 0:BEGIN  
    4981         type = 'single' 
     
    5183         uval.click = 0 
    5284      END 
    53 ; t/3/0 fin de double click 
     85; t/3/0 End of the double click 
    5486      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 3 AND press EQ 0:uval.click = 0 
    55 ; cas normalement impossible: 
     87; Imposible case in theory: 
    5688      ELSE:BEGIN 
    5789         print, thisEvent, uval.click, press 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/inserthistory.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param BASE 
     9; 
     10; 
     11; @param TEXT 
     12; 
     13; 
     14; @param LINE1 
     15; 
     16; 
     17; @param LINE2 
     18; 
     19;  
     20; @returns 
     21;  
     22;  
     23; @uses 
     24;  
     25;  
     26; @restrictions 
     27;  
     28;  
     29; @examples 
     30;  
     31;  
     32; @history 
     33;  
     34;  
     35; @version 
     36; $Id$  
     37;  
     38; @todo 
     39; seb 
     40; 
     41;- 
     42;------------------------------------------------------------- 
    143PRO inserthistory,  base, text, line1, line2 
    2 ;------------------------------------------------------------- 
    344; 
    445  compile_opt idl2, strictarrsubs 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; NAME:widgetdessine 
     2; @file_comments  
     3; It si the procedure lauching the drawing.  
     4; If we do not give the command to it, it call  
     5; construitcommande to know what to trace. 
    66; 
    7 ; PURPOSE: c'est la procedure qui lance le dessin. Si on ne le lui 
    8 ; donne pas de commande, elle appelle construitcommande pour savoir 
    9 ; quoi tracer. 
     7; @categories 
    108; 
    11 ; CATEGORY: 
     9;  
     10; @param BASE {in}{required} 
     11; The id of the widget where apply the drawing. 
     12;  
     13; @keyword COMMANDE 
     14; A string of the style: read_data('sst'...),... 
    1215; 
    13 ; CALLING SEQUENCE:widgetdessine, base 
     16; @keyword _EXTRA 
     17; Used to pass your keywords  
    1418;  
    15 ; INPUTS:base: l''id du widget ou appliquer le dessin 
    16 ; 
    17 ; KEYWORD PARAMETERS: 
    18 ;       COMMANDE: un string du style: read_data('sst'...),.... 
    19 ; 
    20 ; OUTPUTS: 
    21 ; 
    22 ; COMMON BLOCKS:common.pro 
    23 ; 
    24 ; SIDE EFFECTS: 
    25 ; 
    26 ; RESTRICTIONS: 
    27 ; 
    28 ; EXAMPLE: 
    29 ; 
    30 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    31 ; 
     19; @uses 
     20; common.pro  
     21;  
     22; @history 
     23; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     24;  
     25; @version  
     26; $Id$ 
     27;  
    3228;- 
    33 ;------------------------------------------------------------ 
    34 ;------------------------------------------------------------ 
    35 ;------------------------------------------------------------ 
    36  
    3729PRO letsdraw, base, COMMANDE = commande, _extra = ex 
    3830; 
     
    4032; 
    4133@common 
    42 ; on recupere la uvalue de base 
     34; we recuperate the uvalue of base 
    4335; widget_control,base, get_uvalue = top_uvalue 
    4436; print, '*****************' 
     
    6153; 
    6254; 
    63 ; on recuperel''id de la fenetre graphique associee au widget d''id base 
     55; we recuperate the id of the graphic associated to the widget of id base. 
    6456   graphid = extractatt(top_uvalue, 'graphid') 
    6557   widget_control, graphid, get_value = win 
    66 ; on la selectionne (c''est a elle que sera passe toutes les commandes 
    67 ; concernant une fenetre) 
     58; We select it (we will pass to it all commands concerning the window) 
    6859   wset, win 
    69 ;   erase, 255                       ; on netoie la fenetre 
    70 ; on s''assure que si on travaille avec un ecran codant les couleurs 
    71 ; sur 24 bits la couleur de fond specifiee!p.background est bien 
    72 ; appliquee 
     60;   erase, 255                       ; we clean the window 
     61; We make sure that, if we work with a screen coding colors on 24 bits, the specified background color !p.background is the one applied. 
    7362;    if !d.n_colors gt 256 then begin 
    7463;       device, decomposed=1 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param MESHFILEIN 
     9; 
     10;  
     11; @keyword _EXTRA 
     12; Used to pass your keywords 
     13;  
     14; @returns 
     15;  
     16;  
     17; @uses 
     18;  
     19;  
     20; @restrictions 
     21;  
     22;  
     23; @examples 
     24;  
     25;  
     26; @history 
     27;  
     28;  
     29; @version  
     30; $Id$ 
     31; 
     32; @todo 
     33; seb 
     34; 
     35;- 
    136PRO loadgrid, meshfilein, _extra = ex 
    237; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133PRO longclickaction, event 
    234; 
     
    537  widget_control, event.id, get_uvalue = uval 
    638  widget_control, event.top, get_uvalue = top_uvalue 
    7 ; quel est le dessin selectionne?? 
     39; What is the selected drawing? 
    840  smallout = extractatt(top_uvalue, 'smallout') 
    941  smallin = extractatt(top_uvalue, 'smallin') 
     
    3264  domainid = widget_info(event.top, find_by_uname = 'domain') 
    3365  boxzoom = [x, y] 
    34 ; faut-il passer la boxzoom en indexes ??? 
     66; Do we have to pass the boxzoom in indexes ??? 
    3567  currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 
    3668  options = extractatt(top_uvalue, 'options')    
     
    4072  changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1 
    4173  if changex OR changey then begin 
    42 ; on veut retrouver le type de grille qui est utilisee 
     74; We want to find the type of grid which is used 
    4375    currentfile = extractatt(top_uvalue, 'currentfile') 
    4476    listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param NAME 
     9; 
     10; 
     11; @param DEBUT 
     12; 
     13; 
     14; @param FIN 
     15; 
     16; 
     17; @param NOMEXP 
     18; 
     19; 
     20; @keyword PARENT 
     21; same as DIALOG_PARENT de dialog_message.pro 
     22; 
     23; @keyword BOXZOOM 
     24; Vector indicating the geographic zone on which we want to cut the map.  
     25; If BOXZOOM has :  
     26;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     27;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     28;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     29;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     30;   6 elements: The extraction is made on Boxzoom  
     31; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     32; 
     33; @keyword _EXTRA 
     34; Used to pass your keywords  
     35;  
     36; @returns 
     37;  
     38;  
     39; @uses 
     40;  
     41;  
     42; @restrictions 
     43;  
     44;  
     45; @examples 
     46;  
     47;  
     48; @history 
     49;  
     50;  
     51; @version  
     52; $Id$ 
     53; 
     54; @todo 
     55; seb 
     56;  
     57;- 
    158FUNCTION read_vermair, name, debut, fin, nomexp, PARENT = parent, BOXZOOM=boxzoom, _EXTRA = ex 
    259; 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param NAMEFILE 
     9; 
     10;  
     11; @keyword GRID 
     12; 
     13; 
     14; @keyword _EXTRA 
     15; Used to pass your keywords 
     16;  
     17; @returns 
     18;  
     19;  
     20; @uses 
     21;  
     22;  
     23; @restrictions 
     24;  
     25;  
     26; @examples 
     27;  
     28;  
     29; @history 
     30;  
     31;  
     32; @version  
     33; $Id$ 
     34; 
     35; @todo 
     36; seb : I don't know what to do with that... 
     37;  
     38;- 
    139; 
    240;  liste des presupposes: 
     
    145183          time = date0fk + lindgen(jpt) 
    146184        ENDIF ELSE BEGIN  
    147 ; on lit l''axe des temps 
     185; we read the time axis 
    148186          ncdf_varget, cdfid, varid, time 
    149187          time = double(time) 
     
    180218          ENDELSE 
    181219; 
    182 ; ATTENTION il faut recuperer l''attribut calendar et ajuster time en 
    183 ; consequense... 
    184 ; 
    185 ; 
    186 ; on passe time en jour julien d''idl  
     220; BEWARE we have to recuperate the calendar attribute and ajust TIME by consequence... 
     221; 
     222; 
     223; We pass TIME in IDL julian days 
    187224; 
    188225          unite = strlowcase(unite) 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.pro

    r134 r150  
    144144end 
    145145;********************************************************************* 
     146;+ 
     147; @file_comments 
     148; 
     149; 
     150; @categories 
     151; 
     152;  
     153; @param DATAFILENAME 
     154; 
     155; 
     156; @param IDLFILE 
     157; 
     158; 
     159; @param ARGSPRO 
     160; 
     161;  
     162; @keyword _EXTRA 
     163; Used to pass your keywords 
     164;  
     165; @returns 
     166;  
     167;  
     168; @uses 
     169;  
     170;  
     171; @restrictions 
     172;  
     173;  
     174; @examples 
     175;  
     176;  
     177; @history 
     178;  
     179;  
     180; @version  
     181; $Id$ 
     182;  
     183; @todo 
     184; seb: documenter les params 
     185;  
     186;- 
    146187FUNCTION selectfile, datafilename, idlfile, argspro, _extra = ex 
    147188; 
     
    153194;------------------------------------------------------------ 
    154195; 
    155 ; pour recuperer les reponses possees lors de l''utilisation de ce 
    156 ; widget on cree un pointeur que l''on place dans la uvalue. Comme ca 
    157 ; une fois que le widget est detruit dans la procedure ...event.pro, 
    158 ; la variable surlaquelle pointait le pointeur (contenue ds la uvalue 
    159 ; du widget) n''est pas detruite est on peut recuperer le resultat! 
     196; We create a pointer in the uvalue to recuperate answers at setted  
     197; questions atthe time of the use of this widget. So when the widget  
     198; is deleted in the procedure ...event.pro, the variable on which the  
     199; pointer pointed (contained in the uvalue of the widget) is not  
     200; deleted and we can recuperate the result! 
    160201; 
    161202  messenger = ptr_new(/allocate_heap) 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/singleclickaction.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133PRO singleclickaction, event 
    234; 
     
    1446  type = widget_info(actionid, /combobox_gettext) 
    1547  IF type NE 'plt' THEN return 
    16 ; on active la bonne fenetre  
     48; We activate the right window 
    1749  widget_control, event.id, get_value = win 
    1850  wset, win 
    19 ; choix du type d''action 
     51; choice of the type of action 
    2052  case uval.press of 
    2153    1:BEGIN 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/tracecadre.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param SMALL 
     9; 
     10;  
     11; @keyword OUT 
     12; 
     13; 
     14; @keyword ERASE 
     15; 
     16; 
     17; @keyword FILL 
     18;  
     19;  
     20; @returns 
     21;  
     22;  
     23; @uses 
     24;  
     25;  
     26; @restrictions 
     27;  
     28;  
     29; @examples 
     30;  
     31;  
     32; @history 
     33;  
     34;  
     35; @version 
     36; $Id$  
     37;  
     38; @todo 
     39; seb 
     40; 
     41;- 
    142PRO tracecadre, small, out = out, erase = erase, fill = fill 
    243;------------------------------------------------------------ 
    3 ; determination de la colonne et de la ligne correspondant au small en 
    4 ; entree 
     44; determination of the column and of the line corresponding in input to small 
    545; 
    646  compile_opt idl2, strictarrsubs 
     
    949   numligne = numdessin/small[0] 
    1050   numcolonne = numdessin-numligne*small[0] 
    11 ; determination de poscadre 
     51; determination of poscadre 
    1252   largeurcolonne = 1./small[0] 
    1353   largeurligne = 1./small[1] 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/updatewidget.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param BASE {in}{required} 
     9; The id of the widget where apply the drawing. 
     10;  
     11; @keyword NOBOXZOOM 
     12; 
     13; 
     14; @keyword NODATES 
     15; 
     16; 
     17; @keyword NOTYPE 
     18;  
     19;  
     20; @returns 
     21;  
     22;  
     23; @uses 
     24;  
     25;  
     26; @restrictions 
     27;  
     28;  
     29; @examples 
     30;  
     31;  
     32; @history 
     33;  
     34;  
     35; @version 
     36; $Id$  
     37;  
     38; @todo 
     39; seb 
     40; 
     41;- 
    142PRO updatewidget, base, NOBOXZOOM = noboxzoom, NODATES = nodates, NOTYPE = notype 
    243;---------------------------------------------------------------------- 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version 
     27; $Id$  
     28;  
     29; @todo 
     30; seb 
     31; 
     32;- 
    133pro xcreateanim_event, event  
    234; 
     
    436; 
    537@common 
    6 ; on recupere les aguments contenus ds le widget 
     38; We recuperate arguments contained in the widget 
    739  if tag_names(event, /structure_name) NE 'WIDGET_BUTTON' then return 
    840  widget_control, event.id, get_uvalue = uval 
     
    1244    return 
    1345  ENDIF 
    14 ; on va ecrire l''animation! 
     46; We will write the animation! 
    1547; 
    1648  widget_control, event.top, get_uvalue = local_uvalue 
     
    3668  index2 = where(calendar eq date2jul(vdate2)) & index2 = index2[0]  
    3769  if index2 EQ -1 OR index2 LE index1 then return 
    38 ; on detruit le widget avant de creer le fichier .ps 
     70; We delete the widget before create the file .ps 
    3971  widget_control, event.top, /destroy 
    4072; 
    41 ; creation de la routine qui nous serviera pour faire le dessin 
    42 ; 
    43 ; on recupere la liste des instructions 
     73; creation of the routine which will serve us to do the drawing 
     74; 
     75; We recuperate the list of instructions  
    4476  globalcommand = extractatt(top_uvalue, 'globalcommand') 
    45 ; on complete par le premiere et les dernieres lignes du programme 
     77; We complete by first and last lines of the program 
    4678  createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 
    4779             , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript, DATE1IN = date1in, DATE2IN = date2in' 
    4880; 
    49 ;--------creation du fichier---------- 
    50 ; 
    51 recupere le nombre d'octets surlequel on code la palette 
     81;--------creation of the file--------- 
     82; 
     83we recuperate the number of octets on which we code the palette. 
    5284  device, get_visual_depth = depth 
    53 ; taille de l''image (en nombre de pixel: 
     85; Picture's size (in number of pixels): 
    5486  xsize = !d.x_size 
    5587  ysize = !d.y_size 
    5688; 
    57 ; on verifie que le nom du fichier termine bien par .gif 
     89; We check that the file's name end by .gif 
    5890  if strpos(nomfic, '.gif') EQ -1 then nomfic = nomfic+'.gif' 
    5991 
     
    6294 
    6395 
    64 ; indication du numero de l''image que l''on est en train de creer 
     96; indication of the number of the picture we are creating 
    6597  base = widget_base() 
    6698  sliderid = widget_slider(base, minimum = 1, maximum = index2-index1+1, value = 1 $ 
     
    68100  widget_control, base, /realize 
    69101; 
    70 ; commencement du fichier gif. ecriture d''une image vide  
     102; Beginning of the gif file. Writting of an empty  picture. 
    71103  IF keyword_set(fakecal) THEN date = index1 ELSE date = jul2date(calendar[index1]) 
    72104  xxx2ps, /noerase, date1in = date, date2in = date 
     
    91123  wdelete, !d.window 
    92124; 
    93 ; boucle de creation et d''ecriture ds le fichier. 
     125; Creation and writting loop in the file. 
    94126; 
    95127  IF index2 GT index1 THEN BEGIN 
    96128    FOR ind = index1+1, index2 do BEGIN 
    97129; 
    98       widget_control, sliderid, set_value = ind-index1+1 ; on bouge le slider 
     130      widget_control, sliderid, set_value = ind-index1+1 ; We move the slider. 
    99131; 
    100132      window, /free, /pixmap, xsize = xsize, ysize = ysize 
     
    111143    ENDFOR 
    112144  ENDIF  
    113 ; on met une derniere image blanche 
     145; We put a last white picture 
    114146  window, /free, /pixmap, xsize = xsize, ysize = ysize 
    115147  reinitplt 
     
    122154  write_gif, animdir+nomfic, image, red, green, blue, /multiple 
    123155  wdelete, !d.window 
    124 ; fermeture du fichier 
     156; File's closing. 
    125157  write_gif, animdir+nomfic, /close  
    126158  widget_control, base, /destroy  
    127 ; rebascule en mode "normal" 
     159; Rerock in "normal" mode 
    128160  thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    129161; 
    130162  wset, current_window 
    131163 
    132 ; si on est sous x on essaie de lancer xanim... 
     164; If we are under x, we try to lauch xanim... 
    133165 
    134166  if thisOS NE 'MAC' AND thisOS NE 'WIN' then begin 
     
    141173end 
    142174;---------------------------------------------------------------- 
     175;+ 
     176; @file_comments 
     177; 
     178; 
     179; @categories 
     180; 
     181;  
     182; @param PARENT 
     183; 
     184;  
     185; @returns 
     186;  
     187;  
     188; @uses 
     189;  
     190;  
     191; @restrictions 
     192;  
     193;  
     194; @examples 
     195;  
     196;  
     197; @history 
     198;  
     199;  
     200; @version 
     201; $Id$  
     202;  
     203; @todo 
     204; seb 
     205; 
     206;- 
    143207PRO xcreateanim, parent 
    144208; 
     
    149213   widget_control, parent, get_uvalue = top_uvalue 
    150214; 
    151 ; on va s''assurer que toutes les procedures de sont pas pltt 
     215; We will make sure that all procedure are not in pltt 
    152216; 
    153217   procedures = extractatt(top_uvalue, 'nameprocedures') 
     
    157221   ENDIF 
    158222; 
    159 ; on va s''assurer que toutes les figures ont le meme calendrier  
     223; We will make sure that all figure have the same calendar 
    160224; 
    161225   filelist = extractatt(top_uvalue,  'filelist') 
     
    183247   endif 
    184248; 
    185 ; c''est possible de faire une animation   
     249; It is possible to do an animation. 
    186250; 
    187251   base = widget_base(/column, title = 'animation creation', uvalue = {parent:parent, indexfile:indexfile})    
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar_event.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param EVENT 
     9; 
     10;  
     11; @returns 
     12;  
     13;  
     14; @uses 
     15;  
     16;  
     17; @restrictions 
     18;  
     19;  
     20; @examples 
     21;  
     22;  
     23; @history 
     24;  
     25;  
     26; @version  
     27; $Id$ 
     28; 
     29; @todo  
     30; seb 
     31;- 
    132;------------------------------------------------ 
    233PRO xxxmenubar_event, event 
     
    1546      widget_control, event.top, update = 0 
    1647      widget_control, event.top, get_uvalue = top_uvalue 
    17 ; on s''occupe de filelist 
     48; We take care of filelist 
    1849      filelist = extractatt(top_uvalue, 'filelist') 
    1950      filelist = [filelist, newfile.fileparameters.filename] 
    2051      currentfile = n_elements(filelist)-1 
    21 ; on update le widget 
     52; We update the widget 
    2253      filelistid = widget_info(event.top, find_by_uname = 'filelist') 
    2354      widget_control, filelistid, combobox_additem = file_basename(newfile.fileparameters.filename) 
    2455      widget_control, filelistid, set_combobox_select = currentfile 
    25 ; on update les elements filelist et currentfile de la top_uvalue 
     56; We update filelist and currentfile's elements of the top_value 
    2657      *top_uvalue[1, findline(top_uvalue, 'filelist')] = filelist 
    2758      oldfile = *top_uvalue[1, findline(top_uvalue, 'currentfile')] 
    2859      *top_uvalue[1, findline(top_uvalue, 'currentfile')] = currentfile 
    29 ; on s''occupe du nom de la variable 
     60; We take care of the name of the variable 
    3061      vlstid = widget_info(event.top, find_by_uname = 'varlist') 
    31 ; quel etait le champ selectionne ? on le reselectionne ? 
     62; What is the selected field ? Do we reselect it ? 
    3263      fieldname = widget_info(vlstid, /combobox_gettext) 
    3364      index = where(newfile.fileparameters.listvar EQ fieldname)  
    3465      widget_control, vlstid, set_value = newfile.fileparameters.listvar 
    3566      widget_control, vlstid, set_combobox_select = 0 > index[0] 
    36 ; on s''occupe du calendrier 
     67; We take care of the calendar. 
    3768      key_caltype = newfile.fileparameters.caltype 
    3869      date1id = widget_info(event.top, find_by_uname = 'calendar1') 
     
    5384      rien = cw_calendar(basecal, newfile.fileparameters.time_counter, jdate2, uname = 'calendar2' $ 
    5485                         , FAKECAL = fakecal, uvalue = {name:'calendar2'}, /frame) 
    55 ; on update les elements fileparameters, readparameters et meshparameters de la top_uvalue 
     86; We update fileparameters, readparameters et meshparameters elements of the top_value 
    5687      newfileparameters = ptrarr(currentfile+1, /allocate_heap) 
    5788      FOR i = 0, currentfile-1 DO $ 
     
    74105      ptr_free, extractatt(top_uvalue, 'meshparameters') 
    75106      *top_uvalue[1, findline(top_uvalue, 'meshparameters')] = newmeshparameters 
    76 ; on actualise le widget! 
     107; We update the widget! 
    77108      if cmpgrid(oldmeshparams) then BEGIN 
    78109        domainid = widget_info(event.top, find_by_uname = 'domain') 
     
    93124      ptr_free, extractatt(top_uvalue, 'meshparameters') 
    94125      ptr_free, top_uvalue 
    95       widget_control, event.top, /destroy ;on ferme le widget 
     126      widget_control, event.top, /destroy ;We shut the widget 
    96127    end 
    97128    'PostScript' :BEGIN 
     
    101132      ENDIF 
    102133      widget_control, event.top, get_uvalue = top_uvalue 
    103 ; on recupere la liste des instructions 
     134; We recuperate the list of instructions 
    104135      globalcommand = extractatt(top_uvalue, 'globalcommand') 
    105136;      for i = 0, n_elements(globalcommand)-1 do print, globalcommand[i] 
    106 ; on complete par le premiere et les dernieres lignes du programme 
     137; We complete by first and last lines of the program. 
    107138      createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 
    108139                 , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript' $ 
     
    136167        return 
    137168      ENDIF 
    138 ; on recupere le nom du fichier 
     169; We recuperate the name of the file 
    139170      filename = xquestion('dans quelle procedure IDL voulez vous sauver !C la realisation de ce graph?', 'xxx_figure.pro') 
    140 ; on le complete par un .pro 
     171; We complete it by a .pro 
    141172      if rstrpos(filename, '.pro') NE strlen(filename)-4 then filename = filename+'.pro' 
    142173      filename = isafile(file = filename, io = homedir, /new) 
    143174      widget_control, event.top, get_uvalue = top_uvalue 
    144 ; portrait ou landscape ??? 
     175; portrait or landscape ??? 
    145176      options = extractatt(top_uvalue, 'options')    
    146177      optionsflag = extractatt(top_uvalue, 'optionsflag') 
    147178      portrait = (optionsflag[where(options EQ 'Portrait/Landscape'), 0])[0] 
    148 ; on lit les commandes pour faire un plot 
     179; We read commands to do a plot 
    149180      globalcommand = extractatt(top_uvalue, 'globalcommand') 
    150 ; on complete par le premiere et les dernieres lignes du programme 
     181; We complete by first and last lines of the program 
    151182      thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    152183      CASE thisOS of 
     
    163194                       , 'return' $ 
    164195                       , 'end'] 
    165 ; on les ecrit dans un programme 
     196; We write it in a program 
    166197      putfile, filename, globalcommand 
    167198    END 
     
    171202        return 
    172203      ENDIF 
    173 ; on recupere le nom du fichier 
     204; We recuperate the name of the file 
    174205      filename = xquestion('dans quel fichier bianire voulez vous sauver le widget ?', 'xxx_widget.dat') 
    175 ; on le complete par un .dat 
     206; We complete it by a .dat 
    176207      if rstrpos(filename, '.dat') NE strlen(filename)-4 then filename = filename+'.dat' 
    177208      filename = isafile(file = filename, io = homedir, /new) 
     
    195226      key_portrait = 1-optionsflag[index, 0] 
    196227      (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, *] = key_portrait 
    197 ; fenetre separee ou fenetre collee au widget ? 
     228; Separated windows or windows stuck to the widget? 
    198229      if widget_info(event.top, find_by_uname = 'graph') EQ 0 then BEGIN 
    199 ; on tue la fenetre 
     230; We delete the window 
    200231        graphid = extractatt(top_uvalue, 'graphid') 
    201232        widget_control, widget_info(graphid, /parent), /destroy 
    202 ; on la recree 
     233; We recreate it. 
    203234        basegraph = widget_base(title = 'xxx window',  group_leader = event.top, uvalue = event.top,  uname = 'basegraph') 
    204235        windsize = givewindowsize() 
     
    209240        widget_control, basegraph, /realize 
    210241        xmanager, 'xxx', basegraph, /no_block 
    211 ; on redessine ce qu''il y avait dedans 
    212 ; on recupere la liste des instructions 
     242; We redraw what their were into it 
     243; We recuperate the list of instructions 
    213244        globalcommand = extractatt(top_uvalue, 'globalcommand') 
    214 ; on complete par le premiere et les dernieres lignes du programme 
     245; We complete by first and last lines of the program 
    215246        createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 
    216247                   , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript, PORTRAIT = portrait, LANDSCAPE = landscape' $ 
    217248                   , KWDUSED = ', /noerase, PORTRAIT = portrait' 
    218 ; on reattribue l''element graphid de la top_uvalue 
     249; We reattribute the graphic element of the top_value 
    219250        *top_uvalue[1, findline(top_uvalue, 'graphid')] = graphid 
    220251      ENDIF ELSE BEGIN 
    221252        extra = extractatt(top_uvalue, 'extra') 
    222253        xxx, CALLERWIDID = event.top, /redraw, _extra = extra 
    223         widget_control, event.top, /destroy ;on ferme le widget 
     254        widget_control, event.top, /destroy ;We shut the widget 
    224255      ENDELSE 
    225256    end 
     
    230261      flags = extractatt(top_uvalue, 'optionsflag') 
    231262      index = where(options EQ 'Overlay') 
    232 ; on change le flag sur Longitude / x index 
     263; We change the flag on Longitude / x index 
    233264      flag = 1-flags[index, numdessinin] & flag = flag[0] 
    234 ; on le reeatribue 
     265; We reattribute it 
    235266      (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 
    236267    end 
     
    241272      flags = extractatt(top_uvalue, 'optionsflag') 
    242273      index = where(options EQ 'Vecteur') 
    243 ; on change le flag sur Longitude / x index 
     274; We change the flag on Longitude / x index 
    244275      flag = 1-flags[index, numdessinin] & flag = flag[0] 
    245 ; on le reeatribue 
     276; We reattribute it 
    246277      (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 
    247278    end 
     
    252283      flags = extractatt(top_uvalue, 'optionsflag') 
    253284      index = where(options EQ 'Longitude / x index') 
    254 ; on change le flag sur Longitude / x index 
     285; We change the flag on Longitude / x index 
    255286      flag = 1-flags[index, numdessinin] & flag = flag[0] 
    256 ; on le reeatribue 
     287; We reattribute it 
    257288      (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 
    258 ; maintenant on va changer les sliders definissant la boxzoom 
     289; Now we will change sliders defining the boxzoom 
    259290      domainid = widget_info(event.top, find_by_uname = 'domain') 
    260291      boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin] 
    261 ; on veut retrouver le type de grille qui est utilisee 
     292; We want to find the type of grid which is used 
    262293      currentfile = extractatt(top_uvalue, 'currentfile') 
    263294      listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid 
     
    268299      vargrid = strupcase(listgrid[indexvar]) 
    269300      if flag EQ 0 then BEGIN   ; longitudes 
    270 ; on fait un domdef pour retrouver le lon1 lon2 correspondant a la 
    271 ; boxzoom definie sur le widget...  
     301; We do a domdef to find the lon1 lon2 corresponding to the boxzoom defined on the widget... 
    272302        domdef, boxzoom, gridtype = vargrid, /xindex $ 
    273303                , yindex = (flags[where(options EQ 'Latitude / y index'), numdessinin])[0] 
    274304        widget_control, domainid, set_value = [lon1, lon2, boxzoom[2:3]] 
    275305      ENDIF ELSE BEGIN          ; xindex 
    276 ; maintenant ion veut retrouver firstx, lastx correspondant a la 
    277 ; boxzoom definie sur le widget... 
     306; now we want to find firstx, lastx corresponding to the boxzoom defined on the widget... 
    278307        domdef, boxzoom, gridtype = vargrid $ 
    279308                , yindex = (flags[where(options EQ 'Latitude / y index'), numdessinin])[0] 
     
    281310        widget_control, domainid, set_value = [firstx, lastx, boxzoom[2:3]] 
    282311      ENDELSE 
    283 ; on met a jour la top_uvalue 
     312; We update the top_uvalue 
    284313      widget_control, domainid, get_value = boxzoom 
    285314      (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 
     
    291320      flags = extractatt(top_uvalue, 'optionsflag') 
    292321      index = where(options EQ 'Latitude / y index') 
    293 ; on change le flag sur Latitude / y index 
     322; We change the flag on Latitude / y index 
    294323      flag = 1-flags[index, numdessinin] & flag = flag[0] 
    295 ; on le reeatribue 
     324; We reattribute it 
    296325      (*top_uvalue[1, findline(top_uvalue, 'optionsflag')])[index, numdessinin] = flag 
    297 ; maintenant on va changer les sliders definissant la boxzoom 
     326; Now we will change sliders defining the boxzoom 
    298327      domainid = widget_info(event.top, find_by_uname = 'domain') 
    299328      boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin] 
    300 ; on veut retrouver le type de grille qui est utilisee 
     329; We want to find the type of grid which is used 
    301330      currentfile = extractatt(top_uvalue, 'currentfile') 
    302331      listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid 
     
    307336      vargrid = strupcase(listgrid[indexvar]) 
    308337      if flag EQ 0 then BEGIN   ; latitudes 
    309 ; on fait un domdef pour retrouver le lat1 lat2 correspondant a la 
    310 ; boxzoom definie sur le widget...  
     338; We do a domdef to find the lat1 lat2 corresponding to the boxzoom defined on the widget... 
    311339        domdef, boxzoom, gridtype = vargrid, /yindex $ 
    312340                , xindex = (flags[where(options EQ 'Longitude / x index'), numdessinin])[0] 
    313341        widget_control, domainid, set_value = [boxzoom[0:1], lat1, lat2] 
    314342      ENDIF ELSE BEGIN          ; yindex 
    315 ; maintenant ion veut retrouver firsty, lasty correspondant a la 
    316 ; boxzoom definie sur le widget... 
     343; now we want to find firsty, lasty corresponding to the boxzoom defined on the widget... 
    317344        domdef, boxzoom, gridtype = vargrid $ 
    318345                , xindex = (flags[where(options EQ 'Longitude / x index'), numdessinin])[0] 
     
    320347        widget_control, domainid, set_value = [boxzoom[0:1], firsty, lasty] 
    321348      ENDELSE 
    322 ; on met a jour la top_uvalue 
     349; We update the top_uvalue 
    323350      widget_control, domainid, get_value = boxzoom 
    324351      (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro

    r134 r150  
    1 ; $Id$ 
    2 ; 
    3 ; Copyright (c) 1992-2005, Research Systems, Inc.  All rights reserved. 
    4 ;   Unauthorized reproduction prohibited. 
    5 ;+ 
    6 ; NAME: 
    7 ;   CW_BGROUP 
    8 ; 
    9 ; PURPOSE: 
    10 ;   CW_BGROUP is a compound widget that simplifies creating 
    11 ;   a base of buttons. It handles the details of creating the 
    12 ;   proper base (standard, exclusive, or non-exclusive) and filling 
    13 ;   in the desired buttons. Events for the individual buttons are 
    14 ;   handled transparently, and a CW_BGROUP event returned. This 
    15 ;   event can return any one of the following: 
    16 ;       - The Index of the button within the base. 
    17 ;       - The widget ID of the button. 
    18 ;       - The name of the button. 
    19 ;       - An arbitrary value taken from an array of User values. 
    20 ; 
    21 ; CATEGORY: 
    22 ;   Compound widgets. 
    23 ; 
    24 ; CALLING SEQUENCE: 
    25 ;       Widget = CW_BGROUP(Parent, Names) 
    26 ; 
    27 ;   To get or set the value of a CW_BGROUP, use the GET_VALUE and 
    28 ;   SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP 
    29 ;   is: 
    30 ; 
    31 ;       ----------------------------------------------- 
    32 ;       Type        Value 
    33 ;       ----------------------------------------------- 
    34 ;       normal      None 
    35 ;       exclusive       Index of currently set button 
    36 ;       non-exclusive   Vector indicating the position 
    37 ;               of each button (1-set, 0-unset) 
    38 ;       ----------------------------------------------- 
    39 ; 
    40 ; 
    41 ; INPUTS: 
    42 ;       Parent:     The ID of the parent widget. 
    43 ;   Names:      A string array, containing one string per button, 
    44 ;           giving the name of each button. 
    45 ; 
    46 ; KEYWORD PARAMETERS: 
    47 ; 
    48 ;   BUTTON_UVALUE:  An array of user values to be associated with 
    49 ;           each button and returned in the event structure. 
    50 ;   COLUMN:     Buttons will be arranged in the number of columns 
    51 ;           specified by this keyword. 
    52 ;   EVENT_FUNCT:    The name of an optional user-supplied event function 
    53 ;           for buttons. This function is called with the return 
    54 ;           value structure whenever a button is pressed, and 
    55 ;           follows the conventions for user-written event 
    56 ;           functions. 
    57 ;   EXCLUSIVE:  Buttons will be placed in an exclusive base, with 
    58 ;           only one button allowed to be selected at a time. 
    59 ;   FONT:       The name of the font to be used for the button 
    60 ;           titles. If this keyword is not specified, the default 
    61 ;           font is used. 
    62 ;   FRAME:      Specifies the width of the frame to be drawn around 
    63 ;           the base. 
    64 ;   IDS:        A named variable into which the button IDs will be 
    65 ;           stored, as a longword vector. 
    66 ;   LABEL_LEFT: Creates a text label to the left of the buttons. 
    67 ;   LABEL_TOP:  Creates a text label above the buttons. 
    68 ;   MAP:        If set, the base will be mapped when the widget 
    69 ;           is realized (the default). 
    70 ;   NONEXCLUSIVE:   Buttons will be placed in an non-exclusive base. 
    71 ;           The buttons will be independent. 
    72 ;   NO_RELEASE: If set, button release events will not be returned. 
    73 ;   RETURN_ID:  If set, the VALUE field of returned events will be 
    74 ;           the widget ID of the button. 
    75 ;   RETURN_INDEX:   If set, the VALUE field of returned events will be 
    76 ;           the zero-based index of the button within the base. 
    77 ;           THIS IS THE DEFAULT. 
    78 ;   RETURN_NAME:    If set, the VALUE field of returned events will be 
    79 ;           the name of the button within the base. 
    80 ;   ROW:        Buttons will be arranged in the number of rows 
    81 ;           specified by this keyword. 
    82 ;   SCROLL:     If set, the base will include scroll bars to allow 
    83 ;           viewing a large base through a smaller viewport. 
    84 ;   SET_VALUE:  The initial value of the buttons. This is equivalent 
    85 ;           to the later statement: 
    86 ; 
    87 ;           WIDGET_CONTROL, widget, set_value=value 
    88 ; 
    89 ;   SPACE:      The space, in pixels, to be left around the edges 
    90 ;           of a row or column major base. This keyword is 
    91 ;           ignored if EXCLUSIVE or NONEXCLUSIVE are specified. 
    92 ;   UVALUE:     The user value to be associated with the widget. 
    93 ;   UNAME:      The user name to be associated with the widget. 
    94 ;   XOFFSET:    The X offset of the widget relative to its parent. 
    95 ;   XPAD:       The horizontal space, in pixels, between children 
    96 ;           of a row or column major base. Ignored if EXCLUSIVE 
    97 ;           or NONEXCLUSIVE are specified. 
    98 ;   XSIZE:      The width of the base. 
    99 ;   X_SCROLL_SIZE:  The width of the viewport if SCROLL is specified. 
    100 ;   YOFFSET:    The Y offset of the widget relative to its parent. 
    101 ;   YPAD:       The vertical space, in pixels, between children of 
    102 ;           a row or column major base. Ignored if EXCLUSIVE 
    103 ;           or NONEXCLUSIVE are specified. 
    104 ;   YSIZE:      The height of the base. 
    105 ;   Y_SCROLL_SIZE:  The height of the viewport if SCROLL is specified. 
    106 ; 
    107 ; OUTPUTS: 
    108 ;       The ID of the created widget is returned. 
    109 ; 
    110 ; SIDE EFFECTS: 
    111 ;   This widget generates event structures with the following definition: 
    112 ; 
    113 ;       event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 } 
    114 ; 
    115 ;   The SELECT field is passed through from the button event. VALUE is 
    116 ;   either the INDEX, ID, NAME, or BUTTON_UVALUE of the button, 
    117 ;   depending on how the widget was created. 
    118 ; 
    119 ; RESTRICTIONS: 
    120 ;   Only buttons with textual names are handled by this widget. 
    121 ;   Bitmaps are not understood. 
    122 ; 
    123 ; MODIFICATION HISTORY: 
    124 ;   15 June 1992, AB 
    125 ;   7 April 1993, AB, Removed state caching. 
    126 ;   6 Oct. 1994, KDB, Font keyword is not applied to the label. 
    127 ;       10 FEB 1995, DJC  fixed bad bug in event procedure, getting 
    128 ;                         id of stash widget. 
    129 ;   11 April 1995, AB Removed Motif special cases. 
    130 ;- 
    131  
    132  
    1331pro CW_BGROUP_SETV, id, value 
    1342  compile_opt hidden, idl2, strictarrsubs 
     
    22492 
    22593 
     94 
     95 
     96; 
     97;+ 
     98; @file_comments 
     99; CW_BGROUP is a compound widget that simplifies creating 
     100; a base of buttons. It handles the details of creating the 
     101; proper base (standard, exclusive, or non-exclusive) and filling 
     102; in the desired buttons. Events for the individual buttons are 
     103; handled transparently, and a CW_BGROUP event returned. This 
     104; event can return any one of the following: 
     105;      - The Index of the button within the base. 
     106;      - The widget ID of the button. 
     107;      - The name of the button. 
     108;      - An arbitrary value taken from an array of User values. 
     109; 
     110; @categories 
     111; Compound widgets. 
     112; 
     113; @param PARENT {in}{required} 
     114; The ID of the parent widget. 
     115;  
     116; @param NAMES 
     117; A string array, containing one string per button, 
     118; giving the name of each button. 
     119; 
     120; @keyword BUTTON_UVALUE 
     121; An array of user values to be associated with 
     122; each button and returned in the event structure. 
     123;  
     124; @keyword COLUMN 
     125; Buttons will be arranged in the number of columns 
     126; specified by this keyword. 
     127;  
     128; @keyword EVENT_FUNCT 
     129; The name of an optional user-supplied event function 
     130; for buttons. This function is called with the return 
     131; value structure whenever a button is pressed, and 
     132; follows the conventions for user-written event functions. 
     133;  
     134; @keyword EXCLUSIVE 
     135; Buttons will be placed in an exclusive base, with 
     136; only one button allowed to be selected at a time. 
     137;  
     138; @keyword FONT 
     139; The name of the font to be used for the button 
     140; titles. If this keyword is not specified, the default 
     141; font is used. 
     142;  
     143; @keyword FRAME 
     144; Specifies the width of the frame to be drawn around the base. 
     145;  
     146; @keyword IDS 
     147; A named variable into which the button IDs will be 
     148; stored, as a longword vector. 
     149;  
     150; @keyword LABEL_LEFT 
     151; Creates a text label to the left of the buttons. 
     152;  
     153; @keyword LABEL_TOP 
     154; Creates a text label above the buttons. 
     155;  
     156; @keyword MAP 
     157; If set, the base will be mapped when the widget 
     158; is realized (the default). 
     159;  
     160; @keyword NONEXCLUSIVE 
     161; Buttons will be placed in an non-exclusive base. 
     162; The buttons will be independent. 
     163;  
     164; @keyword NO_RELEASE 
     165; If set, button release events will not be returned. 
     166;  
     167; @keyword RETURN_ID 
     168; If set, the VALUE field of returned events will be 
     169; the widget ID of the button. 
     170;  
     171; @keyword RETURN_INDEX 
     172; If set, the VALUE field of returned events will be 
     173; the zero-based index of the button within the base. 
     174; THIS IS THE DEFAULT. 
     175;  
     176; @keyword RETURN_NAME 
     177; If set, the VALUE field of returned events will be 
     178; the name of the button within the base. 
     179;  
     180; @keyword ROW 
     181; Buttons will be arranged in the number of rows 
     182; specified by this keyword. 
     183;  
     184; @keyword SCROLL 
     185; If set, the base will include scroll bars to allow 
     186; viewing a large base through a smaller viewport. 
     187;  
     188; @keyword SET_VALUE 
     189; The initial value of the buttons. This is equivalent 
     190; to the later statement: 
     191; 
     192; WIDGET_CONTROL, widget, set_value=value 
     193; 
     194; @keyword SPACE 
     195; The space, in pixels, to be left around the edges 
     196; of a row or column major base. This keyword is 
     197; ignored if EXCLUSIVE or NONEXCLUSIVE are specified. 
     198;  
     199; @keyword UVALUE 
     200; The user value to be associated with the widget. 
     201;  
     202; @keyword UNAME 
     203; The user name to be associated with the widget. 
     204;  
     205; @keyword XOFFSET 
     206; The X offset of the widget relative to its parent. 
     207;  
     208; @keyword XPAD 
     209; The horizontal space, in pixels, between children 
     210; of a row or column major base. Ignored if EXCLUSIVE 
     211; or NONEXCLUSIVE are specified. 
     212;  
     213; @keyword XSIZE 
     214; The width of the base. 
     215; @keyword X_SCROLL_SIZE 
     216; The width of the viewport if SCROLL is specified. 
     217;  
     218; @keyword YOFFSET 
     219; The Y offset of the widget relative to its parent. 
     220;  
     221; @keyword YPAD 
     222; The vertical space, in pixels, between children of 
     223; a row or column major base. Ignored if EXCLUSIVE 
     224; or NONEXCLUSIVE are specified. 
     225;  
     226; @keyword YSIZE 
     227; The height of the base. 
     228;  
     229; @keyword Y_SCROLL_SIZE 
     230; The height of the viewport if SCROLL is specified. 
     231; 
     232; @returns 
     233; The ID of the created widget is returned. 
     234; 
     235; @restrictions 
     236; This widget generates event structures with the following definition: 
     237; 
     238;       event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 } 
     239; 
     240; The SELECT field is passed through from the button event. VALUE is 
     241; either the INDEX, ID, NAME, or BUTTON_UVALUE of the button, 
     242; depending on how the widget was created. 
     243; 
     244; @restrictions 
     245; Only buttons with textual names are handled by this widget. 
     246; Bitmaps are not understood. 
     247; 
     248; @history 
     249; 15 June 1992, AB 
     250; 7 April 1993, AB, Removed state caching. 
     251; 6 Oct. 1994, KDB, Font keyword is not applied to the label. 
     252; 10 FEB 1995, DJC  fixed bad bug in event procedure, getting 
     253;                         id of stash widget. 
     254; 11 April 1995, AB Removed Motif special cases. 
     255; 
     256; Copyright (c) 1992-2005, Research Systems, Inc.  All rights reserved. 
     257;   Unauthorized reproduction prohibited. 
     258; 
     259; @version 
     260; $Id$ 
     261; 
     262;- 
    226263 
    227264 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro

    r146 r150  
    276276;---------------------------------------------------------------------- 
    277277;---------------------------------------------------------------------- 
     278;+ 
     279; @file_comments 
     280; 
     281; 
     282; @categories 
     283; 
     284;  
     285; @param PARENT {in}{required} 
     286; The widget ID of the parent widget. 
     287; 
     288; @param CALENDAR 
     289; 
     290; 
     291; @param JDATE0 
     292; 
     293;  
     294; @keyword CALTYPE 
     295;  
     296;  
     297; @keyword FAKECAL 
     298; 
     299;  
     300; @keyword UVALUE 
     301; 
     302;  
     303; @keyword UNAME 
     304; 
     305;  
     306; @keyword _EXTRA 
     307; Used to pass your keywords 
     308;  
     309; @returns 
     310;  
     311;  
     312; @uses 
     313;  
     314;  
     315; @restrictions 
     316;  
     317;  
     318; @examples 
     319;  
     320;  
     321; @history 
     322;  
     323;  
     324; @version  
     325; $Id$ 
     326; 
     327; @todo 
     328; seb 
     329;  
     330;- 
    278331FUNCTION cw_calendar, parent, calendar, jdate0, CALTYPE = CALTYPE, FAKECAL = fakecal, UVALUE = uvalue, UNAME = uname, _extra = ex 
    279332; 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME: cw_combobox_pm 
    6 ; 
    7 ; PURPOSE: widget equivalent a WIDGET_COMBOBOX sauf qu'en plus on 
    8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1. 
    9 ; 
    10 ; CATEGORY: compound widget (aide a l''ecriture des widgets) 
    11 ; 
    12 ; CALLING SEQUENCE: id=cw_combobox_pm(parent) 
    13 ;  
    14 ; INPUTS: 
    15 ;         Parent: The widget ID of the parent widget. 
    16 ; 
    17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_COMBOBOX 
    18 ; 
    19 ; OUTPUTS: 
    20 ;         The returned value of this function is the widget ID of the 
    21 ;         newly-created animation widget. 
    22 ; 
    23 ; COMMON BLOCKS: none 
    24 ; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ;     Widget Events Returned by Combobox Widgets 
    28 ; 
    29 ;   Pressing the mouse button while the mouse cursor is over an 
    30 ;   element of a combobox widget causes the widget to change the label 
    31 ;   on the combobox button and to generate an event. The appearance of 
    32 ;   any previously selected element is restored to normal at the same 
    33 ;   time. The event structure returned by the WIDGET_EVENT function is 
    34 ;   defined by the following statement: 
    35 ; 
    36 ;   { CW_COMBOBOX_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 
    37 ; 
    38 ;   The first three fields are the standard fields found in every 
    39 ;   widget event. 
    40 ;   INDEX returns the index of the selected item. This can be used to 
    41 ;   index the array of names originally used to set the widget''s 
    42 ;   value 
    43 ;   OUT:c''est un entier qui peut prendre 3 valeurs: 
    44 ;       1 : si on appuie sur + alors que l''index est deja aux max. rq: 
    45 ;       ds ce cas l''index reste au max 
    46 ;       -1: si on appuie sur - alors que l''index est deja aux min. rq: 
    47 ;       ds ce cas l''index reste au min 
    48 ;       0 : ds les autres cas! 
    49 ; 
    50 ;   Keywords to WIDGET_CONTROL 
    51 ; 
    52 ;   A number of keywords to the WIDGET_CONTROL procedure affect the 
    53 ;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
    54 ;       1) GET_VALUE 
    55 ;   widget_control,wid_id,get_value=resultat 
    56 ;   retourne ds la variable resultat une structure de 3 elements dont 
    57 ;   les noms sont inspires des mots cles que l''on peut passer a 
    58 ;   widget_control qd on utilise WIDGET_COMBOBOX: 
    59 ;            COMBOBOX_NUMBER: the number of elements currently 
    60 ;            contained in the specified combobox widget. 
    61 ;            COMBOBOX_SELECT: the zero-based number of the 
    62 ;            currently-selected element (i.e., the currently-displayed 
    63 ;            element) in the specified combobox widget. 
    64 ;            DYNAMIC_RESIZE: a True value (1) if the widget specified 
    65 ;            by Widget_ID is a button, combobox, or label widget that 
    66 ;            has had its DYNAMIC_RESIZE attribute set. Otherwise, 
    67 ;            False (0) is returned. 
    68 ;       2) SET_VALUE 
    69 ;   widget_control,wid_id,set_value=impose 
    70 ;   permet de modifier l''etat de la combobox comme on peut le faire 
    71 ;   pour WIDGET_COMBOBOX Impose peut etre: 
    72 ;       a) The contents of the list widget (string or string array) 
    73 ;       b) une structure qui peut avoir comme elements (de 1 a 3): 
    74 ;            DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 
    75 ;            or deactivate (if set to 0) dynamic resizing of the 
    76 ;            specified CW_COMBOBOX_PM widget (see the documentation 
    77 ;            for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX 
    78 ;            procedure for more information about dynamic widget 
    79 ;            resizing). 
    80 ;            COMBOBOX_SELECT:Set this keyword to return the zero-based 
    81 ;            number of the currently-selected element (i.e., the 
    82 ;            currently-displayed element) in the specified combobox 
    83 ;            widget. 
    84 ;            VALUE: The contents of the list widget (string or string 
    85 ;            array) 
    86 ; 
    87 ; RESTRICTIONS: 
    88 ; 
    89 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la 
    90 ; procedure associee, testwid_event. 
    91 ; 
    92 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    93 ;                      6/9/1999 
    94 ; 
    95 ;- 
    96 ;------------------------------------------------------------ 
    97 ;------------------------------------------------------------ 
    98 ;------------------------------------------------------------ 
    991; testwid, value=strtrim(indgen(10),2) 
    1002; PRO testwid_event, event 
     
    212114                  , INDEX:index, STR:cmbbtxt, OUT:out} 
    213115end 
    214 ;---------------------------------------------------------------------- 
     116;------------------------------------------------------------ 
     117;------------------------------------------------------------ 
     118;------------------------------------------------------------ 
     119;+ 
     120; 
     121; @file_comments 
     122; Like WIDGET_COMBOBOX but here, their are 2 buttons + and - to move the widget from +/- 1 
     123; 
     124; @categories 
     125; compound widget 
     126;  
     127; @param PARENT {in}{required} 
     128; The widget ID of the parent widget. 
     129; 
     130; @keyword COLUMN 
     131; Buttons will be arranged in the number of columns 
     132; specified by this keyword. 
     133;  
     134; @keyword ROW 
     135; Buttons will be arranged in the number of rows 
     136; specified by this keyword. 
     137;  
     138; @keyword UVALUE 
     139; The user value to be associated with the widget. 
     140;  
     141; @keyword UNAME 
     142; The user name to be associated with the widget. 
     143;  
     144; @keyword VALUE 
     145; 
     146; 
     147; @keyword _EXTRA 
     148; Used to pass your keywords 
     149; 
     150; @returns 
     151; The returned value of this function is the widget ID of the 
     152; newly-created animation widget. 
     153; 
     154; @restrictions 
     155; 
     156;     Widget Events Returned by Combobox Widgets 
     157; 
     158;   Pressing the mouse button while the mouse cursor is over an 
     159;   element of a combobox widget causes the widget to change the label 
     160;   on the combobox button and to generate an event. The appearance of 
     161;   any previously selected element is restored to normal at the same 
     162;   time. The event structure returned by the WIDGET_EVENT function is 
     163;   defined by the following statement: 
     164; 
     165;   { CW_COMBOBOX_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 
     166; 
     167;   The first three fields are the standard fields found in every 
     168;   widget event. 
     169;   INDEX returns the index of the selected item. This can be used to 
     170;   index the array of names originally used to set the widget''s 
     171;   value 
     172;   OUT:It is an integer which can take 3 values:  
     173;       1 : If we press + when the index is already at the max 
     174;       Comment: In this case, the index stay at the max 
     175;       -1: If we press - when the index is already at the min 
     176;       Comment: In this case, the index stay at the min 
     177;       0 : In other cases 
     178; 
     179;   Keywords to WIDGET_CONTROL 
     180; 
     181;   A number of keywords to the WIDGET_CONTROL procedure affect the 
     182;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
     183;       1) GET_VALUE 
     184;   widget_control,wid_id,get_value=resultat 
     185;   Send back, in the result variable, a structure of 3 elements whose  
     186;   names are inspired by keywords we can pass at widget_control when 
     187;   we use WIDGET_COMBOBOX: 
     188;            COMBOBOX_NUMBER: the number of elements currently 
     189;            contained in the specified combobox widget. 
     190;            COMBOBOX_SELECT: the zero-based number of the 
     191;            currently-selected element (i.e., the currently-displayed 
     192;            element) in the specified combobox widget. 
     193;            DYNAMIC_RESIZE: a True value (1) if the widget specified 
     194;            by Widget_ID is a button, combobox, or label widget that 
     195;            has had its DYNAMIC_RESIZE attribute set. Otherwise, 
     196;            False (0) is returned. 
     197;       2) SET_VALUE 
     198;   widget_control,wid_id,set_value=impose 
     199;   Allows to modify the state of the combobox like we can do it for  
     200;   WIDGET_COMBOBOX. May impose:  
     201;       a) The contents of the list widget (string or string array) 
     202;       b) A structure which can have for elements (from 1 to 3):  
     203;            DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 
     204;            or deactivate (if set to 0) dynamic resizing of the 
     205;            specified CW_COMBOBOX_PM widget (see the documentation 
     206;            for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX 
     207;            procedure for more information about dynamic widget 
     208;            resizing). 
     209;            COMBOBOX_SELECT:Set this keyword to return the zero-based 
     210;            number of the currently-selected element (i.e., the 
     211;            currently-displayed element) in the specified combobox 
     212;            widget. 
     213;            VALUE: The contents of the list widget (string or string 
     214;            array) 
     215; 
     216; @examples 
     217; See the program provided above (testwid and the associated procedure, testwid_event). 
     218; 
     219; @history 
     220; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     221;                      6/9/1999 
     222; 
     223; @version 
     224; $Id$ 
     225; 
     226;- 
     227;------------------------------------------------------------ 
     228;------------------------------------------------------------ 
     229;------------------------------------------------------------ 
    215230FUNCTION cw_combobox_pm, parent, VALUE = value, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex 
    216231; 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro

    r134 r150  
    5353   change = changegrid(currentgrid) 
    5454;------------------------------------------------ 
    55 ; quel est le type de boxzoom? 
     55; What is the type of boxzoom ? 
    5656   currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 
    5757   options = extractatt(top_uvalue, 'options')    
     
    6363    ytype = 'geographic' ELSE ytype = 'index' 
    6464;------------------------------------------------ 
    65 ; comment completer la boxzoom? 
     65; How to complete the boxzoom ? 
    6666   IF xtype EQ  'geographic' then begin 
    6767      lonn1 = lon1 
     
    114114   strict = uvalue.strict 
    115115; 
    116 ; les longitudes 
    117 ; 
    118 ; min et max possible 
     116; Longitudes 
     117; 
     118; Possible min and max 
    119119   if xtype EQ 'geographic' then BEGIN 
    120120      min = floor(min([glamt,glamf], max = max)) 
     
    124124      max = jpi-1 
    125125   ENDELSE 
    126 ; les id des widgets 
     126; widgets's id 
    127127   lon1id = widget_info(id,find_by_uname = 'lon1') 
    128128   lon2id = widget_info(id,find_by_uname = 'lon2') 
    129 ; doit-on changer de type d''axe x: longitude/index 
     129; Do we have to change the type of x axis: longitude/index 
    130130   lonbase = widget_info(id,find_by_uname = 'lonbase') 
    131131   widget_control, lonbase,  get_uvalue = lonbase_uvalue 
    132132   if lonbase_uvalue.name NE xtype then BEGIN 
    133133      widget_control, lonbase, update = 0 
    134 ; on casse tout 
     134; We break everything 
    135135      widget_control, lon1id, /destroy 
    136136      widget_control, lon2id, /destroy 
    137 ; on reconstruit 
     137; We reconstruct 
    138138      lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 
    139139                            , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $ 
     
    147147      widget_control, lonbase, update = 1 
    148148   ENDIF ELSE BEGIN 
    149 ; la nouvelle valeur qu''ils vont avoir 
     149; The new value  they will have 
    150150      cursorvalue1 = min > boxzoom[0] < ((boxzoom[1] < max)-strict) 
    151151      cursorvalue2 = ((min > boxzoom[0])+strict) > boxzoom[1] < max 
    152 ; on change les bornes des slider 
     152; We change slider's boundaries 
    153153      widget_control, lon1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict} 
    154154      widget_control, lon2id, set_value = {slider_min:cursorvalue1+strict, slider_max:max} 
    155 ; on attribut la nouvelle valeur 
     155; We attribute the new value 
    156156      widget_control, lon1id , set_value = cursorvalue1 
    157157      widget_control, lon2id, set_value = cursorvalue2 
    158158   ENDELSE 
    159159; 
    160 ; les latitudes 
    161 ; 
    162 ; min et max possible 
     160; Latitudes 
     161; 
     162; Possible min and max 
    163163   if ytype EQ 'geographic' then begin 
    164164      min = floor(min([gphit,gphif], max = max)) 
     
    168168      max = jpj-1 
    169169   ENDELSE 
    170 ; doit-on changer de type d''axe y: latitude/index 
     170; Do we have to change the type of y axis: latitude/index 
    171171   latbase = widget_info(id,find_by_uname = 'latbase') 
    172172   widget_control, latbase,  get_uvalue = latbase_uvalue 
     
    219219      widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} 
    220220   ENDIF ELSE gdep2 = gdep1+1 
    221 ; on s''assure que les profs donnees contiennent bien au moins un 
    222 ; niveau. 
     221; We make sure that given depthes contain at least one level. 
    223222   if boxzoom[4] GT boxzoom[5] then begin 
    224223      rien = boxzoom[4] 
     
    240239      boxzoom[5] = boxzoom[4]+1 
    241240   endif 
    242 ; maintenant que les values et les indexes sont definis proprement, 
    243 ; on peut les appliquer 
     241; Now, values and indexes are proprely defined. 
     242; So we can apply them 
    244243   widget_control, dthlv1id, set_value = {combobox_select:indice1} 
    245244   widget_control, dthlv2id, set_value = {combobox_select:indice2} 
    246 ; controler les min et les max des sliders... 
     245; control mins and maxs of sliders... 
    247246   if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 
    248247   max1 = (min1+1) > gdep1[indice2] 
     
    313312         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    314313         dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 
    315 ; faut-il changer dthlv2 ? 
     314; Do we have to change dthlv2 ? 
    316315         widget_control, event.id, get_value = dthlv1_value 
    317316         gdep1 = fix(dthlv1_value.combobox_value) 
     
    319318         gdep2 = fix(dthlv2_value.combobox_value) 
    320319         if dthlv2_value.combobox_index LT event.index then BEGIN 
    321 ; on redefinie la valeur de dthlv2id 
     320; We redefine the dthlv2id's value 
    322321            widget_control, dthlv2id, set_value = {combobox_select:event.index} 
    323 ; donc on redefinit la valeur et le max du slider 2 
     322; So we redefine the value and the max of the slider 2 
    324323            if event.index EQ jpk-1 then BEGIN  
    325324               max = max([gdept, gdepw]) 
     
    329328            widget_control, depth2id $ 
    330329             , set_value = {slider_max:max, value:gdep2[event.index]} 
    331 ; du coup on redefinie donc le max du slider 1  
     330; So we redefine the max of the slider 1 
    332331            widget_control, depth1id, set_value = {slider_max:gdep1[event.index]} 
    333332         END  
    334 ; on redefinie la valeur et le min du slider depth 1 
     333; We redefine the value and the min of the slider depth1  
    335334         if event.index EQ 0 then min = 0 ELSE min = gdep1[event.index-1]+1 
    336335         widget_control, depth1id, set_value = {slider_min:min, value:gdep1[event.index]} 
    337 ; du coup on change aussi la valeur du min du slider depth 2 
     336; S we change the value of the min of the slider depth 2 
    338337         widget_control, depth2id, set_value = {slider_min:gdep1[event.index]+1} 
    339338      END 
     
    343342         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    344343         dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 
    345 ; faut-il changer dthlv1 ? 
     344; Do we have to change dthlv1 ? 
    346345         widget_control, dthlv1id, get_value = dthlv1_value 
    347346         gdep1 = fix(dthlv1_value.combobox_value) 
     
    349348         gdep2 = fix(dthlv2_value.combobox_value) 
    350349         if dthlv1_value.combobox_index GT event.index then BEGIN 
    351 ; on redefinie la valeur de dthlv1id 
     350; We redfine the value of dthlv1id 
    352351            widget_control, dthlv1id, set_value = {combobox_select:event.index} 
    353 ; donc on redefinit la valeur et le min du slider 1 
     352; So we redefine the value and the min of the slider 1 
    354353            if event.index EQ 0 then min = 0 ELSE min = gdep2[event.index-1] 
    355354            widget_control, depth1id $ 
    356355             , set_value = {slider_min:min, value:gdep1[event.index]} 
    357 ; du coup on redefinie donc le min du slider 2 
     356; Se we redefine the min of the slider 2 
    358357            widget_control, depth2id, set_value = {slider_min:gdep2[event.index]} 
    359358         END  
    360 ; on redefinie la valeur et le max du slider depth 2 
     359; We redefine the value and the max of the slider depth 2 
    361360         if event.index EQ jpk-1 then BEGIN  
    362361            max = max([gdept, gdepw]) 
     
    365364         ENDIF ELSE max = gdep2[event.index+1]-1 
    366365         widget_control, depth2id, set_value = {slider_max:max, value:gdep2[event.index]} 
    367 ; du coup on change aussi la valeur du max du slider depth 1 
     366; So we change the value of the max of the slider depth 1 
    368367         widget_control, depth1id, set_value = {slider_max:gdep2[event.index]-1} 
    369368      END 
     
    372371         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    373372         dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 
    374 ; doit-on changer dthlv1 ? 
     373; Do we have to change dthlv1 ? 
    375374         widget_control, dthlv1id, get_value = dthlv1_value 
    376375         gdep1 = fix(dthlv1_value.combobox_value) 
     
    378377         indice = indice < (jpk-1) 
    379378         if indice NE dthlv1_value.combobox_index then begin 
    380 ; on change le min de depth2 
     379; We change the min of depth2 
    381380            widget_control, depth2id, set_value = {slider_min:gdep1[indice]+1} 
    382 ; on redefinie la valeur de dthlv1id 
     381; We redefine the value of dthlv1id 
    383382            widget_control, dthlv1id, set_value = {combobox_select:indice} 
    384 ; donc on redefinit le min du slider 1 
     383; So we redefine the min of the slider 1 
    385384            if indice EQ 0 then min = 0 ELSE min = gdep1[indice-1]+1 
    386385            widget_control, event.id, set_value = {slider_min:min} 
     
    391390         depth1id = widget_info(event.handler,find_by_uname = 'depth1') 
    392391         dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 
    393 ; doit-on changer dthlv2 ? 
     392; Do we have to change dthlv2 ? 
    394393         widget_control, dthlv2id, get_value = dthlv2_value 
    395394         gdep2 = fix(dthlv2_value.combobox_value) 
     
    397396         indice = 0 > (indice-1) 
    398397         if indice NE dthlv2_value.combobox_index then begin 
    399 ; on change le max de depth1 
     398; We change the min of depth1 
    400399            widget_control, depth1id, set_value = {slider_max:gdep2[indice]-1} 
    401 ; on redefinie la valeur de dthlv2id 
     400; We redefine the value of dthlv2id 
    402401            widget_control, dthlv2id, set_value = {combobox_select:indice} 
    403 ; donc on redefinit le max du slider 2 
     402; So we redefine the min of the slider 2 
    404403            if indice EQ jpk-1 then BEGIN  
    405404               max = max([gdept, gdepw]) 
     
    418417end 
    419418;********************************************************************* 
     419;+ 
     420; @file_comments 
     421; 
     422; 
     423; @categories 
     424; 
     425;  
     426; @param PARENT {in}{required} 
     427; The widget ID of the parent widget. 
     428;  
     429; @keyword UVALUE 
     430; The user value to be associated with the widget. 
     431;  
     432; @keyword UNAME 
     433; The user name to be associated with the widget. 
     434;  
     435; @keyword STRICT 
     436; 
     437; 
     438; @keyword UNZOOM 
     439; 
     440; 
     441; @keyword BOXZOOM 
     442; Vector indicating the geographic zone on which we want to cut the map.  
     443; If BOXZOOM has :  
     444;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     445;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     446;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     447;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     448;   6 elements: The extraction is made on Boxzoom  
     449; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     450; 
     451; @keyword _EXTRA 
     452; Used to pass your keywords 
     453;  
     454; @returns 
     455;  
     456;  
     457; @uses 
     458;  
     459;  
     460; @restrictions 
     461;  
     462;  
     463; @examples 
     464;  
     465;  
     466; @history 
     467;  
     468;  
     469; @version  
     470; $Id$ 
     471; 
     472; @todo 
     473; seb: Documenter 
     474;  
     475;- 
    420476FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, _extra = ex 
    421477; 
     
    426482@cm_4data 
    427483; 
    428 ; def de la boxzoom 
     484; Definition of the boxzoom 
    429485  Case N_Elements(Boxzoom) OF 
    430486    0:boxzoom = [lon1, lon2, lat1, lat2 $ 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME: cw_droplist_pm 
    6 ; 
    7 ; PURPOSE: widget equivalent a WIDGET_DROPLIST sauf qu'en plus on 
    8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1. 
    9 ; 
    10 ; CATEGORY: compound widget (aide a l''ecriture des widgets) 
    11 ; 
    12 ; CALLING SEQUENCE: id=cw_droplist_pm(parent) 
    13 ;  
    14 ; INPUTS: 
    15 ;         Parent: The widget ID of the parent widget. 
    16 ; 
    17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_DROPLIST 
    18 ; 
    19 ; OUTPUTS: 
    20 ;         The returned value of this function is the widget ID of the 
    21 ;         newly-created animation widget. 
    22 ; 
    23 ; COMMON BLOCKS: none 
    24 ; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ;     Widget Events Returned by Droplist Widgets 
    28 ; 
    29 ;   Pressing the mouse button while the mouse cursor is over an 
    30 ;   element of a droplist widget causes the widget to change the label 
    31 ;   on the droplist button and to generate an event. The appearance of 
    32 ;   any previously selected element is restored to normal at the same 
    33 ;   time. The event structure returned by the WIDGET_EVENT function is 
    34 ;   defined by the following statement: 
    35 ; 
    36 ;   { CW_DROPLIST_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 
    37 ; 
    38 ;   The first three fields are the standard fields found in every 
    39 ;   widget event. 
    40 ;   INDEX returns the index of the selected item. This can be used to 
    41 ;   index the array of names originally used to set the widget''s 
    42 ;   value 
    43 ;   OUT:c''est un entier qui peut prendre 3 valeurs: 
    44 ;       1 : si on appuie sur + alors que l''index est deja aux max. rq: 
    45 ;       ds ce cas l''index reste au max 
    46 ;       -1: si on appuie sur - alors que l''index est deja aux min. rq: 
    47 ;       ds ce cas l''index reste au min 
    48 ;       0 : ds les autres cas! 
    49 ; 
    50 ;   Keywords to WIDGET_CONTROL 
    51 ; 
    52 ;   A number of keywords to the WIDGET_CONTROL procedure affect the 
    53 ;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
    54 ;       1) GET_VALUE 
    55 ;   widget_control,wid_id,get_value=resultat 
    56 ;   retourne ds la variable resultat une structure de 3 elements dont 
    57 ;   les noms sont inspires des mots cles que l''on peut passer a 
    58 ;   widget_control qd on utilise WIDGET_DROPLIST: 
    59 ;            DROPLIST_NUMBER: the number of elements currently 
    60 ;            contained in the specified droplist widget. 
    61 ;            DROPLIST_SELECT: the zero-based number of the 
    62 ;            currently-selected element (i.e., the currently-displayed 
    63 ;            element) in the specified droplist widget. 
    64 ;            DYNAMIC_RESIZE: a True value (1) if the widget specified 
    65 ;            by Widget_ID is a button, droplist, or label widget that 
    66 ;            has had its DYNAMIC_RESIZE attribute set. Otherwise, 
    67 ;            False (0) is returned. 
    68 ;       2) SET_VALUE 
    69 ;   widget_control,wid_id,set_value=impose 
    70 ;   permet de modifier l''etat de la droplist comme on peut le faire 
    71 ;   pour WIDGET_DROPLIST Impose peut etre: 
    72 ;       a) The contents of the list widget (string or string array) 
    73 ;       b) une structure qui peut avoir comme elements (de 1 a 3): 
    74 ;            DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 
    75 ;            or deactivate (if set to 0) dynamic resizing of the 
    76 ;            specified CW_DROPLIST_PM widget (see the documentation 
    77 ;            for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST 
    78 ;            procedure for more information about dynamic widget 
    79 ;            resizing). 
    80 ;            DROPLIST_SELECT:Set this keyword to return the zero-based 
    81 ;            number of the currently-selected element (i.e., the 
    82 ;            currently-displayed element) in the specified droplist 
    83 ;            widget. 
    84 ;            VALUE: The contents of the list widget (string or string 
    85 ;            array) 
    86 ; 
    87 ; RESTRICTIONS: 
    88 ; 
    89 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la 
    90 ; procedure associee, testwid_event. 
    91 ; 
    92 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    93 ;                      6/9/1999 
    94 ; 
    95 ;- 
    96 ;------------------------------------------------------------ 
    97 ;------------------------------------------------------------ 
    98 ;------------------------------------------------------------ 
    991; PRO testwid_event, event 
    1002; ;   help, event, /STRUCT 
     
    199101end 
    200102;---------------------------------------------------------------------- 
     103;------------------------------------------------------------ 
     104;------------------------------------------------------------ 
     105;------------------------------------------------------------ 
     106;+ 
     107; 
     108; @file_comments 
     109; Like WIDGET_DROPLIST but here, their are 2 buttons + and - to move the widget from +/- 1 
     110; 
     111; @categories 
     112; compound widget 
     113;  
     114; @param PARENT {in}{required} 
     115; The widget ID of the parent widget. 
     116; 
     117; @keyword COLUMN 
     118; Buttons will be arranged in the number of columns 
     119; specified by this keyword. 
     120;  
     121; @keyword ROW 
     122; Buttons will be arranged in the number of rows 
     123; specified by this keyword. 
     124;  
     125; @keyword UVALUE 
     126; The user value to be associated with the widget. 
     127;  
     128; @keyword UNAME 
     129; The user name to be associated with the widget. 
     130;  
     131; @keyword _EXTRA 
     132; Used to pass your keywords 
     133; 
     134; @returns 
     135; The returned value of this function is the widget ID of the 
     136; newly-created animation widget. 
     137; 
     138; @restrictions 
     139; 
     140;     Widget Events Returned by Droplist Widgets 
     141; 
     142;   Pressing the mouse button while the mouse cursor is over an 
     143;   element of a droplist widget causes the widget to change the label 
     144;   on the droplist button and to generate an event. The appearance of 
     145;   any previously selected element is restored to normal at the same 
     146;   time. The event structure returned by the WIDGET_EVENT function is 
     147;   defined by the following statement: 
     148; 
     149;   { CW_DROPLIST_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 } 
     150; 
     151;   The first three fields are the standard fields found in every 
     152;   widget event. 
     153;   INDEX returns the index of the selected item. This can be used to 
     154;   index the array of names originally used to set the widget''s 
     155;   value 
     156;   OUT:It is an integer which can take 3 values:  
     157;       1 : If we press + when the index is already at the max 
     158;       Comment: In this case, the index stay at the max 
     159;       -1: If we press - when the index is already at the min 
     160;       Comment: In this case, the index stay at the min 
     161;       0 : In other cases 
     162; 
     163;   Keywords to WIDGET_CONTROL 
     164; 
     165;   A number of keywords to the WIDGET_CONTROL procedure affect the 
     166;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
     167;       1) GET_VALUE 
     168;   widget_control,wid_id,get_value=resultat 
     169;   Send back, in the result variable, a structure of 3 elements whose  
     170;   names are inspired by keywords we can pass at widget_control when 
     171;   we use WIDGET_COMBOBOX: 
     172;            DROPLIST_NUMBER: the number of elements currently 
     173;            contained in the specified droplist widget. 
     174;            DROPLIST_SELECT: the zero-based number of the 
     175;            currently-selected element (i.e., the currently-displayed 
     176;            element) in the specified droplist widget. 
     177;            DYNAMIC_RESIZE: a True value (1) if the widget specified 
     178;            by Widget_ID is a button, droplist, or label widget that 
     179;            has had its DYNAMIC_RESIZE attribute set. Otherwise, 
     180;            False (0) is returned. 
     181;       2) SET_VALUE 
     182;   widget_control,wid_id,set_value=impose 
     183;   permet de modifier l''etat de la droplist comme on peut le faire 
     184;   pour WIDGET_DROPLIST Impose peut etre: 
     185;       a) The contents of the list widget (string or string array) 
     186;       b) A structure which can have for elements (from 1 to 3):  
     187;            DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 
     188;            or deactivate (if set to 0) dynamic resizing of the 
     189;            specified CW_DROPLIST_PM widget (see the documentation 
     190;            for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST 
     191;            procedure for more information about dynamic widget 
     192;            resizing). 
     193;            DROPLIST_SELECT:Set this keyword to return the zero-based 
     194;            number of the currently-selected element (i.e., the 
     195;            currently-displayed element) in the specified droplist 
     196;            widget. 
     197;            VALUE: The contents of the list widget (string or string 
     198;            array) 
     199; 
     200; @examples 
     201; See the program provided above (testwid and the associated procedure, testwid_event). 
     202; 
     203; @history 
     204; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     205;                      6/9/1999 
     206; 
     207; @version 
     208; $Id$ 
     209; 
     210;- 
     211;------------------------------------------------------------ 
     212;------------------------------------------------------------ 
     213;------------------------------------------------------------ 
    201214FUNCTION cw_droplist_pm, parent,UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex 
    202215; 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.pro

    r134 r150  
    1818; 
    1919@common 
    20 ; si on ne change pas le nombre de colonnes, on sort 
     20; If we do not change the number of columns, we send 
    2121      if uval.name EQ 'column' then $ 
    2222       if event.index+1 EQ smallin[0] THEN $ 
    2323       return,{ID:event.handler, TOP:event.top, HANDLER:0L} 
    24 ; si on ne change pas le nombre de lignes, on sort 
     24; If we do not change the number of lines, we send 
    2525      if uval.name EQ 'row' then $ 
    2626       if event.index+1 EQ smallin[1] THEN $ 
    2727       return,{ID:event.handler, TOP:event.top, HANDLER:0L} 
    2828; 
    29 ; on efface la page 
     29; We erase the page 
    3030;      graphid = widget_info(event.top,find_by_uname = 'graph') 
    3131      graphid = extractatt(top_uvalue, 'graphid') 
     
    4646      nbredessin = smallin[0]*smallin[1] 
    4747;          
    48 ; on remet tout a 0 en ce qui concerne les postscripts 
     48; We put all back to 0 for postscripts 
    4949      createhistory, event.top, smallin 
    5050;          
     
    7979end 
    8080;********************************************************************* 
     81;+ 
     82; @file_comments 
     83; 
     84; 
     85; @categories 
     86; 
     87;  
     88; @param PARENT {in}{required} 
     89; The widget ID of the parent widget. 
     90; 
     91; @param SMALL  
     92; 
     93; 
     94; @keyword COLUMN 
     95; Buttons will be arranged in the number of columns 
     96; specified by this keyword. 
     97;  
     98; @keyword ROW 
     99; Buttons will be arranged in the number of rows 
     100; specified by this keyword. 
     101;  
     102; @keyword UVALUE 
     103; The user value to be associated with the widget. 
     104;  
     105; @keyword UNAME 
     106; The user name to be associated with the widget. 
     107; 
     108; @keyword _EXTRA 
     109; Used to pass your keywords 
     110; 
     111;  
     112;  
     113; @returns 
     114;  
     115;  
     116; @uses 
     117;  
     118;  
     119; @restrictions 
     120;  
     121;  
     122; @examples 
     123;  
     124;  
     125; @history 
     126;  
     127;  
     128; @version 
     129; $Id$  
     130;  
     131; @todo  
     132; seb: documenter 
     133;  
     134;- 
    81135FUNCTION cw_pagelayout, parent, small, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, COLUMN = column, ROW = row, _extra = ex 
    82136;------------------------------------------------ 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro

    r134 r150  
    109109end 
    110110;-------------------------------------------------------------------------------- 
     111;+ 
     112; @file_comments 
     113; 
     114; 
     115; @categories 
     116; 
     117; @param PARENT {in}{required} 
     118; The widget ID of the parent widget. 
     119; 
     120; @keyword BOXZOOM 
     121; Vector indicating the geographic zone on which we want to cut the map.  
     122; If BOXZOOM has :  
     123;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     124;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     125;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     126;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     127;   6 elements: The extraction is made on Boxzoom  
     128; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     129; 
     130; @keyword COLUMN 
     131; Buttons will be arranged in the number of columns 
     132; specified by this keyword. 
     133;  
     134; @keyword FRAME 
     135; Specifies the width of the frame to be drawn around the base. 
     136;  
     137; @keyword ROW 
     138; Buttons will be arranged in the number of rows 
     139; specified by this keyword. 
     140;  
     141; @keyword UVALUE 
     142; The user value to be associated with the widget. 
     143;  
     144; @keyword UNAME 
     145; The user name to be associated with the widget. 
     146;  
     147; @keyword _EXTRA 
     148; Used to pass your keywords 
     149;  
     150; @returns 
     151;  
     152;  
     153; @uses 
     154;  
     155;  
     156; @restrictions 
     157;  
     158;  
     159; @examples 
     160;  
     161;  
     162; @history 
     163;  
     164;  
     165; @version  
     166; $Id$ 
     167;  
     168; @todo 
     169; seb: documenter 
     170; 
     171;- 
    111172FUNCTION cw_slide_slice, parent, boxzoom = boxzoom, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _extra = ex 
    112173; 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME: cw_slider_pm 
    6 ; 
    7 ; PURPOSE: widget equivalent a WIDGET_SLIDER sauf qu'en plus on 
    8 ; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1. 
    9 ; 
    10 ; CATEGORY: compound widget (aide a l''ecriture des widgets) 
    11 ; 
    12 ; CALLING SEQUENCE: id=cw_slider_pm(parent) 
    13 ;  
    14 ; INPUTS: 
    15 ;         Parent: The widget ID of the parent widget. 
    16 ; 
    17 ; KEYWORD PARAMETERS:tous ceux de WIDGET_SLIDER 
    18 ; 
    19 ; OUTPUTS: 
    20 ;         The returned value of this function is the widget ID of the 
    21 ;         newly-created animation widget. 
    22 ; 
    23 ; COMMON BLOCKS: none 
    24 ; 
    25 ; SIDE EFFECTS:  
    26 ; 
    27 ;  Widget Events Returned by the CW_SLIDER_PM Widget 
    28 ; 
    29 ;  Slider widgets generate events when the mouse is used to change 
    30 ;  their value. The event structure returned by the WIDGET_EVENT 
    31 ;  function is defined by the following statement: 
    32 ; 
    33 ;  {CW_SLIDER_PM, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0, OUT:0} 
    34 ; 
    35 ;  ID is the widget ID of the button generating the event. TOP is the 
    36 ;  widget ID of the top level widget containing ID. 
    37 ;  HANDLER contains the widget ID of the widget associated with the 
    38 ;  handler routine. 
    39 ;  VALUE returns the new value of the slider. 
    40 ;  DRAG returns integer 1 if the slider event was generated as part of 
    41 ;  a drag operation, or zero if the event was generated when the user 
    42 ;  had finished positioning the slider. Note that the slider widget 
    43 ;  only generates events during the drag operation if the DRAG keyword 
    44 ;  is set, and if the application is running under Motif. When the 
    45 ;  DRAG keyword is set, the DRAG field can be used to avoid 
    46 ;  computationally expensive operations until the user releases the 
    47 ;  slider. 
    48 ;  OUT:c''est un entier qui peut prendre 3 valeurs: 
    49 ;      1 : si on appuie sur + alors que le slider est deja aux max. rq: 
    50 ;      ds ce cas le slider reste au max 
    51 ;      -1: si on appuie sur - alors que le slider est deja aux min. rq: 
    52 ;      ds ce cas le slider reste au min 
    53 ;      0 : ds les autres cas! 
    54 ; 
    55 ;   Keywords to WIDGET_CONTROL 
    56 ; 
    57 ;   A number of keywords to the WIDGET_CONTROL procedure affect the 
    58 ;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
    59 ;       1) GET_VALUE 
    60 ;   widget_control,wid_id,get_value=resultat 
    61 ;   retourne ds la variable resultat une structure de 2 elements dont 
    62 ;   les noms sont inspires des mots cles que l''on peut passer a 
    63 ;   widget_control qd on utilise WIDGET_SLIDER: 
    64 ;            VALUE:the value setting of the widget 
    65 ;            SLIDER_MIN_MAX: a 2 elements array: The minimum and the 
    66 ;            maximum value of the range encompassed by the slider 
    67 ;       2) SET_VALUE 
    68 ;   widget_control,wid_id,set_value=impose 
    69 ;   permet de modifier l''etat de la slider bar comme on peut le faire 
    70 ;   pour WIDGET_SLIDER. Impose peut etre: 
    71 ;       a) un entier: donne la nouvelle  position of the slider. 
    72 ;       b) une structure qui peut avoir comme elements (de 1 a 3): 
    73 ;            VALUE:un entier qui donne la nouvelle  position of the slider. 
    74 ;            SLIDER_MIN:Set to a new minimum value for the specified 
    75 ;            slider widget. 
    76 ;            SLIDER_MAX:Set to a new minimum value for the specified 
    77 ;            slider widget. 
    78 ; 
    79 ; RESTRICTIONS: 
    80 ; 
    81 ; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la 
    82 ; procedure associee, testwid_event. 
    83 ; 
    84 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    85 ;                      5/9/1999 
    86 ;- 
    87 ;------------------------------------------------------------ 
    88 ;------------------------------------------------------------ 
    89 ;------------------------------------------------------------ 
    901; PRO testwid_event, event 
    912; ;   help, event, /STRUCT 
     
    249160end 
    250161;---------------------------------------------------------------------- 
     162;------------------------------------------------------------ 
     163;------------------------------------------------------------ 
     164;------------------------------------------------------------ 
     165;+ 
     166; 
     167; @file_comments 
     168; Like WIDGET_SLIDER but here, their are 2 buttons + and - to move the widget from +/- 1 
     169; 
     170; @categories 
     171; compound widget 
     172;  
     173; @param PARENT {in}{required} 
     174; The widget ID of the parent widget. 
     175; 
     176; @keyword UVALUE 
     177; The user value to be associated with the widget. 
     178;  
     179; @keyword UNAME 
     180; The user name to be associated with the widget. 
     181;  
     182; @keyword VALUE 
     183; 
     184; 
     185; @keyword MAXIMUM 
     186;  
     187;  
     188; @keyword MINIMUM 
     189; 
     190;  
     191; @keyword STRMINLEN 
     192; 
     193; 
     194; @keyword _EXTRA 
     195; Used to pass your keywords 
     196; 
     197; @returns 
     198; The returned value of this function is the widget ID of the 
     199; newly-created animation widget. 
     200; 
     201; @restrictions 
     202; 
     203;  Widget Events Returned by the CW_SLIDER_PM Widget 
     204; 
     205;  Slider widgets generate events when the mouse is used to change 
     206;  their value. The event structure returned by the WIDGET_EVENT 
     207;  function is defined by the following statement: 
     208; 
     209;  {CW_SLIDER_PM, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0, OUT:0} 
     210; 
     211;  ID is the widget ID of the button generating the event. TOP is the 
     212;  widget ID of the top level widget containing ID. 
     213;  HANDLER contains the widget ID of the widget associated with the 
     214;  handler routine. 
     215;  VALUE returns the new value of the slider. 
     216;  DRAG returns integer 1 if the slider event was generated as part of 
     217;  a drag operation, or zero if the event was generated when the user 
     218;  had finished positioning the slider. Note that the slider widget 
     219;  only generates events during the drag operation if the DRAG keyword 
     220;  is set, and if the application is running under Motif. When the 
     221;  DRAG keyword is set, the DRAG field can be used to avoid 
     222;  computationally expensive operations until the user releases the 
     223;  slider. 
     224;  OUT:It is an integer which can take 3 values:  
     225;       1 : If we press + when the index is already at the max 
     226;       Comment: In this case, the index stay at the max 
     227;       -1: If we press - when the index is already at the min 
     228;       Comment: In this case, the index stay at the min 
     229;       0 : In other cases 
     230; 
     231;   Keywords to WIDGET_CONTROL 
     232; 
     233;   A number of keywords to the WIDGET_CONTROL procedure affect the 
     234;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE. 
     235;       1) GET_VALUE 
     236;   widget_control,wid_id,get_value=resultat 
     237;   retourne ds la variable resultat une structure de 2 elements dont 
     238;   les noms sont inspires des mots cles que l''on peut passer a 
     239;   widget_control qd on utilise WIDGET_SLIDER: 
     240;            VALUE:the value setting of the widget 
     241;            SLIDER_MIN_MAX: a 2 elements array: The minimum and the 
     242;            maximum value of the range encompassed by the slider 
     243;       2) SET_VALUE 
     244;   widget_control,wid_id,set_value=impose 
     245;   Allows to modify the state of the combobox like we can do it for  
     246;   WIDGET_COMBOBOX. May impose:  
     247;       a) un entier: donne la nouvelle  position of the slider. 
     248;       b) A structure which can have for elements (from 1 to 3):  
     249;            VALUE: an integer which give the new position of the slider 
     250;            SLIDER_MIN:Set to a new minimum value for the specified 
     251;            slider widget. 
     252;            SLIDER_MAX:Set to a new minimum value for the specified 
     253;            slider widget. 
     254; 
     255; 
     256; @examples 
     257; See the program provided above (testwid and the associated procedure, testwid_event). 
     258; 
     259; @history 
     260; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     261;                      5/9/1999 
     262; 
     263; @version 
     264; $Id$ 
     265; 
     266; @todo 
     267; seb: documenter 
     268; 
     269;- 
     270;------------------------------------------------------------ 
     271;------------------------------------------------------------ 
     272;------------------------------------------------------------ 
    251273FUNCTION cw_slider_pm, parent, MAXIMUM = maximum, MINIMUM = minimum $ 
    252274                       , STRMINLEN = strminlen, VALUE = value, UVALUE = uvalue $ 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro

    r134 r150  
    7272    'default':BEGIN  
    7373;--------------- 
    74 ; on trouve le nom de la variable: 
    75 ;--------------- 
     74; We find the name of the variable:  
    7675      vlstid = widget_info(event.top, find_by_uname = 'varlist') 
    7776      fieldname = widget_info(vlstid, /combobox_gettext) 
     
    9493;***************************************************** 
    9594;***************************************************** 
     95;+ 
     96; @file_comments 
     97; 
     98; 
     99; @categories 
     100; 
     101;  
     102; @param PARENT {in}{required} 
     103; The widget ID of the parent widget. 
     104; 
     105; @keyword COLUMN 
     106; Buttons will be arranged in the number of columns 
     107; specified by this keyword. 
     108;  
     109; @keyword ROW 
     110; Buttons will be arranged in the number of rows 
     111; specified by this keyword. 
     112;  
     113; @keyword UVALUE 
     114; The user value to be associated with the widget. 
     115;  
     116; @keyword UNAME 
     117; The user name to be associated with the widget. 
     118; 
     119; @keyword FRAME 
     120; 
     121; 
     122; @keyword FORXXX 
     123; 
     124;  
     125; @keyword _EXTRA 
     126; Used to pass your keywords 
     127; 
     128;  
     129; @returns 
     130;  
     131;  
     132; @uses 
     133;  
     134;  
     135; @restrictions 
     136;  
     137;  
     138; @examples 
     139;  
     140;  
     141; @history 
     142;  
     143;  
     144; @version  
     145; $ID$ 
     146; 
     147; @todo 
     148; seb: documenter 
     149;  
     150;- 
    96151FUNCTION cw_specifie, parent, ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, FRAME = frame, FORXXX = forxxx, _extra = ex 
    97152; cheking exclusive keywords 
     
    135190 
    136191 
    137 ; widget text contennant les autres mots cles passe ds top_uvalue.exextra 
    138 ; en reste-t-il? si oui, il faut les mettres sous forme de string 
     192; widget text containig other keywords pass into top_uvalue.exextra 
     193; Does it remain some? If yes, we have to put them as string 
    139194    
    140195   rien = widget_text(base, value = '  ', /editable, uname = 'autres', uvalue = 'autres', xsize = 54, ysize = 3, yoffset = 65, /wrap, /no_newline) 
  • trunk/SRC/ToBeReviewed/WIDGET/findtopid.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: findtopid 
    65; 
    7 ; PURPOSE: retrouve a partir d''un Id de widget l'Id du widget qui est 
     6; @file_comments 
     7; Find, from an Id of widget, the Id of the widget which is  
    88; "the top-level base" (i.e., it has no parent) 
    99; 
    10 ; CATEGORY: aide pour les widgets 
    11 ; 
    12 ; CALLING SEQUENCE: res=findtopid(Widget_ID) 
     10; categories 
     11; widget 
    1312;  
    14 ; INPUTS: Widget_ID: this argument should be the widget ID of the 
     13; @param WIDGET_ID 
     14; This argument should be the widget ID of the 
    1515; widget for which information is desired. 
    1616; 
    17 ; KEYWORD PARAMETERS: 
     17; @returns 
     18; The Id of the widget which is "the top-level base" 
    1819; 
    19 ; OUTPUTS: l'Id du widget qui est "the top-level base" 
     20; @history 
     21; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     22;                      22/9/1999 
    2023; 
    21 ; COMMON BLOCKS: 
     24; @version 
     25; $Id$ 
    2226; 
    23 ; SIDE EFFECTS:  
    24 ; 
    25 ; RESTRICTIONS: 
    26 ; 
    27 ; EXAMPLE: 
    28 ; 
    29 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    30 ;                      22/9/1999 
    3127;- 
    3228;------------------------------------------------------------ 
    3329;------------------------------------------------------------ 
    3430;------------------------------------------------------------ 
    35 FUNCTION findtopid,  identite 
     31FUNCTION findtopid,  WIDGET_ID 
    3632; 
    3733  compile_opt idl2, strictarrsubs 
    3834; 
    39    id = long(identite) 
     35   id = long(WIDGET_ID) 
    4036;    exist = widget_info(id, /managed) 
    4137;    if exist EQ 0 then return,  -1 
  • trunk/SRC/ToBeReviewed/WIDGET/slec.pro

    r134 r150  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @param NAME 
     9; 
     10; 
     11; @param DEBUT 
     12; 
     13; 
     14; @param FIN 
     15; 
     16; 
     17; @param NOMEXP 
     18; 
     19;  
     20; @keyword PARENT {in}{required} 
     21; The widget ID of the parent widget. 
     22; 
     23; @keyword BOXZOOM 
     24; Vector indicating the geographic zone on which we want to cut the map.  
     25; If BOXZOOM has :  
     26;   1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
     27;   2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
     28;   4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 
     29;   5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 
     30;   6 elements: The extraction is made on Boxzoom  
     31; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 
     32; 
     33; @keyword _EXTRA 
     34; Used to pass your keywords 
     35;  
     36;  
     37; @returns 
     38;  
     39;  
     40; @uses 
     41;  
     42;  
     43; @restrictions 
     44;  
     45;  
     46; @examples 
     47;  
     48;  
     49; @history 
     50;  
     51;  
     52; @version  
     53; $Id$ 
     54; 
     55; @todo 
     56; Seb: documenter 
     57; 
     58;- 
    159FUNCTION slec,name,debut,fin, nomexp, PARENT = parent, BOXZOOM=boxzoom, _EXTRA = ex 
    260;--------------------------------------------------------- 
  • trunk/SRC/ToBeReviewed/WIDGET/xnotice.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:xnotice 
    65; 
    7 ; PURPOSE:cree un widget avec du texte au milieu de la fenetre. 
     6; @file_comments 
     7; Create a widget with some text at the middle of the window 
    88; 
    9 ; CATEGORY:information 
     9; @categories 
     10; Information 
     11;  
     12; @param TEXT {in}{required} 
     13; it is a string or a vector of string. If it is a scalar, we  
     14; look for the line separator !C to create a text with several lines. 
    1015; 
    11 ; CALLING SEQUENCE:widgetid=xnotice(text) 
    12 ;  
    13 ; INPUTS:text: un string ou un vecteur de string. Si c''est un 
    14 ; scalaire on cherche le separateur de ligne !C pour creer un texte a 
    15 ; plusieurs lignes. 
     16; @keyword CHKWIDGET 
     17; Force to verify that they are some active widget to create a widget,  
     18; otherwise print at the prompt 
    1619; 
    17 ; KEYWORD PARAMETERS:chkwidget: oblige a verifier qu''il y a des 
    18 ; widgets actif pour creer un widget, sinon imprime au prompt 
     20; @returns 
     21; The identity of the created widget 
    1922; 
    20 ; OUTPUTS:lidentite du widget cree 
    21 ; 
    22 ; COMMON BLOCKS 
    23 ; 
    24 ; SIDE EFFECTS:ne fait pas appelle a xmanager -> ne cree aucun event! 
    25 ; il faut detruire ce widget a la main: 
     23; @restrictions  
     24; It do not call xmanager -> It do not create any event!  
     25; We have to delete this widget manuelly: 
    2626; widget_control, widgetid, /destroy 
    2727; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; EXAMPLE: 
     28; @examples 
    3129;    IDL> id=xnotice('ca marche !C ou pas?') 
    3230;    IDL> widget_control, id, /destroy 
    3331; 
    34 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     32; @history 
     33; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3534;                      2000 3 17 
     35; 
     36; @version 
     37; $Id$ 
     38; 
    3639;- 
    3740;------------------------------------------------------------ 
     
    4043FUNCTION xnotice, text, CHKWIDGET = chkwidget 
    4144; 
    42 ; on separe le text en differentes lignes (separees par !C) si ce 
     45; We separate the text in different lines (separated by !C) if it is not done yet... 
    4346; n''est pas deja fait... 
    4447; 
  • trunk/SRC/ToBeReviewed/WIDGET/xquestion.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME:xquestion 
    6 ; 
    7 ; PURPOSE: a small widget who ask a question and give an answer. 
    8 ;          WARNING: For a binary question with yes/no answer use 
    9 ;                   DIALOG_MESSAGE. 
    10 ; 
    11 ; CATEGORY: widget 
    12 ; 
    13 ; CALLING SEQUENCE: answer = xquestion(question[,proposedanswer]) 
    14 ;  
    15 ; INPUTS: 
    16 ;        question: a scalar string or a array of string. If this 
    17 ;        argument is set to : 
    18 ;          + an array of strings: each array element is 
    19 ;            displayed as a separate line of text. 
    20 ;          + a scalar string: we are looking for the "separate line 
    21 ;          character" '!C' 
    22 ; 
    23 ;        proposedanswer: a string proposing a answer 
    24 ; 
    25 ; KEYWORD PARAMETERS: those from WIDGET_BASE and WIDGET_TEXT 
    26 ; 
    27 ;        /CHKWIDGET: active this keyword if you whant that xquestion 
    28 ;        check if managed widget are present. If not, xquestion do not 
    29 ;        open a widget but print the question in the IDL window.  
    30 ; 
    31 ; OUTPUTS: 
    32 ;        answer: a string 
    33 ; 
    34 ; COMMON BLOCKS: 
    35 ;        none (we use a "false widget") 
    36 ; 
    37 ; SIDE EFFECTS: 
    38 ;        The function does not return to its caller until the user 
    39 ;        press "Enter" key in the widget. 
    40 ; 
    41 ; RESTRICTIONS: 
    42 ; 
    43 ; EXAMPLE: 
    44 ; 
    45 ;        IDL> help, xquestion('Postscript name') 
    46 ;        <Expression>    STRING    = 'toto.ps' 
    47 ; 
    48 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    49 ;                      13/10/1999 
    50 ;- 
    51 ;------------------------------------------------------------ 
    52 ;------------------------------------------------------------ 
    53 ;------------------------------------------------------------ 
    541;------------------------------------------------------------------------- 
    552pro xquestion_event, event 
     
    6815end 
    6916;------------------------------------------------------------------------- 
     17;------------------------------------------------------------ 
     18;------------------------------------------------------------ 
     19;------------------------------------------------------------ 
     20;+ 
     21; 
     22; @file_comments 
     23; A small widget who ask a question and give an answer. 
     24;   WARNING: For a binary question with yes/no answer use 
     25;   DIALOG_MESSAGE. 
     26; 
     27; @categories 
     28; widget 
     29; 
     30; @param QUESTION 
     31; A scalar string or a array of string. If this 
     32; argument is set to : 
     33;      + an array of strings: each array element is 
     34;        displayed as a separate line of text. 
     35;      + a scalar string: we are looking for the "separate line 
     36;        character" '!C' 
     37; 
     38; @param PROPOSEDANSWER 
     39; A string proposing a answer 
     40; 
     41; 
     42; @keyword CHKWIDGET 
     43; Active this keyword if you whant that xquestion 
     44; check if managed widget are present. If not, xquestion do not 
     45; open a widget but print the question in the IDL window.  
     46; 
     47; @keyword _EXTRA 
     48; Used to pass your keywords 
     49;  
     50; @returns 
     51; answer: a string 
     52; 
     53; @restrictions 
     54; The function does not return to its caller until the user 
     55; press "Enter" key in the widget. 
     56; 
     57; @examples 
     58; IDL> help, xquestion('Postscript name') 
     59; <Expression>    STRING    = 'toto.ps' 
     60; 
     61; @history 
     62; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     63;                      13/10/1999 
     64; 
     65; @version 
     66; $Id$ 
     67; 
     68;- 
     69;------------------------------------------------------------ 
     70;------------------------------------------------------------ 
     71;------------------------------------------------------------ 
    7072FUNCTION xquestion, question, proposedanswer, CHKWIDGET = chkwidget, _extra = ex ; 
    7173; 
  • trunk/SRC/ToBeReviewed/WIDGET/xx.pro

    r134 r150  
    1  
     1;+ 
     2; @file_comments 
     3; 
     4; 
     5; @categories 
     6; 
     7;  
     8; @keyword JOUR 
     9;  
     10;  
     11; @keyword MESHFILENAME 
     12;  
     13;  
     14; @keyword LISTVAR 
     15;  
     16;  
     17; @keyword LISTGRID 
     18;  
     19;  
     20; @keyword FUNCLEC_NAME  
     21;  
     22;  
     23; @keyword CALENDAR 
     24;  
     25;  
     26; @keyword _EXTRA 
     27; Used to pass your keywords 
     28;  
     29;  
     30; @uses 
     31;  
     32;  
     33; @restrictions 
     34;  
     35;  
     36; @examples 
     37;  
     38;  
     39; @history 
     40;  
     41;  
     42; @version  
     43; $Id$ 
     44; 
     45; @todo 
     46; seb documenter 
     47; 
     48;- 
     49; 
    250PRO xx,  JOUR = jour, MESHFILENAME = meshfilename,  LISTVAR = listvar, LISTGRID = listgrid, FUNCLEC_NAME = funclec_name, CALENDAR = calendar, _extra = ex 
    3 ; 
    451; 
    552  compile_opt idl2, strictarrsubs 
     
    855;---------------------------------------------------------------------- 
    956;---------------------------------------------------------------------- 
    10 partie a changer 
     57Name of the part to be changed 
    1158;---------------------------------------------------------------------- 
    1259;---------------------------------------------------------------------- 
    13 ; nom de la fonction de lecture: 
     60; Name of the reading function 
    1461   if NOT keyword_set(funclec_name) then funclec_name = 'slec' 
    1562   varexp = 'INF' 
    16 ; liste des variables 
     63; list of variables 
    1764   if NOT keyword_set(listvar) then listvar = ['tn','sn','un','vn', 'taux', 'tauy','hdep20','hdep28','hdep15','hturb','hpycn','htoth','emp','qn','qs', 'smltot11', 'smltot12', 'smltot13', 'smltot14', 'smltot15', 'smltot16', 'tmltot11', 'tmltot12', 'tmltot13', 'tmltot14', 'tmltot15', 'tmltot16'] 
    18 ; liste des grilles auxquelles elles se rapportent les variables 
     65; list of grids to which variables refer to. 
    1966   if NOT keyword_set(listgrid) then BEGIN  
    2067      listgrid = replicate('T', n_elements(listvar)) 
     
    2269      listgrid[[3, 5]] = 'V' 
    2370   ENDIF 
    24 ; calendrier a utiliser (en jours juliens d''IDL    
     71; calendar to be used (in IDL julian days     
    2572;++++    if NOT keyword_set(calendar) then BEGIN  
    2673;++++       if keyword_set(jour) then calendar = calendriertotem(/julian_day) ELSE calendar = calendriertotem(/julian_day, /mensuel) 
    2774;++++    ENDIF 
    28 ; nom du fichier se rapportant au masque 
     75; Name of the file refering to the mask 
    2976   if NOT keyword_set(meshfilename) then meshfilename = '/usr1/com/smasson/IDL/INIT/inittotem.pro' 
    3077;++++   meshparameters = whichgrid(meshfilename) 
    31 ; parameteres specifiant comment doit etre lu le champ 
     78; parameters specifing how the field must be read 
    3279   readparameters= {funclec_name: funclec_name $ 
    3380                    , jpidta: jpidta, jpjdta: jpjdta, jpkdta: jpkdta $ 
     
    3784;---------------------------------------------------------------------- 
    3885;---------------------------------------------------------------------- 
    39 ;   fin de la partie a changer 
     86;   End of the part to be change 
    4087;---------------------------------------------------------------------- 
    4188;---------------------------------------------------------------------- 
  • trunk/SRC/ToBeReviewed/WIDGET/xxx.pro

    r134 r150  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    4 ;+ 
    5 ; NAME:xxx 
    6 ; 
    7 ; PURPOSE:un maximum de possibilites avec un minimum de clics 
    8 ; 
    9 ; CATEGORY:super widget 
    10 ; 
    11 ; CALLING SEQUENCE:xxx 
    12 ;  
    13 ; INPUTS:none 
    14 ; 
    15 ; KEYWORD PARAMETERS: 
    16 ; 
    17 ;      /SEPARATE: pour separer la partie boutons de la partie dessin 
    18 ;      en 2 fenetres. Utile pour les petits ecrans, mais attention 
    19 ;      peut saturer la memoire video de certains Tx un peu vetustes. 
    20 ; 
    21 ;      RESTORE='toto.dat' ou toto.dat est un fichier cree lors d''une 
    22 ;      precedente utilisation de xxx grace a la commande "Widget" du 
    23 ;      menu "save as". 
    24 ; 
    25 ; OUTPUTS: 
    26 ; 
    27 ; COMMON BLOCKS:common.pro 
    28 ; 
    29 ; SIDE EFFECTS: 
    30 ; 
    31 ; RESTRICTIONS: 
    32 ; 
    33 ; EXAMPLE: 
    34 ; 
    35 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    36 ; 
    37 ;- 
    38 ;------------------------------------------------------------ 
    39 ;------------------------------------------------------------ 
    40 ;------------------------------------------------------------ 
    411 
    422PRO xxx_event, event 
     
    488;------------------------------------------------------------ 
    499;    = widget_info(event.top,find_by_uname = '') 
    50 ; quel est le type d''evenement? 
     10; What is the type of evenment ? 
    5111;   if event.id EQ 622 then help,  event,  /struct 
    5212   widget_control, event.id, get_uvalue=uval 
     
    5515;help,  event, /struct 
    5616;help, uval , /struct 
    57 ; case sur le type d''evenement 
     17; case on the type of evenment 
    5818   widget_control, event.top, get_uvalue = top_uvalue 
    59 ; si on a active le mot cles separate a l''appelle de xxx 
     19; If we activate the keyword separate at the call of xxx 
    6020   if size(top_uvalue, /type) EQ 3 then begin 
    6121      event.top = top_uvalue 
    6222      widget_control, event.top, get_uvalue = top_uvalue 
    6323   endif 
    64 ; on tue le petit widget cree par notice.pro si il existe 
     24; we delete the small widget created by notice.pro if it exists 
    6525   noticebase = extractatt(top_uvalue, 'noticebase') 
    6626   if noticebase NE 0 then BEGIN 
     
    12888;------------------------------------------------------------ 
    12989;------------------------------------------------------------ 
     90;+ 
     91; 
     92; @file_comments 
     93; A maximum of possibilities with a minimum of clics 
     94; 
     95; @categories 
     96; widget 
     97;  
     98; @param DATAFILENAME 
     99; 
     100; 
     101; @param IDLFILE 
     102; 
     103; 
     104; @param ARGSPRO 
     105; 
     106; 
     107; @keyword SEPARATE 
     108; To separate the button part and the drawing part in 2 windows. 
     109; Useful for small screens, but be careful to do not saturate the  
     110; video memory of some antiquated Tx. 
     111; 
     112; @keyword RESTORE 
     113; 'toto.dat' or toto.dat is a file created at the time of a precedent  
     114; use of xxx thanks to the command "Widget" of the menu "save as". 
     115;  
     116; @keyword _EXTRA 
     117; Used to pass your keywords 
     118; 
     119; @uses 
     120; common.pro 
     121; 
     122; @history 
     123; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     124; 
     125; @version 
     126; $Id$ 
     127; 
     128; @todo 
     129; seb: documenter le reste des keywords 
     130; 
     131;- 
     132;------------------------------------------------------------ 
     133;------------------------------------------------------------ 
     134;------------------------------------------------------------ 
     135;------------------------------------------------------------ 
     136;------------------------------------------------------------ 
     137;------------------------------------------------------------ 
    130138PRO xxx, datafilename, idlfile, argspro, CALLERWIDID = CallerWidId $ 
    131139         , REDRAW = redraw, SEPARATE = separate, UVALUE = uvalue $ 
     
    154162;------------------------------------------------------------ 
    155163;------------------------------------------------------------ 
    156 ; liste des fichiers que l''on veut regarder 
     164; list of files we want to look at 
    157165; 
    158166  if keyword_set(uvalue) then BEGIN  
     
    368376;------------------------------------------------------------ 
    369377  if keyword_set(uvalue) then BEGIN ; 
    370 ; on recopie le pointeur uvalue dans top_uvalue. 
    371 ; Attention, il faut completement redefinir top_uvalue a partir des 
    372 ; variables pointees par uvalue. Sinon si on fait simplement 
    373 ; top_uvalue = uvalue, qd on detruit par uvalue et les variables 
    374 ; surlesquelles il pointe on detruit aussi les variables sur 
    375 ; lesquelles pointent top_uvalue. 
     378; We recopy the pointer uvalue in top_uvalue. 
     379; Beware, we have to redefine completely top_value from variables  
     380; pointed by uvalue. Otherwise, if we simply do top_value = uvalue,  
     381; when we delete by uvalue and variables on which it point, we  
     382; also delete variables on which point top_value. 
    376383    case 1 of 
    377384      keyword_set(redraw):BEGIN 
     
    380387; we find homedir 
    381388        homedir = isadirectory(io = homedir, title = 'Bad definition of homedir') 
    382 ; on recupere la liste des instructions 
     389; We recuperae the list of instructions 
    383390        globalcommand = extractatt(top_uvalue, 'globalcommand') 
    384 ; on complete par le premiere et les dernieres lignes du programme 
     391; We complete by first and last lines of the program 
    385392        createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 
    386393                   , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript' $ 
     
    395402        wset, win 
    396403        tv, image, /true 
    397 ; etat des widgets 
     404; widgets's state 
    398405        updatewidget, base 
    399 ; menage 
     406;  
    400407      END 
    401408      ELSE:BEGIN 
     
    416423        for i = 0, nbredessin-1 do *(*top_uvalue[1, 28])[i] = *(*uvalue[1, 28])[i]  
    417424        widget_control, base, set_uvalue = top_uvalue 
    418 ; copie l''ecran du widget de uvalue dans celui de top_uvalue 
     425; Copy the screen of the widget of uvalue in top_value's one 
    419426        if keyword_set(CallerWidId)  then begin 
    420427          widget_control, extractatt(uvalue, 'graphid'), get_value = win 
     
    431438    *top_uvalue[1, findline(top_uvalue, 'graphid')] = graphid 
    432439; 
    433   ENDIF ELSE BEGIN 
    434 ; sinon on va definit tous les elements que l''on acroche au widget 
    435 ; grace a la top_uvalue qui est un tableau de pointeurs a 2 colonnes: 
    436 ; les noms et des variables 
    437 ; on initialie tous ces elements. 
    438 ; variables concernant le widget ds sa generalite 
     440ENDIF ELSE BEGIN 
     441; Otherwise we will define all elements we will hook at the widget  
     442; thanks to the top_value which is a pointer array with 2  
     443; columns: names and variables.  
     444; We initialize all these elements. 
     445; Variables concerning the widget in its generality. 
    439446    if NOT keyword_set(ex)  then ex = {nothing:0} 
    440447; variables se rapportant aux differents fichiers que l''on peut lire 
     
    442449;       
    443450     
    444 ; creation du pointeur que l''on va attache au widget. 
     451; creation of the pointer we will hook at the widget. 
    445452    top_uvalue = ptrarr(2, 29, /allocate_heap) 
    446 ; variables se rapportant au widget en general 
     453; variables refering to the widget 
    447454    *top_uvalue[0, 0] = 'options' & *top_uvalue[1, 0] = options 
    448455    *top_uvalue[0, 1] = 'smallin' & *top_uvalue[1, 1] = smallin 
     
    458465    *top_uvalue[0, 11] = 'noticebase' & *top_uvalue[1, 11] = 0l 
    459466    *top_uvalue[0, 12] = 'extra' & *top_uvalue[1, 12] = ex 
    460 ; variables se rapportant aux differents fichiers que l''on peut lire 
     467; variables refering to different files we can read 
    461468    *top_uvalue[0, 13] = 'currentfile' & *top_uvalue[1, 13] = currentfile 
    462469    *top_uvalue[0, 14] = 'filelist' & *top_uvalue[1, 14] = filelist 
     
    464471    *top_uvalue[0, 16] = 'readparameters' & *top_uvalue[1, 16] = readparameters 
    465472    *top_uvalue[0, 17] = 'meshparameters' & *top_uvalue[1, 17] = meshparameters 
    466 ; variables se rapportant aux differents dessins que l''on peut faire 
     473; variables refering to different drawing we can do 
    467474    *top_uvalue[0, 18] = 'penvs' & *top_uvalue[1, 18] = replicate(!p, nbredessin) 
    468475    *top_uvalue[0, 19] = 'xenvs' & *top_uvalue[1, 19] = replicate(!x, nbredessin) 
Note: See TracChangeset for help on using the changeset viewer.