- Timestamp:
- Aug 12, 2016, 3:38:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1010 r1013 16574 16574 newdim = newonc.createDimension(oldd, len(odim)) 16575 16575 16576 newvar = newonc.createVariable(oldv, nctype(vinf.dtype), vinf.dimns) 16576 if vinf.FillValue is not None: 16577 newvar = newonc.createVariable(oldv, nctype(vinf.dtype), vinf.dimns, \ 16578 fill_value=vinf.FillValue) 16579 else: 16580 newvar = newonc.createVariable(oldv, nctype(vinf.dtype), vinf.dimns) 16577 16581 newvar[:] = oldov[:] 16578 16582 for attrn in vinf.attributes: 16579 attrv = oldov.getncattr(attrn) 16580 newattr = set_attribute(newvar,attrn,attrv) 16583 if vinf.FillValue is not None and attrn != '_FillValue': 16584 attrv = oldov.getncattr(attrn) 16585 newattr = set_attribute(newvar,attrn,attrv) 16581 16586 16582 16587 newonc.sync()
Note: See TracChangeset
for help on using the changeset viewer.