Exemplo n.º 1
0
class TestWavelength(object):
    def setup_method(self):
        self.en = DummyPD('en')
        self.wl = Wavelength('wl', self.en)

    def testIt(self):
        self.en.asynchronousMoveTo(12.39842)
        assert self.wl.getPosition() == 1

        self.wl.asynchronousMoveTo(1.)
        assert self.wl.getPosition() == 1.
        assert self.en.getPosition() == 12.39842
Exemplo n.º 2
0
class TestWavelength(object):

    def setup_method(self):
        self.en = DummyPD('en')
        self.wl = Wavelength('wl', self.en)

    def testIt(self):
        self.en.asynchronousMoveTo(12.39842)
        assert self.wl.getPosition() == 1

        self.wl.asynchronousMoveTo(1.)
        assert self.wl.getPosition() == 1.
        assert self.en.getPosition() == 12.39842
class TestWavelength(unittest.TestCase):

    def setUp(self):
        self.en = DummyPD('en')
        self.wl = Wavelength('wl', self.en)

    def testIt(self):
        self.en.asynchronousMoveTo(12.39842)
        self.assertEqual(self.wl.getPosition(), 1)

        self.wl.asynchronousMoveTo(1.)
        self.assertEqual(self.wl.getPosition(), 1.)
        self.assertEqual(self.en.getPosition(), 12.39842)
Exemplo n.º 4
0
Hkl.dynamic_docstring = format_command_help(
    hkl_commands_for_help)  # must be on the class
ub.__doc__ = format_command_help(ub_commands_for_help)

if settings.include_reference:
    _virtual_angles = ('theta', 'ttheta', 'qaz', 'alpha', 'naz', 'tau', 'psi',
                       'beta', 'betain', 'betaout')
else:
    _virtual_angles = ('theta', 'ttheta', 'qaz', 'betain', 'betaout')
hklverbose = Hkl('hklverbose', _scn_group, _dc, _virtual_angles)

# Create wavelength scannable
wl = Wavelength('wl', _energy_scannable,
                settings.energy_scannable_multiplier_to_get_KeV)
if not GDA:
    wl.asynchronousMoveTo(1)  # Angstrom
_energy_scannable.level = 3
wl.level = 3

# Create simulated counter timer
ct = SimulatedCrystalCounter('ct', _scn_group, settings.geometry, wl)
ct.level = 10


# Create constraint scannables
def _create_constraint_scannable(con_name, scn_name=None):
    if not scn_name:
        scn_name = con_name
    return DiffractionCalculatorParameter(scn_name, con_name,
                                          _dc.constraint_manager)
Exemplo n.º 5
0
h = hkl.h
k = hkl.k
l = hkl.l

Hkl.dynamic_docstring = format_command_help(hkl_commands_for_help)  # must be on the class
ub.__doc__ = format_command_help(ub_commands_for_help)

_virtual_angles = ('theta', 'qaz', 'alpha', 'naz', 'tau', 'psi', 'beta')
hklverbose = Hkl('hklverbose', _scn_group, _dc, _virtual_angles)


# Create wavelength scannable
wl = Wavelength(
    'wl', _energy_scannable, settings.energy_scannable_multiplier_to_get_KeV)
if not GDA:
    wl.asynchronousMoveTo(1)  # Angstrom
_energy_scannable.level = 3
wl.level = 3


# Create simulated counter timer
ct = SimulatedCrystalCounter('ct', _scn_group, settings.geometry, wl)
ct.level = 10


# Create constraint scannables
def _create_constraint_scannable(con_name, scn_name=None):
    if not scn_name:
        scn_name = con_name
    return DiffractionCalculatorParameter(
        scn_name, con_name, _dc.constraint_manager)