DAQ: bug fix after raster where smargon tried to nudge with None, None.
This commit is contained in:
+16
-8
@@ -425,8 +425,10 @@ class AareDAQ:
|
||||
|
||||
def __raster(self, r: RasterGridRequest) -> CompletedRasterGridElem:
|
||||
max_time = r.exp_time_s * r.n_y * r.n_x + 60
|
||||
|
||||
if r.dtz is not None:
|
||||
self.__cfg.dtz = r.dtz
|
||||
|
||||
self.__set_state(BeamlineStateEnum.DataCollection)
|
||||
|
||||
save_smargon_position = self.__devs.smargon.readback
|
||||
@@ -494,15 +496,21 @@ class AareDAQ:
|
||||
print(f"using old method as COM is none or nan")
|
||||
grid_mm_x, grid_mm_y = identify_crystal_raster(result, r)
|
||||
|
||||
if r.n_x == 1:
|
||||
new_delta_mm = self.sample_geometry.smargon_nudge(Coordinate(x=0, y=grid_mm_y))
|
||||
if grid_mm_x or grid_mm_y:
|
||||
|
||||
if r.n_x == 1:
|
||||
new_delta_mm = self.sample_geometry.smargon_nudge(Coordinate(x=0, y=grid_mm_y))
|
||||
|
||||
else:
|
||||
result_list = get_result_list_from_com(images, com)
|
||||
print(result_list)
|
||||
self.last_best_b_factor = get_best_b_factor(result_list)
|
||||
self.last_best_res = get_best_res(result_list)
|
||||
print("b_factor: ", self.last_best_b_factor, " best_res: ", self.last_best_res)
|
||||
new_delta_mm = self.sample_geometry.smargon_nudge(Coordinate(x=grid_mm_x, y=grid_mm_y))
|
||||
|
||||
else:
|
||||
result_list = get_result_list_from_com(images, com)
|
||||
print(result_list)
|
||||
self.last_best_b_factor = get_best_b_factor(result_list)
|
||||
self.last_best_res = get_best_res(result_list)
|
||||
print("b_factor: ", self.last_best_b_factor, " best_res: ", self.last_best_res)
|
||||
new_delta_mm = self.sample_geometry.smargon_nudge(Coordinate(x=grid_mm_x, y=grid_mm_y))
|
||||
new_delta_mm = None
|
||||
|
||||
print('after centre_of_mass')
|
||||
if new_delta_mm is not None:
|
||||
|
||||
Reference in New Issue
Block a user