Solar and cosmic X-rays above 7.7 keV