From db4aabe89277f7d4e308a2ee98c0a98f0d642cb4 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Fri, 16 Oct 2020 11:53:27 +0200 Subject: [PATCH] Add vertical spans for integration borders --- pyzebra/app/panel_ccl_integrate.py | 11 +++++++++++ pyzebra/fit2.py | 1 + 2 files changed, 12 insertions(+) diff --git a/pyzebra/app/panel_ccl_integrate.py b/pyzebra/app/panel_ccl_integrate.py index 92b1672..8e8f4cf 100644 --- a/pyzebra/app/panel_ccl_integrate.py +++ b/pyzebra/app/panel_ccl_integrate.py @@ -23,6 +23,7 @@ from bokeh.models import ( RadioButtonGroup, Select, Spacer, + Span, Spinner, TableColumn, TextAreaInput, @@ -153,10 +154,14 @@ def create(): (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: plot_gauss_source.data.update(x=[], y=[]) plot_bkg_source.data.update(x=[], y=[]) fit_output_textinput.value = "" + numfit_min_span.location = None + numfit_max_span.location = None # Main plot plot = Plot( @@ -190,6 +195,12 @@ def create(): plot_circle_source = ColumnDataSource(dict(x=[], 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 def meas_table_callback(_attr, _old, new): if new: diff --git a/pyzebra/fit2.py b/pyzebra/fit2.py index 0b92550..a106b83 100644 --- a/pyzebra/fit2.py +++ b/pyzebra/fit2.py @@ -223,6 +223,7 @@ def fitccl( d["full_report"] = result.fit_report() d["result"] = result d["comps"] = comps + d["numfit"] = [numfit_min, numfit_max] meas["fit"] = d return data