Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
c8502a3b93 | |||
b84fc632aa | |||
3acd57adb9 |
@ -5,4 +5,4 @@ from pyzebra.h5 import *
|
|||||||
from pyzebra.utils import *
|
from pyzebra.utils import *
|
||||||
from pyzebra.xtal import *
|
from pyzebra.xtal import *
|
||||||
|
|
||||||
__version__ = "0.5.1"
|
__version__ = "0.5.2"
|
||||||
|
@ -10,6 +10,7 @@ from bokeh.layouts import column, row
|
|||||||
from bokeh.models import (
|
from bokeh.models import (
|
||||||
BasicTicker,
|
BasicTicker,
|
||||||
Button,
|
Button,
|
||||||
|
CellEditor,
|
||||||
CheckboxEditor,
|
CheckboxEditor,
|
||||||
CheckboxGroup,
|
CheckboxGroup,
|
||||||
ColumnDataSource,
|
ColumnDataSource,
|
||||||
@ -326,9 +327,9 @@ def create():
|
|||||||
scan_table = DataTable(
|
scan_table = DataTable(
|
||||||
source=scan_table_source,
|
source=scan_table_source,
|
||||||
columns=[
|
columns=[
|
||||||
TableColumn(field="scan", title="Scan", width=50),
|
TableColumn(field="scan", title="Scan", editor=CellEditor(), width=50),
|
||||||
TableColumn(field="hkl", title="hkl", width=100),
|
TableColumn(field="hkl", title="hkl", editor=CellEditor(), width=100),
|
||||||
TableColumn(field="fit", title="Fit", width=50),
|
TableColumn(field="fit", title="Fit", editor=CellEditor(), width=50),
|
||||||
TableColumn(field="export", title="Export", editor=CheckboxEditor(), width=50),
|
TableColumn(field="export", title="Export", editor=CheckboxEditor(), width=50),
|
||||||
],
|
],
|
||||||
width=310, # +60 because of the index column
|
width=310, # +60 because of the index column
|
||||||
@ -464,7 +465,7 @@ def create():
|
|||||||
fitparams_table = DataTable(
|
fitparams_table = DataTable(
|
||||||
source=fitparams_table_source,
|
source=fitparams_table_source,
|
||||||
columns=[
|
columns=[
|
||||||
TableColumn(field="param", title="Parameter"),
|
TableColumn(field="param", title="Parameter", editor=CellEditor()),
|
||||||
TableColumn(field="value", title="Value", editor=NumberEditor()),
|
TableColumn(field="value", title="Value", editor=NumberEditor()),
|
||||||
TableColumn(field="vary", title="Vary", editor=CheckboxEditor()),
|
TableColumn(field="vary", title="Vary", editor=CheckboxEditor()),
|
||||||
TableColumn(field="min", title="Min", editor=NumberEditor()),
|
TableColumn(field="min", title="Min", editor=NumberEditor()),
|
||||||
|
@ -10,6 +10,7 @@ from bokeh.models import (
|
|||||||
BasicTicker,
|
BasicTicker,
|
||||||
BoxZoomTool,
|
BoxZoomTool,
|
||||||
Button,
|
Button,
|
||||||
|
CellEditor,
|
||||||
CheckboxGroup,
|
CheckboxGroup,
|
||||||
ColumnDataSource,
|
ColumnDataSource,
|
||||||
DataRange1d,
|
DataRange1d,
|
||||||
@ -210,7 +211,7 @@ def create():
|
|||||||
scan_table = DataTable(
|
scan_table = DataTable(
|
||||||
source=scan_table_source,
|
source=scan_table_source,
|
||||||
columns=[
|
columns=[
|
||||||
TableColumn(field="file", title="file", width=150),
|
TableColumn(field="file", title="file", editor=CellEditor(), width=150),
|
||||||
TableColumn(
|
TableColumn(
|
||||||
field="param",
|
field="param",
|
||||||
title="param",
|
title="param",
|
||||||
@ -218,9 +219,15 @@ def create():
|
|||||||
editor=NumberEditor(),
|
editor=NumberEditor(),
|
||||||
width=50,
|
width=50,
|
||||||
),
|
),
|
||||||
TableColumn(field="frame", title="Frame", formatter=num_formatter, width=70),
|
TableColumn(
|
||||||
TableColumn(field="x_pos", title="X", formatter=num_formatter, width=70),
|
field="frame", title="Frame", formatter=num_formatter, editor=CellEditor(), width=70
|
||||||
TableColumn(field="y_pos", title="Y", formatter=num_formatter, width=70),
|
),
|
||||||
|
TableColumn(
|
||||||
|
field="x_pos", title="X", formatter=num_formatter, editor=CellEditor(), width=70
|
||||||
|
),
|
||||||
|
TableColumn(
|
||||||
|
field="y_pos", title="Y", formatter=num_formatter, editor=CellEditor(), width=70
|
||||||
|
),
|
||||||
],
|
],
|
||||||
width=470, # +60 because of the index column
|
width=470, # +60 because of the index column
|
||||||
height=420,
|
height=420,
|
||||||
|
@ -11,6 +11,7 @@ from bokeh.layouts import column, row
|
|||||||
from bokeh.models import (
|
from bokeh.models import (
|
||||||
BasicTicker,
|
BasicTicker,
|
||||||
Button,
|
Button,
|
||||||
|
CellEditor,
|
||||||
CheckboxEditor,
|
CheckboxEditor,
|
||||||
CheckboxGroup,
|
CheckboxGroup,
|
||||||
ColumnDataSource,
|
ColumnDataSource,
|
||||||
@ -494,10 +495,10 @@ def create():
|
|||||||
scan_table = DataTable(
|
scan_table = DataTable(
|
||||||
source=scan_table_source,
|
source=scan_table_source,
|
||||||
columns=[
|
columns=[
|
||||||
TableColumn(field="file", title="file", width=150),
|
TableColumn(field="file", title="file", editor=CellEditor(), width=150),
|
||||||
TableColumn(field="scan", title="scan", width=50),
|
TableColumn(field="scan", title="scan", editor=CellEditor(), width=50),
|
||||||
TableColumn(field="param", title="param", editor=NumberEditor(), width=50),
|
TableColumn(field="param", title="param", editor=NumberEditor(), width=50),
|
||||||
TableColumn(field="fit", title="Fit", width=50),
|
TableColumn(field="fit", title="Fit", editor=CellEditor(), width=50),
|
||||||
TableColumn(field="export", title="Export", editor=CheckboxEditor(), width=50),
|
TableColumn(field="export", title="Export", editor=CheckboxEditor(), width=50),
|
||||||
],
|
],
|
||||||
width=410, # +60 because of the index column
|
width=410, # +60 because of the index column
|
||||||
@ -624,7 +625,7 @@ def create():
|
|||||||
fitparams_table = DataTable(
|
fitparams_table = DataTable(
|
||||||
source=fitparams_table_source,
|
source=fitparams_table_source,
|
||||||
columns=[
|
columns=[
|
||||||
TableColumn(field="param", title="Parameter"),
|
TableColumn(field="param", title="Parameter", editor=CellEditor()),
|
||||||
TableColumn(field="value", title="Value", editor=NumberEditor()),
|
TableColumn(field="value", title="Value", editor=NumberEditor()),
|
||||||
TableColumn(field="vary", title="Vary", editor=CheckboxEditor()),
|
TableColumn(field="vary", title="Vary", editor=CheckboxEditor()),
|
||||||
TableColumn(field="min", title="Min", editor=NumberEditor()),
|
TableColumn(field="min", title="Min", editor=NumberEditor()),
|
||||||
|
@ -147,6 +147,10 @@ def fit_scan(scan, model_dict, fit_from=None, fit_to=None):
|
|||||||
|
|
||||||
# apply fitting range
|
# apply fitting range
|
||||||
fit_ind = (fit_from <= x_fit) & (x_fit <= fit_to)
|
fit_ind = (fit_from <= x_fit) & (x_fit <= fit_to)
|
||||||
|
if not np.any(fit_ind):
|
||||||
|
print(f"No data in fit range for scan {scan['idx']}")
|
||||||
|
return
|
||||||
|
|
||||||
y_fit = y_fit[fit_ind]
|
y_fit = y_fit[fit_ind]
|
||||||
y_err = y_err[fit_ind]
|
y_err = y_err[fit_ind]
|
||||||
x_fit = x_fit[fit_ind]
|
x_fit = x_fit[fit_ind]
|
||||||
@ -201,6 +205,9 @@ def fit_scan(scan, model_dict, fit_from=None, fit_to=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_area(scan, area_method, lorentz):
|
def get_area(scan, area_method, lorentz):
|
||||||
|
if "fit" not in scan:
|
||||||
|
return
|
||||||
|
|
||||||
if area_method not in AREA_METHODS:
|
if area_method not in AREA_METHODS:
|
||||||
raise ValueError(f"Unknown area method: {area_method}.")
|
raise ValueError(f"Unknown area method: {area_method}.")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user