def fermat_master_plan(*args, exp_time=None, **kwargs): # Synchronize exposure times sclr1.preset_time.put(exp_time) xs.external_trig.put(False) xs.settings.acquire_time.put(exp_time) merlin.cam.acquire_time.put(exp_time) merlin.cam.acquire_period.put(exp_time + 0.005) scan_md = {} get_stock_md(scan_md) scan_md['scan']['merlin'] = { 'merlin_exp_time': exp_time, 'merlin_exp_period': exp_time + 0.005 } plan = bp.rel_spiral_fermat(*args, **kwargs) d = plot_raster_path(plan, args[1].name, args[2].name, probe_size=.001, lw=0.5) num_points = d['path'].get_path().vertices.shape[0] print(f"Number of points: {num_points}") xs.total_points.put(num_points) yield from bps.mv(merlin.total_points, num_points, merlin.hdf5.num_capture, num_points) merlin.hdf5.stage_sigs['num_capture'] = num_points yield from rel_spiral_fermat(*args, **kwargs, md=scan_md)
def _gen(self): return rel_spiral_fermat(self.detectors, self.x_motor, self.y_motor, self.x_range, self.y_range, self.dr, self.factor, tilt=self.tilt, md=self.md)
def test_simple_rel_spiral_fermat(): RE = RunEngine() hardware_x = yaqc_bluesky.Device(39423) hardware_y = yaqc_bluesky.Device(39424) sensor = yaqc_bluesky.Device(39425) RE( rel_spiral_fermat( [sensor], x_motor=hardware_x, y_motor=hardware_y, x_range=1, y_range=1, dr=0.5, factor=1, ))
def test_relative_fermat_spiral(RE, hw): start_x = 1.0 start_y = 1.0 motor1 = hw.motor1 motor2 = hw.motor2 det = hw.det motor1.set(start_x) motor2.set(start_y) scan = bp.rel_spiral_fermat([det], motor1, motor2, 1.0, 1.0, 0.1, 1.0, tilt=0.0) approx_multi_traj_checker(RE, scan, _get_fermat_data(start_x, start_y), decimal=2)
def fermat(*, detector, x_motor, y_motor, x_range=1, x_num=11, y_range=1, y_num=11, dr=0.1, factor=1, exposure_time=0.01, num_images=1): yield from bps.mv(detector.cam.num_images, num_images) yield from bps.mv(flyer.detector.cam.acquire_time, exposure_time) yield from rel_spiral_fermat([det], motor1, motor2, x_range=x_range, y_range=y_range, dr=dr, factor=factor, tilt=0.0)