Effect of spatial averaging on the compositional analysis of crystals by absorption spectroscopy