Changeset 1517 in lmdz_wrf for trunk/tools/nc_var_tools.py


Ignore:
Timestamp:
Apr 12, 2017, 12:52:49 AM (8 years ago)
Author:
lfita
Message:

Adding into 'compute_opersvarsfiles':

'repl',[modval1]: replace values of [prevalues] with values from [operfile2var] except values in second file = [modval1]
'replbig',[modval1]: replace values of [prevalues] with values from [operfile2var] except values in second file > [modval1]
'repless',[modval1]: replace values of [prevalues] with values from [operfile2var] except values in second file < [modval1]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1511 r1517  
    69506950    """ Function to compute opersvarfiles: operation of variables from different files
    69516951      (OPER1.FILE1_VAR1 OPER2.FILE2_VAR2), operations are going to be sequentially made
    6952       compute_opersvarsfiles(values, varinfo)
     6952      compute_opersvarsfiles(values, varinfo).
     6953        NOTE: Values from the first file (with always operation 'add')
     6954        [prevalues]: values from the previous operations
    69536955        values= '%' separated list of dimension ranges and file,operation,variable to compute
    69546956          [dimranges1]@[operfile1var]%[dimranges2]@[operfile2var]%[...[dimrangesM]@[operfileMvar]]
     
    69756977             'pot': powering with [var] ([prevalues] ** [var])
    69766978             'potc',[modval1]: [prevalues] ** [modval1]
     6979             'repl',[modval1]: replace values of [prevalues] with values from [operfile2var] except
     6980               values in second file = [modval1]
     6981             'replbig',[modval1]: replace values of [prevalues] with values from [operfile2var] except
     6982               values in second file > [modval1]
     6983             'repless',[modval1]: replace values of [prevalues] with values from [operfile2var] except
     6984               values in second file < [modval1]
    69776985             'sub': substracting [var] ([prevalues] - [var])
    69786986             'subc',[modval1]: remove [modval1] of [prevalues]
     
    71717179                prevalues, operS = gen.matoperations(opern, varvals, inimat)
    71727180            else:
     7181                print ' ' + fname + ': Lluis opern:', opern
    71737182                prevalues, operS = gen.matoperations(opern, prevalues, varvals)
    71747183            operS = ' ' + operS + '[' + varn + ']'
     
    72177226
    72187227# Global attributes
    7219     objofile.setncattr('script',  fname)
    7220     objofile.setncattr('version',  '1.0')
    7221     objofile.setncattr('author',  'L. Fita')
    7222     newattr = set_attributek(objofile, 'institution', unicode('Laboratoire de M' +   \
    7223       unichr(233) + 't' + unichr(233) + 'orologie Dynamique'), 'U')
    7224     objofile.setncattr('university',  'Pierre et Marie Curie')
    7225     objofile.setncattr('country',  'France')
     7228    add_global_PyNCplot(objofile, main, fname, '1.1')
    72267229    newattr = set_attributek(objofile, 'used_operation',  operationS, 'S')
    72277230    newattr = set_attributek(objofile, 'used_files',  ', '.join(filens) ,'S')
Note: See TracChangeset for help on using the changeset viewer.