Changeset 2823 in lmdz_wrf
- Timestamp:
- Apr 25, 2020, 5:22:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2822 r2823 1383 1383 1384 1384 var = ncf.variables[varn] 1385 var = set_attribute(var, attrn, attrv)1385 newattr = set_attribute(var, attrn, attrv) 1386 1386 1387 1387 ncf.sync() … … 1450 1450 quit(-1) 1451 1451 1452 var = set_attribute(var, attrn, attrv)1452 newattr = set_attribute(var, attrn, attrv) 1453 1453 1454 1454 ncf.sync() … … 1744 1744 for attr in refvarattrs: 1745 1745 attrv = refvarv.getncattr(attr) 1746 atvar = set_attribute(varv, attr, attrv)1746 newattr = set_attribute(varv, attr, attrv) 1747 1747 1748 1748 ncf.sync() … … 1785 1785 for attr in refgattrs: 1786 1786 attrv = ncref.getncattr(attr) 1787 atvar = set_attribute(ncf, attr, attrv)1787 newattr = set_attribute(ncf, attr, attrv) 1788 1788 1789 1789 ncf.sync() … … 6661 6661 if not attrs == '_FillValue': 6662 6662 attrv = varobj.getncattr(attrs) 6663 attr = set_attribute(newvar, attrs, attrv)6663 newattr = set_attribute(newvar, attrs, attrv) 6664 6664 ncoobj.sync() 6665 6665 … … 6668 6668 for attrs in nciobj.ncattrs(): 6669 6669 attrv = nciobj.getncattr(attrs) 6670 attr = set_attribute(ncoobj, attrs, attrv)6670 newattr = set_attribute(ncoobj, attrs, attrv) 6671 6671 6672 6672 nciobj.close() … … 6854 6854 if not attrs == '_FillValue': 6855 6855 attrv = varobj.getncattr(attrs) 6856 attr = set_attribute(newvar, attrs, attrv)6856 newattr = set_attribute(newvar, attrs, attrv) 6857 6857 6858 6858 # Global attributes … … 6860 6860 for attrs in nciobj.ncattrs(): 6861 6861 attrv = nciobj.getncattr(attrs) 6862 attr = set_attribute(ncoobj, attrs, attrv)6862 newattr = set_attribute(ncoobj, attrs, attrv) 6863 6863 6864 6864 slicevalS = '' … … 6877 6877 str(dimslices[dn][1]) + ',1); ' 6878 6878 6879 attr = set_attribute(ncoobj, 'sliced_dimensions', slicevalS)6879 newattr = set_attribute(ncoobj, 'sliced_dimensions', slicevalS) 6880 6880 6881 6881 nciobj.close() … … 10830 10830 for attr in gorigattrs: 10831 10831 attrv = objnc.getncattr(attr) 10832 atvar = set_attributek(objnewnc, attr, attrv, type(attrv))10832 newattr = set_attributek(objnewnc, attr, attrv, type(attrv)) 10833 10833 10834 10834 objnc.close() … … 11018 11018 for attr in gorigattrs: 11019 11019 attrv = objnc.getncattr(attr) 11020 atvar = set_attribute(objnewnc, attr, attrv)11020 newattr = set_attribute(objnewnc, attr, attrv) 11021 11021 11022 11022 objnc.close() … … 11783 11783 newvar.setncattr('axis', 'T') 11784 11784 newvar.setncattr('_CoordinateAxisType', 'Time') 11785 set_attribute(newvar, 'calendar', 'standard')11785 newattr = set_attribute(newvar, 'calendar', 'standard') 11786 11786 if urefvals == '-': urefvals = '- -' 11787 11787 … … 14763 14763 newvar[:] = secondvals 14764 14764 14765 set_attribute(newvar, 'desc', 'Selected ' + newdimns[idn])14765 newattr = set_attribute(newvar, 'desc', 'Selected ' + newdimns[idn]) 14766 14766 idn = idn + 1 14767 14767 … … 14990 14990 if not attrs == '_FillValue': 14991 14991 attrv = ov.getncattr(attrs) 14992 attr = set_attribute(newvar, attrs, attrv)14992 newattr = set_attribute(newvar, attrs, attrv) 14993 14993 14994 14994 return … … 15329 15329 for attrs in nciobj.ncattrs(): 15330 15330 attrv = nciobj.getncattr(attrs) 15331 attr = set_attribute(ncoobj, attrs, attrv)15332 15333 attr = set_attribute(ncoobj, 'sliced_variables', slicevalS)15331 newattr = set_attribute(ncoobj, attrs, attrv) 15332 15333 newattr = set_attribute(ncoobj, 'sliced_variables', slicevalS) 15334 15334 add_global_PyNCplot(ncoobj, main, fname, '1.1') 15335 15335 … … 15568 15568 for attrn in ovar.ncattrs(): 15569 15569 attrv = ovar.getncattr(attrn) 15570 set_attribute(newvar, attrn, attrv)15570 newattr = set_attribute(newvar, attrn, attrv) 15571 15571 15572 15572 oncf.sync() … … 16024 16024 for attrs in onc.ncattrs(): 16025 16025 attrv = onc.getncattr(attrs) 16026 attr = set_attribute(onewnc, attrs, attrv)16026 newattr = set_attribute(onewnc, attrs, attrv) 16027 16027 16028 16028 onc.close()
Note: See TracChangeset
for help on using the changeset viewer.