Sensing the refractive index gradient of the atmosphere