Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
3c619713d5 | |||
3d5a4ed6aa | |||
b2129805dc | |||
92765b5665 | |||
328b71e058 | |||
11ab8485bc | |||
4734b3e50f |
@ -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.6.0"
|
__version__ = "0.6.3"
|
||||||
|
@ -122,11 +122,7 @@ def create():
|
|||||||
file_list.append(os.path.basename(scan["original_filename"]))
|
file_list.append(os.path.basename(scan["original_filename"]))
|
||||||
|
|
||||||
scan_table_source.data.update(
|
scan_table_source.data.update(
|
||||||
file=file_list,
|
file=file_list, scan=scan_list, param=param, fit=[0] * len(scan_list), export=export,
|
||||||
scan=scan_list,
|
|
||||||
param=param,
|
|
||||||
fit=[0] * len(scan_list),
|
|
||||||
export=export,
|
|
||||||
)
|
)
|
||||||
scan_table_source.selected.indices = []
|
scan_table_source.selected.indices = []
|
||||||
scan_table_source.selected.indices = [0]
|
scan_table_source.selected.indices = [0]
|
||||||
@ -346,7 +342,7 @@ def create():
|
|||||||
mapper["transform"].high = np.max([np.max(y) for y in ys])
|
mapper["transform"].high = np.max([np.max(y) for y in ys])
|
||||||
ov_param_plot_scatter_source.data.update(x=x, y=y, param=par)
|
ov_param_plot_scatter_source.data.update(x=x, y=y, param=par)
|
||||||
|
|
||||||
if y:
|
try:
|
||||||
interp_f = interpolate.interp2d(x, y, par)
|
interp_f = interpolate.interp2d(x, y, par)
|
||||||
x1, x2 = min(x), max(x)
|
x1, x2 = min(x), max(x)
|
||||||
y1, y2 = min(y), max(y)
|
y1, y2 = min(y), max(y)
|
||||||
@ -358,7 +354,7 @@ def create():
|
|||||||
ov_param_plot_image_source.data.update(
|
ov_param_plot_image_source.data.update(
|
||||||
image=[image], x=[x1], y=[y1], dw=[x2 - x1], dh=[y2 - y1]
|
image=[image], x=[x1], y=[y1], dw=[x2 - x1], dh=[y2 - y1]
|
||||||
)
|
)
|
||||||
else:
|
except Exception:
|
||||||
ov_param_plot_image_source.data.update(image=[], x=[], y=[], dw=[], dh=[])
|
ov_param_plot_image_source.data.update(image=[], x=[], y=[], dw=[], dh=[])
|
||||||
|
|
||||||
def _update_param_plot():
|
def _update_param_plot():
|
||||||
@ -781,7 +777,7 @@ def create():
|
|||||||
export_data = []
|
export_data = []
|
||||||
param_data = []
|
param_data = []
|
||||||
for scan, param in zip(det_data, scan_table_source.data["param"]):
|
for scan, param in zip(det_data, scan_table_source.data["param"]):
|
||||||
if scan["export"]:
|
if scan["export"] and param:
|
||||||
export_data.append(scan)
|
export_data.append(scan)
|
||||||
param_data.append(param)
|
param_data.append(param)
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ def parse_1D(fileobj, data_type):
|
|||||||
while len(counts) < s["n_points"]:
|
while len(counts) < s["n_points"]:
|
||||||
counts.extend(map(float, next(fileobj).split()))
|
counts.extend(map(float, next(fileobj).split()))
|
||||||
s["counts"] = np.array(counts)
|
s["counts"] = np.array(counts)
|
||||||
s["counts_err"] = np.sqrt(s["counts"])
|
s["counts_err"] = np.sqrt(np.maximum(s["counts"], 1))
|
||||||
|
|
||||||
if s["h"].is_integer() and s["k"].is_integer() and s["l"].is_integer():
|
if s["h"].is_integer() and s["k"].is_integer() and s["l"].is_integer():
|
||||||
s["h"], s["k"], s["l"] = map(int, (s["h"], s["k"], s["l"]))
|
s["h"], s["k"], s["l"] = map(int, (s["h"], s["k"], s["l"]))
|
||||||
@ -208,7 +208,7 @@ def parse_1D(fileobj, data_type):
|
|||||||
for name in col_names:
|
for name in col_names:
|
||||||
s[name] = np.array(s[name])
|
s[name] = np.array(s[name])
|
||||||
|
|
||||||
s["counts_err"] = np.sqrt(s["counts"])
|
s["counts_err"] = np.sqrt(np.maximum(s["counts"], 1))
|
||||||
|
|
||||||
s["scan_motors"] = []
|
s["scan_motors"] = []
|
||||||
for motor, step in zip(motors, steps):
|
for motor, step in zip(motors, steps):
|
||||||
|
@ -131,7 +131,7 @@ def merge_scans(scan_into, scan_from):
|
|||||||
|
|
||||||
scan_into[scan_motor] = pos_tmp
|
scan_into[scan_motor] = pos_tmp
|
||||||
scan_into["counts"] = val_tmp / num_tmp
|
scan_into["counts"] = val_tmp / num_tmp
|
||||||
scan_into["counts_err"] = np.sqrt(err_tmp)
|
scan_into["counts_err"] = np.sqrt(err_tmp) / num_tmp
|
||||||
|
|
||||||
scan_from["export"] = False
|
scan_from["export"] = False
|
||||||
|
|
||||||
@ -220,8 +220,7 @@ def fit_scan(scan, model_dict, fit_from=None, fit_to=None):
|
|||||||
else:
|
else:
|
||||||
model += _model
|
model += _model
|
||||||
|
|
||||||
weights = [1 / y_err if y_err != 0 else 1 for y_err in y_err]
|
scan["fit"] = model.fit(y_fit, x=x_fit, weights=1 / y_err)
|
||||||
scan["fit"] = model.fit(y_fit, x=x_fit, weights=weights)
|
|
||||||
|
|
||||||
|
|
||||||
def get_area(scan, area_method, lorentz):
|
def get_area(scan, area_method, lorentz):
|
||||||
|
Reference in New Issue
Block a user