Measurement of refractive indices and their dispersion