def BB(ω): #ω: eV ε = 1 - Ωp**2 / (ω * (ω + 1j * Γ0)) α = (ω**2 + 1j * ω * Γ1)**.5 za = (α - ω1) / (2**.5 * σ1) zb = (α + ω1) / (2**.5 * σ1) ε += 1j * π**.5 * f1 * ωp**2 / (2**1.5 * α * σ1) * (w(za) + w(zb)) #χ1 α = (ω**2 + 1j * ω * Γ2)**.5 za = (α - ω2) / (2**.5 * σ2) zb = (α + ω2) / (2**.5 * σ2) ε += 1j * π**.5 * f2 * ωp**2 / (2**1.5 * α * σ2) * (w(za) + w(zb)) #χ2 α = (ω**2 + 1j * ω * Γ3)**.5 za = (α - ω3) / (2**.5 * σ3) zb = (α + ω3) / (2**.5 * σ3) ε += 1j * π**.5 * f3 * ωp**2 / (2**1.5 * α * σ3) * (w(za) + w(zb)) #χ3 α = (ω**2 + 1j * ω * Γ4)**.5 za = (α - ω4) / (2**.5 * σ4) zb = (α + ω4) / (2**.5 * σ4) ε += 1j * π**.5 * f4 * ωp**2 / (2**1.5 * α * σ4) * (w(za) + w(zb)) #χ4 α = (ω**2 + 1j * ω * Γ5)**.5 za = (α - ω5) / (2**.5 * σ5) zb = (α + ω5) / (2**.5 * σ5) ε += 1j * π**.5 * f5 * ωp**2 / (2**1.5 * α * σ5) * (w(za) + w(zb)) #χ5 return ε
def NormalizedVoigt(x, *params): """ The Voigt function. The result of the convolution of a Lorentzian with one or more Gaussians. Often used to describe an intrinsically Lorentzian absorption profile blurred by Gaussian broadening from thermal motions and turbulance and another Gaussian instrument profile. The result is also the real part of the Faddevva function (the complex probability function), implemented by Scipy as wofz in scipy.special This returns a normalized profile. The name `NormalizedVoigt` is to keep the convention for the rest of this module. The amplitude controlling Voigt profile `Voigt` evaluates this function first for `x - x0 = 0` to empirically `un-normalize` it before scaling by the requested amplitude Reference: Olivero, J.J; R.L. Longbothum. ``Empirical fits to the Voigt line width: A brief review''. Journal of Quantitative Spectroscopy and Radiative Transfer. Vol 17. Issue 2. pages 223-236. Feb 1977 Parameters: `x0, sigma, gamma = params` x0 -> center of the profile sigma -> the Gaussian width gamma -> the Lorentzian width """ x0, sigma, gamma = params return w( ((x-x0) + 1j*gamma) / (sigma * np.sqrt(np.pi)) ).real / ( sigma * np.sqrt(2 * np.pi) )
def BB(wl): #wl: eV e = 1 - Omp**2 / (wl * (wl + 1j * L0)) a = (wl**2 + 1j * wl * L1)**.5 za = (a - w1) / (2**.5 * o1) zb = (a + w1) / (2**.5 * o1) e += 1j * p**.5 * f1 * wp**2 / (2**1.5 * a * o1) * (w(za) + w(zb)) #x1 a = (wl**2 + 1j * wl * L2)**.5 za = (a - w2) / (2**.5 * o2) zb = (a + w2) / (2**.5 * o2) e += 1j * p**.5 * f2 * wp**2 / (2**1.5 * a * o2) * (w(za) + w(zb)) #x2 a = (wl**2 + 1j * wl * L3)**.5 za = (a - w3) / (2**.5 * o3) zb = (a + w3) / (2**.5 * o3) e += 1j * p**.5 * f3 * wp**2 / (2**1.5 * a * o3) * (w(za) + w(zb)) #x3 a = (wl**2 + 1j * wl * L4)**.5 za = (a - w4) / (2**.5 * o4) zb = (a + w4) / (2**.5 * o4) e += 1j * p**.5 * f4 * wp**2 / (2**1.5 * a * o4) * (w(za) + w(zb)) #x4 return e
def bv(f, f0, b0, T, s): ''' Function representing convolution of the lorentzian line shape of the red transition and gaussian maxwell distribution. This is taken from 5.13 from Chang chi's thesis and added the effect of saturation parameter. Args: f: numpy.array, frequency vector f0: float, resonance frequency or centre of the spectrum b0: float, optical depth at resonance at zero temperature T: float, temperature in micro K s: float, saturation parameter of the probe, :math:`I/I_s`. Returns: optical depth for frequencies f in the shape f. ''' gamma = 2 * pi * 7.5 * milli vavg = np.sqrt(T * micro * Boltzmann / (87 * m_p)) k = 2 * pi / (689 * nano) x = w((2 * pi * (f - f0) + 1j * gamma * np.sqrt(1 + s) / 2) * 1e6 / (np.sqrt(2) * k * vavg)) return b0 * np.sqrt(pi / 8) * (1 / (1 + s)) * (gamma * np.sqrt(1 + s) * 1e6 / (k * vavg)) * x.real