dmarrays do not convert to np.ma.masked_arrays properly. Specifically, the self.min/max methods fail once converted. This is especially problematic when trying to perform matplotlib contour plots using dmarrays, as the Z-variable handed to the contour function is converted to a masked array to weed out invalid values.
import numpy as np
from spacepy.datamodel import dmarray
x = dmarray(np.arange(10))
x.min() # Works fine.
x2 = np.ma.masked_array(x)
x3 = np.ma.masked_array( np.array(x) )
x3.min() # works.
Log in to post a comment.