Measurement of refractive index