The measurement of spectra from X-ray machines