Digital-holography refractive-index-profile measurement of phase gratings