Add a temporary workaround for integral area
This commit is contained in:
parent
a2fceffc1b
commit
e99edbaf72
@ -371,7 +371,6 @@ def create():
|
|||||||
# ("Pseudo Voigt1", "pseudovoigt1"),
|
# ("Pseudo Voigt1", "pseudovoigt1"),
|
||||||
],
|
],
|
||||||
width=145,
|
width=145,
|
||||||
disabled=True,
|
|
||||||
)
|
)
|
||||||
fitparams_add_dropdown.on_click(fitparams_add_dropdown_callback)
|
fitparams_add_dropdown.on_click(fitparams_add_dropdown_callback)
|
||||||
|
|
||||||
@ -406,7 +405,7 @@ def create():
|
|||||||
|
|
||||||
fitparams_select.value = []
|
fitparams_select.value = []
|
||||||
|
|
||||||
fitparams_remove_button = Button(label="Remove fit function", width=145, disabled=True)
|
fitparams_remove_button = Button(label="Remove fit function", width=145)
|
||||||
fitparams_remove_button.on_click(fitparams_remove_button_callback)
|
fitparams_remove_button.on_click(fitparams_remove_button_callback)
|
||||||
|
|
||||||
def fitparams_factory(function):
|
def fitparams_factory(function):
|
||||||
|
@ -3,6 +3,7 @@ import re
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from scipy.integrate import simpson, trapezoid
|
||||||
|
|
||||||
META_VARS_STR = (
|
META_VARS_STR = (
|
||||||
"instrument",
|
"instrument",
|
||||||
@ -277,8 +278,12 @@ def export_1D(data, path, area_method=AREA_METHODS[0], lorentz=False, hkl_precis
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# no peak functions in a fit model
|
# no peak functions in a fit model
|
||||||
area_n = np.nan
|
# assume this is a background fit, so do numeric integration
|
||||||
area_s = np.nan
|
y_val = scan["Counts"]
|
||||||
|
x_val = scan[scan["scan_motor"]]
|
||||||
|
y_bkg = scan["fit"].eval(x=x_val)
|
||||||
|
area_n = simpson(y_val, x=x_val) - trapezoid(y_bkg, x=x_val)
|
||||||
|
area_s = np.sqrt(area_n)
|
||||||
|
|
||||||
# apply lorentz correction to area
|
# apply lorentz correction to area
|
||||||
if lorentz:
|
if lorentz:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user