Measuring the refractive index gradient of the atmosphere