Changeset 442 for trunk


Ignore:
Timestamp:
12/23/10 11:09:15 (14 years ago)
Author:
smasson
Message:

add mask2d keyword in moyenne and grossemoyenne

Location:
trunk/SRC/ToBeReviewed/CALCULS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/CALCULS/grossemoyenne.pro

    r441 r442  
    4747; To make an integral rather than an average 
    4848; 
     49; @keyword MASK2D 
     50; an optional 2d mask array (containing only 0 and 1) that can be use 
     51; to modified each levels of the default mask. 
     52; 
    4953; @keyword SPATIALFIRST 
    5054; when performing at the same time 
     
    9397;- 
    9498FUNCTION grossemoyenne, tab, direc, BOXZOOM=boxzoom, INTEGRATION=integration, KEEPBOTTOM = keepbottom $ 
    95                       , NAN=nan, NODOMDEF=nodomdef, WDEPTH=wdepth, ssh=ssh $ 
     99                      , NAN=nan, NODOMDEF=nodomdef, WDEPTH=wdepth, SSH=ssh, MASK2D=mask2d $ 
    96100                      , SPATIALFIRST=spatialfirst, TEMPORALFIRST=temporalfirst $ 
    97101                      , _EXTRA=ex 
     
    168172;--------------------------------------------------------------- 
    169173  grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz, e1, e2, e3, WDEPTH = wdepth 
     174  IF keyword_set(mask2D) THEN BEGIN 
     175    IF taille[1] eq jpi and taille[2] eq jpj THEN $ 
     176       mmm = mask2D[firstx:lastx, firsty:lasty] ELSE mmm = mask2D 
     177    mask = mask * ( mmm[*] # replicate(1., nz) )  
     178  ENDIF 
    170179;--------------------------------------------------------------- 
    171180; check the use of ssh keyword... 
  • trunk/SRC/ToBeReviewed/CALCULS/moyenne.pro

    r441 r442  
    4545; To make an integral rather than an average 
    4646; 
     47; @keyword MASK2D 
     48; an optional 2d mask array (containing only 0 and 1) that can be use 
     49; to modified each levels of the default mask. 
     50; 
    4751; @keyword SSH 
    4852; array giving the sea level elenation (in meter) that must be added 
     
    7781;- 
    7882FUNCTION moyenne, tab, direc, BOXZOOM=boxzoom, INTEGRATION=integration, KEEPBOTTOM = keepbottom $ 
    79                 , NAN=nan, NODOMDEF=nodomdef, SSH = ssh, WDEPTH=wdepth, _EXTRA=ex 
     83                , NAN=nan, NODOMDEF=nodomdef, SSH = ssh, MASK2D=mask2d, WDEPTH=wdepth, _EXTRA=ex 
    8084; 
    8185  compile_opt idl2, strictarrsubs 
     
    147151  IF vargrid EQ 'W' THEN wdepth = 1 
    148152  grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz, e1, e2, e3, WDEPTH = wdepth 
     153  IF keyword_set(mask2D) THEN BEGIN 
     154    IF taille[1] eq jpi and taille[2] eq jpj THEN $ 
     155       mmm = mask2D[firstx:lastx, firsty:lasty] ELSE mmm = mask2D 
     156    mask = mask * ( mmm[*] # replicate(1., nz) )  
     157  ENDIF 
    149158;--------------------------------------------------------------- 
    150159; check the use of ssh keyword... 
Note: See TracChangeset for help on using the changeset viewer.