Measurement of the refractive index of a liquid