CDAT / cdutil

Climate Utilities for CDAT
3 stars 2 forks source link

cdutil.region.domain: variable loses unit attribute #9

Closed chengzhuzhang closed 7 years ago

chengzhuzhang commented 7 years ago

After applying cdutil.region.domain, the transient variable lost the unit attributes

doutriaux1 commented 7 years ago
import cdms2
import cdutil
import vcs
vcs.download_sample_data_files
f=cdms2.open(vcs.sample_data+"/clt.nc")
s=f("clt")
AA = cdutil.region.AAZ()
s2=s(AA)
print s.units
print s2.units

fails with:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-5cf75df63c22> in <module>()
      7 s2=s(AA)
      8 print s.units
----> 9 print s2.units

AttributeError: 'TransientVariable' object has no attribute 'units'
doutriaux1 commented 7 years ago

actually loses all attributes from s