-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axis units in .attributes and .units not equal #246
Comments
@stefraynaud can you provide a bit of code when you use |
In the example below, the presence of the following 3 lines make the ax.long_name = "time in seconds (UT)"
ax.time_origin = "01-JAN-1900 00:00:00"
ax.designateTime() import MV2, cdms2
tmp = MV2.ones(3, id='tmp')
ax = tmp.getAxis(0)
ax.standard_name = "time"
ax.id = 'time'
ax.units = "seconds since 1900-01-01T00:00:00Z"
ax.long_name = "time in seconds (UT)"
ax.time_origin = "01-JAN-1900 00:00:00"
ax.designateTime()
f = cdms2.open('tmp.nc', 'w')
f.write(tmp)
f.close()
f = cdms2.open('tmp.nc')
assert f['time'].clone().units != f['time'].units |
@stefraynaud thanks for this. |
@durack1 if you want to try it you can create a new environment with the "unstable" channel that was created with this PR
|
@dnadeau4 ok will give it a go, interesting that the command above doesn't pull down the
|
@dnadeau4 looks great, #263 is closed by #267.
And for py2:
|
Hi,
file axis units are not synched between the
.attributes
dict and the.units
attributes, which make calls toclone
set "units" to "".Its seems due to :
cufile.dimensioninfo[name] = ('', .....)
self.__dict__['_units'] = units
whereunits
is the first items ofdimensioninfo
, which is always''
, andatt['units'] = units
.This is particularly problematic for time axes...
The text was updated successfully, but these errors were encountered: