Make magnetic field and temperature optional
This commit is contained in:
@@ -83,8 +83,15 @@ def create():
|
||||
image_glyph.color_mapper.low = im_min
|
||||
image_glyph.color_mapper.high = im_max
|
||||
|
||||
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)
|
||||
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user