Fitting functions for NEXAFS