UPS and XPS spectra of CdF2 and SrF2 and interpretation of optical properties of these compounds