def test_hard_limit_throws_off_fsm(self): m = LinearMotor() with self.assertRaises(HardLimitError): m.position = 5 * q.m m.position = 2 * q.mm
def test_hard_limit_throws_off_fsm(self): m = LinearMotor(upper_hard_limit=3 * q.mm) with self.assertRaises(HardLimitError): m.position = 5 * q.m m.position = 2 * q.mm
class TestMotor(TestCase): def setUp(self): super(TestMotor, self).setUp() self.motor = LinearMotor() def test_set_position(self): position = 1 * q.mm self.motor.position = position self.assertEqual(position, self.motor.position) def test_move(self): position = 1 * q.mm delta = 0.5 * q.mm self.motor.position = position self.motor.move(delta).join() self.assertEqual(position + delta, self.motor.position)
def setUp(self): self.source = None self.exp = None self.flatfield_axis = LinearMotor() self.flatfield_axis.motion_velocity = 10000 * q.mm / q.s self.camera = LoggingCamera(flat_axis=self.flatfield_axis) self._data_dir = tempfile.mkdtemp() self.walker = DirectoryWalker(root=self._data_dir)
async def run(): other = LinearMotor() scanned = [] async for pair in scan((self.motor['position'], other['position']), (values_0, values_1), self.feedback): vec, res = pair scanned.append((vec[0], vec[1], res)) return scanned
def get_axes(): """Get all the dummy axes.""" x_lin = LinearMotor() y_lin = LinearMotor() z_lin = LinearMotor() x_rot = RotationMotor() y_rot = RotationMotor() z_rot = RotationMotor() x_lin_axis = base.Axis('x', x_lin) y_lin_axis = base.Axis('y', y_lin, direction=-1) z_lin_axis = base.Axis('z', z_lin) x_rot_axis = base.Axis('x', x_rot) y_rot_axis = base.Axis('y', y_rot) z_rot_axis = base.Axis('z', z_rot, direction=-1) return (x_lin_axis, y_lin_axis, z_lin_axis, x_rot_axis, y_rot_axis, z_rot_axis)
def setUp(self): Radiography.setUp(self) self.tomo_motor = RotationMotor() self.tomo_motor.motion_velocity = 20000 * q.deg / q.s self.vertical_motor = LinearMotor() self.vertical_motor.motion_velocity = 10000 * q.mm / q.s self.camera.tomo_axis = self.tomo_motor self.camera.vertical_axis = self.vertical_motor
def setUp(self): super(TestDummyFocusingWithSoftLimits, self).setUp() self.motor = LinearMotor(position=50 * q.mm) self.motor['position'].lower = 25 * q.mm self.motor['position'].upper = 75 * q.mm self.halver_kwargs = { "initial_step": 10 * q.mm, "max_iterations": 1000 }
def setUp(self): super(TestOptimizers, self).setUp() self.algorithms = [optimization.halver, optimization.down_hill, optimization.powell, optimization.nonlinear_conjugate, optimization.bfgs, optimization.least_squares] self.center = 1.0 * q.mm self.motor = LinearMotor(position=0 * q.mm) self.motor.lower = -float('Inf') * q.mm self.motor.upper = float('Inf') * q.mm
def setUp(self): super(TestDummyFocusing, self).setUp() self.motor = LinearMotor(upper_hard_limit=2000 * q.mm, lower_hard_limit=-2000 * q.mm) self.motor.position = 0 * q.mm self.feedback = DummyGradientMeasure(self.motor['position'], 18.75 * q.mm, negative=True) self.epsilon = 1 * q.um self.position_eps = 1e-1 * q.mm self.gradient_cmp_eps = 1e-1 self.halver_kwargs = { "initial_step": 10 * q.mm, "max_iterations": 3000 }
def setUp(self): self.seq = list(range(10)) self.camera = Camera() self.linear_motor = LinearMotor() self.linear_motor2 = LinearMotor() self.rotation_motor = RotationMotor()
def setUp(self): super(TestScan, self).setUp() self.motor = LinearMotor()
def setUp(self): self.motor = LinearMotor() self.camera = Camera() self.shutter = Shutter()
def setUp(self): super(TestAxis, self).setUp() self.motor = LinearMotor() self.motor.position = 0 * q.mm
def setUp(self): super(TestMotor, self).setUp() self.motor = LinearMotor()