Utilities for X-ray spectrometers