- Timestamp:
- Aug 26, 2016, 9:19:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1046 r1047 5806 5806 ncoobj.sync() 5807 5807 5808 print newvar5809 5810 5808 for attrs in varattrs: 5811 5809 if not attrs == '_FillValue': … … 5813 5811 attr = set_attribute(newvar, attrs, attrv) 5814 5812 ncoobj.sync() 5815 5816 5813 5817 5814 # Global attributes … … 6868 6865 # Variables for dimensions 6869 6866 for varn in dimovars: 6867 6870 6868 if not gen.searchInlist(list(objnc.variables.keys()), varn): 6871 6869 print warnmsg … … 6874 6872 else: 6875 6873 dvarobj = objnc.variables[varn] 6874 # Adding that dimensions of the variable which might not be in the output 6875 for vdn in dvarobj.dimensions: 6876 if not objofile.dimensions.has_key(vdn): 6877 addvdno = objnc.dimensions[vdn] 6878 if addvdno.isunlimited(): 6879 objofile.createDimension(vdn, None) 6880 else: 6881 objofile.createDimension(vdn, len(addvdno)) 6882 # Adding new variable to output 6876 6883 newvar = objofile.createVariable(varn, dvarobj.dtype, dvarobj.dimensions) 6877 6884 for attrn in dvarobj.ncattrs():
Note: See TracChangeset
for help on using the changeset viewer.