Detailed analysis of refractive index effects produced by ion implantation