Changeset 1033 in lmdz_wrf for trunk/tools/nc_var_tools.py
- Timestamp:
- Aug 20, 2016, 3:37:38 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1024 r1033 6859 6859 "' skipping it !!" 6860 6860 else: 6861 varobj = objnc.variables[varn]6862 newvar = objofile.createVariable(varn, varobj.dtype,varobj.dimensions)6863 for attrn in varobj.ncattrs():6864 attrval = varobj.getncattr(attrn)6861 dvarobj = objnc.variables[varn] 6862 newvar = objofile.createVariable(varn, dvarobj.dtype, dvarobj.dimensions) 6863 for attrn in dvarobj.ncattrs(): 6864 attrval = dvarobj.getncattr(attrn) 6865 6865 newattr = newvar.setncattr(attrn, attrval) 6866 newvar[:] = varobj[:]6866 newvar[:] = dvarobj[:] 6867 6867 6868 6868 newvar = objofile.createVariable(varname, vartype, vardims) 6869 6869 newvar[:] = newvarv 6870 varattrs = varobj.ncattrs() 6871 if gen.searchInlist(varattrs,'long_name'): 6872 operation = varobj.getncattr('long_name') + '; ' + operation 6873 6870 6874 newattr = basicvardef(newvar, varname, operation, newunits) 6875 stdattrs = ['standard_name', 'long_name', 'units'] 6876 for attrn in varattrs: 6877 if not gen.searchInlist(stdattrs, attrn): 6878 attrv = varobj.getncattr(attrn) 6879 newattr = set_attribute(newvar,attrn,attrv) 6871 6880 6872 6881 # Global attributes
Note: See TracChangeset
for help on using the changeset viewer.