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