Ligand-Field Splittings on Core Levels of Main Group Compounds and Metal Surfaces from Photoelectron Spectra