Structure Optical properties correlation on Er doped bulk and thin film glass glass ceramics by X Ray and optical methods