This code is based on work done in the specio package. The code has been refactored by colleagues at the
Diamond synchrotron.