Beam-foil level populations and charge-state fractions