Handle masked out values using a np.ma.array