I've had to convert a cdms2 variable to a np.ma variable and the official way seems to use raw=1 (raw=True seems to work as well)
The best (and only?) documentation of this is in 2.10.9. Variable Methods(cont’d), but the documentation should be improved
-
The optional keyword argument raw specifies whether the return object is a variable or a masked array.
-
By default, a transient variable is returned, having the axes and attributes corresponding to 2,3 the region read. If raw=1, an MV2 masked array is returned, equivalent to the transient variable without the axis and attribute information.
- what is
2,3?
an MV2 masked array is returned => a numpy.ma array is returned
>>> type(model_data_a)
<class 'cdms2.tvariable.TransientVariable'>
>>> type(np.array(model_data_a))
<type 'numpy.ndarray'>
>>> type(model_data_a(raw=1))
<class 'numpy.ma.core.MaskedArray'>
>>> type(model_data_a(raw=True))
<class 'numpy.ma.core.MaskedArray'>
I've had to convert a cdms2 variable to a np.ma variable and the official way seems to use
raw=1(raw=Trueseems to work as well)The best (and only?) documentation of this is in 2.10.9. Variable Methods(cont’d), but the documentation should be improved
The optional keyword argument raw specifies whether the return object is a variable or a masked array.return=> returnedBy default, a transient variable is returned, having the axes and attributes corresponding to 2,3 the region read. If raw=1, an MV2 masked array is returned, equivalent to the transient variable without the axis and attribute information.2,3?an MV2 masked array is returned=> a numpy.ma array is returned