Changeset 1042 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 22, 2016, 2:14:17 PM (9 years ago)
Author:
lfita
Message:

Adding `var': variance as computed variable (and as 'surname')

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r1040 r1042  
    2323
    2424# Variable name might come with a statistical surname...
    25 statsurname=['min','max','mean','std', 'sum', 'turb']
     25statsurname=['min','max','mean','std', 'sum', 'turb', 'var']
    2626
    2727####### Content
  • trunk/tools/nc_var_tools.py

    r1037 r1042  
    89188918            elif oper == 'sum':
    89198919                varoper = np.sum(varoper, axis=idim-noper)
     8920            elif oper == 'var':
     8921                varoper = np.var(varoper, axis=idim-noper)
    89208922            else:
    89218923                print errormsg
     
    89438945        which operation has to be done
    89448946      opkind= operation to perform along the dimensions with a range: max, mean,
    8945         mean2, min, sum
     8947        mean2, min, sum, var
    89468948    """
    89478949    fname = 'operation_alongdims'
     
    90209022                elif opkind == 'std':
    90219023                    varoper = np.std(origvar, axis=ids-noper)
     9024                elif opkind == 'var':
     9025                    varoper = np.var(origvar, axis=ids-noper)
    90229026                else:
    90239027                    print errormsg
     
    90739077          which operation has to be done
    90749078        [opkind]; operation to perform along the dimensions with a range: max, mean,
    9075           mean2, min, sum
     9079          mean2, min, sum, var
    90769080        [dimvn]; [varname1]:[varname2]:[...[varnameM]] variables with the values of the
    90779081          dimensions
     
    90939097# Operations with which when the variable dimensions will be ajusted to the file
    90949098#   the zero value along the operated dimensions will be taken
    9095     zerodimops = ['max', 'mean', 'mean2', 'min', 'sum', 'std']
     9099    zerodimops = ['max', 'mean', 'mean2', 'min', 'sum', 'std', 'var']
    90969100
    90979101    dimsoperS = gen.numVector_String(dimsoper,', ')
Note: See TracChangeset for help on using the changeset viewer.