Changeset 749 in lmdz_wrf


Ignore:
Timestamp:
May 4, 2016, 11:33:02 AM (9 years ago)
Author:
lfita
Message:

Working on the 'gen' version of `SpatialWeightedMean?'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r747 r749  
    77
    88main = 'nc_var_tools.py'
     9errormsg = 'ERROR -- error -- ERROR -- error'
     10warnmsg = 'WARNING -- warning -- WARNING -- warning'
    911
    1012def varinfile(ncf, filen, emsg, vmsg, varn):
     
    1210012102    if weightk == 'varnames':
    1210112103        arguments = '[weightk],[varname],[oper],[xdimname],[ydimname],[addvars]'
    12102         check_arguments(fname, values, arguments, ',')
     12104        gen.check_arguments(fname, values, arguments, ',')
    1210312105        varname = values.split(',')[1]
    1210412106        oper = values.split(',')[2]     
     
    1211012112    elif weightk == 'reglonlat':
    1211112113        arguments = '[weightk],[lonname],[latname],[xdimname],[ydimname],[addvars]'
    12112         check_arguments(fname, values, arguments, ',')
     12114        gen.check_arguments(fname, values, arguments, ',')
    1211312115        lonname = values.split(',')[1]
    1211412116        latname = values.split(',')[2]
     
    1212712129        quit(-1)
    1212812130    iovar = onc.variables[varn]
    12129     if not searchInlist(list(iovar.dimensions),xdimname) and not                     \
    12130       searchInlist(list(iovar.dimensions),ydimname):
     12131    if not gen.searchInlist(list(iovar.dimensions),xdimname) and not                 \
     12132      gen.searchInlist(list(iovar.dimensions),ydimname):
    1213112133        print errormsg
    1213212134        print '  ' + fname + ": variable '" + varn + "' does not have dimension '" + \
     
    1213712139    filemiss = False
    1213812140    ivarattrs = iovar.ncattrs()
    12139     if searchInlist(ivarattrs, 'missing_value'):
     12141    if gen.searchInlist(ivarattrs, 'missing_value'):
    1214012142        filemissv = iovar.getncattr('missing_value')
    1214112143        filemiss = True
     
    1214312145
    1214412146    filefill = False
    12145     if searchInlist(ivarattrs, '_FillValue'):
     12147    if gen.searchInlist(ivarattrs, '_FillValue'):
    1214612148        filefillv = iovar.getncattr('_FillValue')
    1214712149        filefill = True
Note: See TracChangeset for help on using the changeset viewer.