Open jypeter opened 5 years ago
@jypeter what about numpy_var = cdmsvar.asma()
if masked or numpy_var = cdms_var.filled(-999)
if no missing needed.
asma()
sounds nice, but there is little documentation for it. I searched the cdms2 documentation and the only useful ref I found was in cdms2.tvariable module which may not be a place that an end user is likely to visit
As a matter of fact, I had never been on that page! Should there be some kind of link to this from 2.3. Cdms Module ?
And maybe asma should also be documented in 2.3. Cdms Module
I have extracted below a page from my old 2007 CDAT tutorial. It's in French (@dnadeau4 that's for you!), but it shows how the different data objects from files/python/Numeric/CDAT relate to each other, and which functions you can use to go from one type of data to the other. Maybe there could be a similar (and updated!) Data Overview Page (a good DOPe) on the CDAT site? Showing that asma can be used to go from and MV2 var to a numpy.ma var
Once again, I had to convert an MV2 array to numpy.ma array before calling matplotlib, using the possibly under-documented
raw=1
feature (https://github.com/CDAT/cdms/issues/338)I was lucky to remember that trick, because it was either that or deal with a quite obscure and unrelated matplotlib traceback
Or maybe there is an easy fix in the cdms2 (masked) variables to make them compatible with matplotlib?
Anyway it's probably easy and useful to create a short notebook to illustrate this