Scrap the ```np.ma.count_masked(cube)```. It'll cause issues if data in the cube's masked array is subsequently masked because the corresponding pandas object will not get NaNs inserted thus breaking the "sharing".