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