The 2p absorption spectra of 3d transition metal compounds in tetrahedral and octahedral symmetry