masked array 3 dim code example Example: apply 2d mask to 3d array python field3d_mask = np.broadcast_to(field2d > 0.3, field3d.shape)