Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions mxcubecore/HardwareObjects/GenericDiffractometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""

import ast
import contextlib
import copy
import enum
import json
Expand Down Expand Up @@ -974,15 +975,15 @@ def start_move_to_beam(
self.current_centring_method = None
self.current_centring_procedure = None
except Exception:
logging.exception("Diffractometer: Could not complete 2D centring")
self.log.exception("Diffractometer: Could not complete 2D centring")

def centring_done(self, centring_procedure):
try:
motor_pos = centring_procedure.get()
if isinstance(motor_pos, gevent.GreenletExit):
raise motor_pos
except Exception:
logging.exception("Could not complete centring")
self.log.exception("Could not complete centring")
self.emit_centring_failed()
else:
self.emit_progress_message("Moving sample to centred position...")
Expand All @@ -994,7 +995,7 @@ def centring_done(self, centring_procedure):
)
self.move_to_motors_positions(motor_pos, wait=True)
except Exception:
logging.exception("Could not move to centred position")
self.log.exception("Could not move to centred position")
self.emit_centring_failed()
else:
# if 3 click centring move -180. well. dont, in principle the calculated
Expand Down Expand Up @@ -1065,7 +1066,7 @@ def motor_positions_to_screen(self, centred_positions_dict):
)
rot_matrix.shape = (2, 2)
inv_rot_matrix = numpy.array(rot_matrix.I)
dx, dy = (
_dx, dy = (
numpy.dot(numpy.array([sampx, sampy]), inv_rot_matrix)
* self.pixels_per_mm_x
)
Expand Down Expand Up @@ -1385,14 +1386,12 @@ def head_type_changed(self, head_type):

if "SampleIsLoaded" not in str(self.used_channels_list):
return
try:
with contextlib.suppress(Exception):
self.disconnect(
self.channel_dict["SampleIsLoaded"],
"update",
self.sample_is_loaded_changed,
)
except Exception:
self.log.exception("")

if (
head_type == GenericDiffractometer.HEAD_TYPE_MINIKAPPA
Expand Down