Add vertical spans for integration borders

This commit is contained in:
usov_i 2020-10-16 11:53:27 +02:00
parent cf8f19f6d9
commit db4aabe892
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@ from bokeh.models import (
RadioButtonGroup, RadioButtonGroup,
Select, Select,
Spacer, Spacer,
Span,
Spinner, Spinner,
TableColumn, TableColumn,
TextAreaInput, TextAreaInput,
@ -153,10 +154,14 @@ def create():
(params["g_amp"].value - fit["int_area"].n) / params["g_amp"].value, (params["g_amp"].value - fit["int_area"].n) / params["g_amp"].value,
) )
) )
numfit_min_span.location = x[fit["numfit"][0]]
numfit_max_span.location = x[fit["numfit"][1]]
else: else:
plot_gauss_source.data.update(x=[], y=[]) plot_gauss_source.data.update(x=[], y=[])
plot_bkg_source.data.update(x=[], y=[]) plot_bkg_source.data.update(x=[], y=[])
fit_output_textinput.value = "" fit_output_textinput.value = ""
numfit_min_span.location = None
numfit_max_span.location = None
# Main plot # Main plot
plot = Plot( plot = Plot(
@ -190,6 +195,12 @@ def create():
plot_circle_source = ColumnDataSource(dict(x=[], y=[])) plot_circle_source = ColumnDataSource(dict(x=[], y=[]))
plot.add_glyph(plot_circle_source, Circle(x="x", y="y")) plot.add_glyph(plot_circle_source, Circle(x="x", y="y"))
numfit_min_span = Span(location=None, dimension='height', line_dash='dashed')
plot.add_layout(numfit_min_span)
numfit_max_span = Span(location=None, dimension='height', line_dash='dashed')
plot.add_layout(numfit_max_span)
# Measurement select # Measurement select
def meas_table_callback(_attr, _old, new): def meas_table_callback(_attr, _old, new):
if new: if new:

View File

@ -223,6 +223,7 @@ def fitccl(
d["full_report"] = result.fit_report() d["full_report"] = result.fit_report()
d["result"] = result d["result"] = result
d["comps"] = comps d["comps"] = comps
d["numfit"] = [numfit_min, numfit_max]
meas["fit"] = d meas["fit"] = d
return data return data