calculate refractive index for X-rays