def test_absolute_fermat_spiral(RE, hw): motor1 = hw.motor1 motor2 = hw.motor2 det = hw.det motor1.set(1.0) motor2.set(1.0) scan = bp.spiral_fermat([det], motor1, motor2, 0.0, 0.0, 1.0, 1.0, 0.1, 1.0, tilt=0.0) approx_multi_traj_checker(RE, scan, _get_fermat_data(0.0, 0.0), decimal=2) scan = bp.spiral_fermat([det], motor1, motor2, 0.5, 0.5, 1.0, 1.0, 0.1, 1.0, tilt=0.0) approx_multi_traj_checker(RE, scan, _get_fermat_data(0.5, 0.5), decimal=2)
def _gen(self): return spiral_fermat(self.detectors, self.x_motor, self.y_motor, self.x_start, self.y_start, self.x_range, self.y_range, self.dr, self.factor, tilt=self.tilt, md=self.md)
def absolute_fermat(dets, x_motor, y_motor, x_start, y_start, x_range, y_range, dr, factor, time=None, *, per_step=None, md=None, tilt=0.0): cyc = plan_patterns.spiral_fermat(x_motor, y_motor, x_motor.position, y_motor.position, x_range, y_range, dr, factor, tilt=tilt) total_points = len(cyc) yield from _pre_scan(dets, total_points=total_points, count_time=time) return (yield from plans.spiral_fermat(dets, x_motor, y_motor, x_start, y_start, x_range, y_range, dr, factor, per_step=per_step, md=md, tilt=tilt))
def test_simple_spiral_fermat(): RE = RunEngine() hardware_x = yaqc_bluesky.Device(39423) hardware_y = yaqc_bluesky.Device(39424) sensor = yaqc_bluesky.Device(39425) RE( spiral_fermat( [sensor], x_motor=hardware_x, y_motor=hardware_y, x_start=0, y_start=0, x_range=1, y_range=1, dr=0.5, factor=1, ))
from bluesky.simulators import plot_raster_path from ophyd.sim import motor1, motor2, det from bluesky.plans import spiral_fermat plan = spiral_fermat([det], motor1, motor2, x_start=0.0, y_start=0.0, x_range=2.0, y_range=2.0, dr=0.1, factor=2.0, tilt=0.0) plot_raster_path(plan, 'motor1', 'motor2', probe_size=.01, lw=0.1)