Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 7e16ea0f authored by usov_i's avatar usov_i
Browse files

Make magnetic field and temperature optional

parent 32d75988
No related branches found
No related tags found
No related merge requests found
......@@ -83,8 +83,15 @@ def create():
image_glyph.color_mapper.low = im_min
image_glyph.color_mapper.high = im_max
magnetic_field_spinner.value = det_data["magnetic_field"][index]
temperature_spinner.value = det_data["temperature"][index]
if "magnetic_field" in det_data:
magnetic_field_spinner.value = det_data["magnetic_field"][index]
else:
magnetic_field_spinner.value = None
if "temperature" in det_data:
temperature_spinner.value = det_data["temperature"][index]
else:
temperature_spinner.value = None
gamma, nu = calculate_pol(det_data, index)
omega = np.ones((IMAGE_H, IMAGE_W)) * det_data["rot_angle"][index]
......
......@@ -60,7 +60,12 @@ def read_detector_data(filepath):
det_data["chi_angle"] = h5f["/entry1/sample/chi"][:] # ch
det_data["phi_angle"] = h5f["/entry1/sample/phi"][:] # ph
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"][:]
# optional parameters
if "/entry1/sample/magnetic_field" in h5f:
det_data["magnetic_field"] = h5f["/entry1/sample/magnetic_field"][:]
if "/entry1/sample/temperature" in h5f:
det_data["temperature"] = h5f["/entry1/sample/temperature"][:]
return det_data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment