Changeset 343 for trunk


Ignore:
Timestamp:
04/10/08 22:14:51 (16 years ago)
Author:
smasson
Message:

small bugfix + new keyword in file_interp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Interpolation/file_interp.pro

    r330 r343  
    2121      nan_value GT 1.e6:mask = temporary(mask) * (data LT (nan_value-10.)) 
    2222      nan_value LT -1.e6:mask = temporary(mask) * (data GT (nan_value+10.)) 
    23       abs(nan_value) LT 1.e-6:mask = temporary(mask) * (data GT 1.e-6) 
     23      abs(nan_value) LT 1.e-6:mask = temporary(mask) * (abs(data) GT 1.e-6) 
    2424      ELSE:mask = temporary(mask) * (data NE nan_value) 
    2525    ENDCASE 
     
    7272; determined through <pro>ncdf_getmask</pro> according to the keywords 
    7373; outmaskname, outinvmask, outuseasmask, outmissing_value, 
    74 ; outaddscl_before (see bellow) 
     74; outaddscl_before (see bellow). 
    7575; 
    7676; @keyword KEEP {type=string array}{default=all variables} 
     
    127127; 
    128128; @keyword INUSEASMASK {type=scalar string} 
    129 ; A string giving the name of the variable in the input mask file maskin 
    130 ; that will be used to build the land/sea mask. In this case the 
     129; A string giving the name of the variable in the input mask file 
     130; that will be used to build the input land/sea mask. In this case the 
    131131; mask is based on the first record (if record dimension 
    132 ; exists). The mask is build according to : 
    133 ;    1 the keyword missing_value if existing 
    134 ;    2 the attribute 'missing_value' if existing 
    135 ;    3 NaN values if existing 
     132; exists). The input mask is build according to operator defined by INTESTOP 
     133; keyword (default NE) and the testing values defined as  
     134;   1) the second word of TESTOP if existing 
     135;   2) MISSING_VALUE keyword 
     136;   3) attribute missing_value or _fillvalue of the variable USEASMASK 
     137;   4) !Values.f_nan (can be used only with NE and EQ operators) 
    136138; 
    137139; @keyword OUTUSEASMASK {type=scalar string} 
     
    140142; @keyword INMISSING_VALUE {type=scalar} 
    141143; To define (or redefine if the attribute is already existing) the 
    142 ; missing values used by INUSEASMASK keyword 
     144; missing values used with INUSEASMASK keyword. Note that this value is 
     145; not used if INTESTOP keyword is given and contains 2 words.   
    143146; 
    144147; @keyword OUTMISSING_VALUE {type=scalar} 
    145148; same as inmissing_value but for output mask file maskout 
     149; 
     150; @keyword INTESTOP {default='NE'} {type=scalar string, for example 'GT 0.5'} 
     151; a string describing the type of test that will be done to define the 
     152; input mask. The test is performed on the variable specified by INUSEASMASK 
     153; keyword. 
     154; INTESTOP can contain 1 or 2 words. The first word is the operator 
     155; definition: "EQ" "NE" "GE" "GT" "LE" "LT" (default is NE). The 
     156; second word define the testing value. If TESTOP contains only 1 
     157; word, then the test value is denifed by 
     158;   1) MISSING_VALUE keyword 
     159;   2) attribute missing_value or _fillvalue of the variable USEASMASK 
     160;   3) !Values.f_nan (can be used only with NE and EQ operators) 
     161; 
     162; @keyword OUTTESTOP {default='NE'} {type=scalar string, for example 'GT 0.5'} 
     163; same as INTESTOP but for output mask file maskout 
    146164; 
    147165; @keyword INADDSCL_BEFORE {default=0}{type=scalar: 0 or 1} 
     
    192210; 
    193211; - perform only horizontal interpolations on scalar fields 
    194 ; - will fill all masked and missing values before interpolation 
     212; - all masked and missing values are filled before interpolation 
     213;   -> output data are not masked and have values everywhere. 
    195214; - attributes (like valid_min...) are not updated 
    196215; - see restrictions of <pro>fromreg</pro> and <pro>fromirr</pro> 
     216; - output mask is not used but, if the input file contains the mask 
     217;   in a variable (defined by inmaskname), this variable will contain 
     218;   the output mask in the ouput file 
    197219; 
    198220; @examples 
     
    214236               , SET_XAXISNAME=set_xaxisname, SET_YAXISNAME=set_yaxisname $ 
    215237               , INMASKNAME=inmaskname, ININVMASK=ininvmask $ 
    216                , INUSEASMASK=inuseasmask $ 
    217                , INMISSING_VALUE=inmissing_value $ 
    218                , INADDSCL_BEFORE=inaddscl_before $ 
     238               , INUSEASMASK=inuseasmask, INMISSING_VALUE=inmissing_value $ 
     239               , INADDSCL_BEFORE=inaddscl_before, INTESTOP = intestop $ 
    219240               , OUTMASKNAME=outmaskname, OUTINVMASK=outinvmask $ 
    220                , OUTUSEASMASK=outuseasmask $ 
    221                , OUTMISSING_VALUE=outmissing_value $ 
    222                , OUTADDSCL_BEFORE=outaddscl_before $ 
     241               , OUTUSEASMASK=outuseasmask, OUTMISSING_VALUE=outmissing_value $ 
     242               , OUTADDSCL_BEFORE=outaddscl_before, OUTTESTOP = outtestop $ 
    223243               , NAN_VALUE=NaN_value, WEIG=weig, ADDR=addr $ 
    224244               , INXAXISNAME=inxaxisname, INYAXISNAME=inyaxisname $ 
     
    268288; 
    269289  inmask = ncdf_getmask(maskin, MASKNAME = inmaskname, INVMASK = ininvmask, USEASMASK = inuseasmask $ 
    270                        , MISSING_VALUE = inmissing_value, ADDSCL_BEFORE = inaddscl_before) 
     290                       , MISSING_VALUE = inmissing_value, ADDSCL_BEFORE = inaddscl_before, TESTOP = intestop) 
    271291  inmasksz = size(inmask, /dimensions) 
    272292  IF size(inmask, /n_dimensions) EQ 2 THEN inmasksz = [inmasksz, 0] 
    273293  IF n_elements(inmaskname) EQ 0 THEN inmaskname = 'not defined' ; default definition 
    274294  outmask = ncdf_getmask(maskout, MASKNAME = outmaskname, INVMASK = outinvmask, USEASMASK = outuseasmask $ 
    275                         , MISSING_VALUE = outmissing_value, ADDSCL_BEFORE = outaddscl_before) 
     295                        , MISSING_VALUE = outmissing_value, ADDSCL_BEFORE = outaddscl_before, TESTOP = outtestop) 
    276296; 
    277297; irregular grids? 
Note: See TracChangeset for help on using the changeset viewer.