Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1190 from DiamondLightSource/1189_correctly_set_r…
Browse files Browse the repository at this point in the history
…un_up_distance

Correctly set run up distance
  • Loading branch information
DominicOram authored Feb 29, 2024
2 parents d406cf4 + bfc189f commit ae78727
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def detect_grid_and_do_gridscan(
composite.oav.parameters,
experiment_params.exposure_time,
experiment_params.set_stub_offsets,
experiment_params.run_up_distance_mm,
)

@bpp.subs_decorator([oav_callback, grid_params_callback])
Expand Down
12 changes: 9 additions & 3 deletions src/hyperion/experiment_plans/panda_flyscan_xray_centre_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def run_gridscan_and_move(

LOGGER.info("Setting up Panda for flyscan")

assert isinstance(parameters.experiment_params, PandAGridScanParams)

run_up_distance_mm = yield from bps.rd(
fgs_composite.panda_fast_grid_scan.run_up_distance
)

# Set the time between x steps pv
DEADTIME_S = 1e-6 # according to https://www.dectris.com/en/detectors/x-ray-detectors/eiger2/eiger2-for-synchrotrons/eiger2-x/

Expand All @@ -183,15 +189,15 @@ def run_gridscan_and_move(
{sample_velocity_mm_per_s}. The smargon's speed limit is {smargon_speed_limit_mm_per_s} mm/s."
)
else:
LOGGER.info(f"Smargon speed set to {smargon_speed_limit_mm_per_s} mm/s")
LOGGER.info(
f"Panda grid scan: Smargon speed set to {smargon_speed_limit_mm_per_s} mm/s and using a run-up distance of {run_up_distance_mm}"
)

yield from bps.mv(
fgs_composite.panda_fast_grid_scan.time_between_x_steps_ms,
time_between_x_steps_ms,
)

assert isinstance(parameters.experiment_params, PandAGridScanParams)

yield from setup_panda_for_flyscan(
fgs_composite.panda,
PANDA_SETUP_PATH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ def __init__(
oav_params: OAVConfigParams,
exposure_time: float,
set_stub_offsets: bool,
run_up_distance_mm: float = 0.15,
*args,
) -> None:
super().__init__(*args)
self.exposure_time = exposure_time
self.set_stub_offsets = set_stub_offsets
self.oav_params = oav_params
self.run_up_distance_mm: float = run_up_distance_mm
self.start_positions: list = []
self.box_numbers: list = []

Expand Down Expand Up @@ -78,6 +80,7 @@ def get_grid_parameters(self) -> GridScanParams:

def get_panda_grid_parameters(self) -> PandAGridScanParams:
return PandAGridScanParams(
run_up_distance_mm=self.run_up_distance_mm,
x_start=self.start_positions[0][0],
y1_start=self.start_positions[0][1],
y2_start=self.start_positions[0][1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class GridScanWithEdgeDetectParams(AbstractExperimentParameterBase):
# Whether to set the stub offsets after centering
set_stub_offsets: bool = False

# Distance for the smargon to accelerate into the grid and decelerate out of the grid when using the panda
run_up_distance_mm: float = 0.15

use_panda: bool = False

def get_num_images(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class PinCentreThenXrayCentreParams(AbstractExperimentParameterBase):
# plugin
use_ophyd_pin_tip_detect: bool = False

# Distance for the smargon to accelerate into the grid and decelerate out of the grid when using the panda
run_up_distance_mm: float = 0.15

# Use constant motion panda scans instead of fast grid scans
use_panda: bool = False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class WaitForRobotLoadThenCentreParams(AbstractExperimentParameterBase):
omega_start: float
snapshot_dir: str
requested_energy_kev: Optional[float] = None

# Distance for the smargon to accelerate into the grid and decelerate out of the grid when using the panda
run_up_distance_mm: float = 0.15

# Use constant motion panda scans instead of fast grid scans
use_panda: bool = False

# Whether to use the ophyd device for tip centring rather than the area detector
Expand Down

0 comments on commit ae78727

Please sign in to comment.