Surface ionization of metastable calcium and ytterbium atoms