Skip to content

Commit

Permalink
Change gamma in Lorentzian broadening to gamma/2
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxc66 committed Nov 6, 2023
1 parent dd590bd commit 6cccc69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lightshow/postprocess/broaden.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def lorentz_broaden(x, xin, yin, gamma):
yin : numpy.ndarray
The input spectrum.
gamma : float
Lorentzian broadening gamma.
Lorentzian broadening Gamma or the full-width at half-maximum (FWHM)
Returns
-------
Expand All @@ -63,7 +63,7 @@ def lorentz_broaden(x, xin, yin, gamma):

x1, x2 = np.meshgrid(x, xin)
dx = xin[-1] - xin[0]
return np.dot(cauchy.pdf(x1, x2, gamma).T, yin) / len(xin) * dx
return np.dot(cauchy.pdf(x1, x2, gamma / 2.0).T, yin) / len(xin) * dx


def voigt_broaden(x, xin, yin, sigma, gamma):
Expand Down
4 changes: 2 additions & 2 deletions notebooks/01_Ti_K_anatase_broaden.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@
"ax.plot(experimental_spectrum[:, 0], experimental_spectrum[:, 1], label='Experiment')\n",
"ax.plot(vasp_spectrum.spectrum[:, 0], vasp_spectrum.spectrum[:, 1], label='VASP')\n",
"ax.plot(x, vasp_spectrum_G_broadened, label=r'VASP (G; $\\sigma=1$)')\n",
"ax.plot(x, vasp_spectrum_L_broadened, label=r'VASP (L; $\\gamma=1$)')\n",
"ax.plot(x, vasp_spectrum_V_broadened, label=r'VASP (V; $\\gamma=\\sigma=0.5$)')\n",
"ax.plot(x, vasp_spectrum_L_broadened, label=r'VASP (L; $\\Gamma=1$)')\n",
"ax.plot(x, vasp_spectrum_V_broadened, label=r'VASP (V; $\\Gamma=\\sigma=0.5$)')\n",
"ax.plot(x, vasp_spectrum_EDV_broadened, label=r'VASP (EDV; $\\sigma=0.2;\\alpha=0.025$)')\n",
"\n",
"\n",
Expand Down

0 comments on commit 6cccc69

Please sign in to comment.