- Timestamp:
- Jul 13, 2018, 3:20:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1923 r1928 1690 1690 """ Removing a variable from a file 1691 1691 ncfile = netCDF object file 1692 var = variablename to remove1692 var = ',' separated list of variables' name to remove 1693 1693 """ 1694 1694 import shutil as shu … … 1704 1704 ncf.close() 1705 1705 1706 if not gen.searchInlist(ncvars, var): 1707 print ' ' + fname + ": File '" + ncfile + "' does not have variable: '" + \ 1708 var + "' !!" 1709 print ' variables:', ncvars 1710 quit(-1) 1706 varns = gen.str_list(var, ',') 1707 1708 for var in varns: 1709 if not gen.searchInlist(ncvars, var): 1710 print ' ' + fname + ": File '" + ncfile + "' does not have variable: '" + \ 1711 var + "' !!" 1712 print ' variables:', ncvars 1713 quit(-1) 1711 1714 1712 1715 tmpncf = NetCDFFile('tmp_py.nc' , 'w')
Note: See TracChangeset
for help on using the changeset viewer.