Lorentzian line-shape function

   Parameters
   ----------
   freq : float or float array
      The frequencies for which the function is evaluated

   freq0 : float
      The center frequency of the function

   area : float

   hwhm: float
      Half-width at half-max

def lorentzian(freq, freq0, area, hwhm, phase, offset, drift):
   """
   Lorentzian line-shape function

   Parameters
   ----------
   freq : float or float array
      The frequencies for which the function is evaluated

   freq0 : float
      The center frequency of the function

   area : float

   hwhm: float
      Half-width at half-max       

   """
   oo2pi = 1/(2*np.pi)
   df = freq - freq0
   absorptive = oo2pi * area * np.ones(freq.shape[0])*(hwhm / (df**2 + hwhm**2))
   dispersive = oo2pi * area * df/(df**2 + hwhm**2)
   return (absorptive * np.cos(phase) + dispersive * np.sin(phase) + offset +
   drift * freq)