Calculation of radioactivity induced in gamma-ray spectrometers during spaceflight