Refractive index measurement and calculation