- Timestamp:
- Mar 9, 2017, 9:50:54 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1461 r1467 74 74 # get_Variables: Function to get a list of variables from an existing file 75 75 # getvalues_lonlat: Function to retrieve the values from the closest grid point to a set of longitude, latitude values 76 # get_varunits: Getting the units of a variable object 76 77 # getvars_tofile: Function to get variables from a file and pass them to another one 77 78 # grattr: Function to read a global atribute … … 19045 19046 return arrayvalues 19046 19047 19048 def get_varunits(ovar): 19049 """ Getting the units of a variable object 19050 ovar: object variable from which get the units 19051 """ 19052 fname = 'get_varunits' 19053 19054 varattrs = ovar.ncattrs() 19055 if gen.searchInlist(varattrs,'units'): 19056 varunits = ovar.units 19057 else: 19058 varunits = gen.variables_values(ovar.name)[5] 19059 19060 return varunits 19061 19047 19062 #quit()
Note: See TracChangeset
for help on using the changeset viewer.