Spectroscopic measurement of an atomic wave function