Display magnetic_field and temperature

This commit is contained in:
usov_i 2020-10-12 14:23:58 +02:00
parent a7bbe77b11
commit aae4783ef9
2 changed files with 12 additions and 1 deletions

View File

@ -83,6 +83,9 @@ def create():
image_glyph.color_mapper.low = im_min image_glyph.color_mapper.low = im_min
image_glyph.color_mapper.high = im_max image_glyph.color_mapper.high = im_max
magnetic_field_spinner.value = det_data["magnetic_field"][index]
temperature_spinner.value = det_data["temperature"][index]
def update_overview_plot(): def update_overview_plot():
h5_data = det_data["data"] h5_data = det_data["data"]
n_im, n_y, n_x = h5_data.shape n_im, n_y, n_x = h5_data.shape
@ -438,12 +441,18 @@ def create():
selection_button = Button(label="Add selection") selection_button = Button(label="Add selection")
selection_button.on_click(selection_button_callback) selection_button.on_click(selection_button_callback)
magnetic_field_spinner = Spinner(
title="Magnetic field:", format="0.00", width=145, disabled=True
)
temperature_spinner = Spinner(title="Temperature:", format="0.00", width=145, disabled=True)
# Final layout # Final layout
layout_image = column( layout_image = column(
gridplot([[proj_v, None], [plot, proj_h]], merge_tools=False), row(index_spinner) gridplot([[proj_v, None], [plot, proj_h]], merge_tools=False), row(index_spinner)
) )
colormap_layout = column(colormap, auto_toggle, display_max_spinner, display_min_spinner) colormap_layout = column(colormap, auto_toggle, display_max_spinner, display_min_spinner)
hkl_layout = column(radio_button_group, hkl_button) hkl_layout = column(radio_button_group, hkl_button)
params_layout = row(magnetic_field_spinner, temperature_spinner)
layout_overview = column( layout_overview = column(
gridplot( gridplot(
@ -461,7 +470,7 @@ def create():
layout_overview, layout_overview,
row(frame_button_group, selection_button, selection_list), row(frame_button_group, selection_button, selection_list),
), ),
column(roi_avg_plot, layout_image, row(colormap_layout, hkl_layout)), column(roi_avg_plot, layout_image, row(colormap_layout, column(params_layout, hkl_layout))),
) )
return Panel(child=tab_layout, title="Data Viewer") return Panel(child=tab_layout, title="Data Viewer")

View File

@ -60,6 +60,8 @@ def read_detector_data(filepath):
det_data["chi_angle"] = h5f["/entry1/sample/chi"][:] # ch det_data["chi_angle"] = h5f["/entry1/sample/chi"][:] # ch
det_data["phi_angle"] = h5f["/entry1/sample/phi"][:] # ph det_data["phi_angle"] = h5f["/entry1/sample/phi"][:] # ph
det_data["UB"] = h5f["/entry1/sample/UB"][:].reshape(3, 3) det_data["UB"] = h5f["/entry1/sample/UB"][:].reshape(3, 3)
det_data["magnetic_field"] = h5f["/entry1/sample/magnetic_field"][:]
det_data["temperature"] = h5f["/entry1/sample/temperature"][:]
return det_data return det_data