A refraction correction for buried interfaces applied to in situ grazing-incidence X-ray diffraction studies on Pd electrodes