Determination of the atomic and electronic structure of platinum catalysts by X-ray absorption spectroscopy