def spline(self):
        """
        Fit spline to energy trend data.
        """
        from scipy.interpolate import UnivariateSpline
        sp = UnivariateSpline(range(len(self.energies)), self.energies, k=4)
        return sp