Exemplo n.º 1
0
    def setup_method(self):

        hardware = Mock()
        hardware.get_axes_names.return_value = ('m', 'd', 'n', 'e', 'c', 'p')
        self.ubcalc = UBCalculation(hardware, SixCircle(),
                                    UbCalculationNonPersister(),
                                    YouUbCalcStrategy())
Exemplo n.º 2
0
 def setup_method(self):
     TestUBCommandsYou.setup_method(self)
     inv = matrix([[0, 0, 1], [0, 1, 0], [1, 0, 0]])
     self.xrot = xyz_rotation([1, 0, 0], 30. * TORAD)
     self.t_matrix = inv * self.xrot
     self.t_hand = -1
     settings.geometry = SixCircle(beamline_axes_transform=self.t_matrix.I)
Exemplo n.º 3
0
 def setup_method(self):
     settings.ubcalc_persister = self._createPersister()
     settings.geometry = SixCircle()
     settings.ubcalc_strategy = YouUbCalcStrategy()
     settings.angles_to_hkl_function = youAnglesToHkl
     settings.Pos = YouPositionScenario
     self.t_matrix = matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
     self.t_hand = 1
     _UBCommandsBase.setup_method(self)
Exemplo n.º 4
0
 def setup_method(self):
     geometry = SixCircle()  # pass through
     hardware = Mock()
     names = 'm', 'd', 'n', 'e', 'c', 'p'
     hardware.get_axes_names.return_value = names
     self.ubcalc = UBCalculation(hardware,
                                 geometry,
                                 UbCalculationNonPersister(),
                                 YouUbCalcStrategy())
    def setup_method(self):

        hardware = Mock()
        names = 'm', 'd', 'n', 'e', 'c', 'p'
        hardware.get_axes_names.return_value = names
        settings.hardware = hardware
        settings.geometry = SixCircle()
        self.ubcalc = UBCalculation(UbCalculationNonPersister(),
                                    YouUbCalcStrategy())
 def setup_method(self):
     self._geometry = SixCircle()
     self.reflist = ReflectionList(self._geometry,
                                   ['a', 'd', 'g', 'o', 'c', 'p'])
     self.time = datetime.now()
     pos = Pos(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 'DEG')
     self.reflist.add_reflection(1, 2, 3, pos, 1000, "ref1", self.time)
     pos = Pos(0.11, 0.22, 0.33, 0.44, 0.55, 0.66, 'DEG')
     self.reflist.add_reflection(1.1, 2.2, 3.3, pos, 1100, "ref2",
                                 self.time)
Exemplo n.º 7
0
 def setup_method(self):
     settings.ubcalc_persister = UbCalculationNonPersister()
     inv = matrix([[0, 0, -1], [0, 1, 0], [1, 0, 0]])
     self.zrot = xyz_rotation([0, 0 ,1], 30. * TORAD)
     self.t_matrix = inv * self.zrot
     self.t_hand = 1
     settings.geometry = SixCircle(beamline_axes_transform=self.t_matrix)
     settings.ubcalc_strategy = YouUbCalcStrategy()
     settings.angles_to_hkl_function = youAnglesToHkl
     settings.Pos = YouPositionScenario
     _UBCommandsBase.setup_method(self)
Exemplo n.º 8
0
 def setup_method(self):
     self._geometry = SixCircle()
     self.orientlist = OrientationList(self._geometry,
                                       ['a', 'd', 'g', 'o', 'c', 'p'])
     self.time = datetime.now()
     pos = Pos(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 'DEG')
     self.orientlist.add_orientation(1, 2, 3, 0.1, 0.2, 0.3, pos, "orient1",
                                     self.time)
     pos = Pos(0.11, 0.22, 0.33, 0.44, 0.55, 0.66, 'DEG')
     self.orientlist.add_orientation(1.1, 2.2, 3.3, 0.11, 0.12, 0.13, pos,
                                     "orient2", self.time)
Exemplo n.º 9
0
def setup_module():
    global you
    settings.hardware = ScannableHardwareAdapter(sixc_group, en)
    settings.geometry = SixCircle()
    settings.ubcalc_persister = UbCalculationNonPersister()
    settings.axes_scannable_group = sixc_group
    settings.energy_scannable = en
    settings.ubcalc_strategy = diffcalc.hkl.you.calc.YouUbCalcStrategy()
    settings.angles_to_hkl_function = diffcalc.hkl.you.calc.youAnglesToHkl

    from diffcalc.gdasupport import you
    reload(you)
Exemplo n.º 10
0
    def setup_method(self):

        self.tempdir = tempfile.mkdtemp()

        geometry = SixCircle()  # pass through
        hardware = Mock()
        names = 'm', 'd', 'n', 'e', 'c', 'p'
        hardware.get_axes_names.return_value = names
        self.tmpdir = tempfile.mkdtemp()
        print self.tmpdir
        self.ubcalc = UBCalculation(hardware, geometry,
                                    UBCalculationJSONPersister(self.tmpdir),
                                    YouUbCalcStrategy())
def setup_module():
    global dc
    axes = 'mu', 'delta', NUNAME, 'eta', 'chi', 'phi'
    settings.hardware = DummyHardwareAdapter(axes)
    settings.geometry = SixCircle()
    settings.ubcalc_persister = UbCalculationNonPersister()
    
    from diffcalc.dc import dcyou as dc
    reload(dc)

    dc.newub('test')
    dc.setlat('cubic', 1, 1, 1, 90, 90, 90)
    dc.addref([1, 0, 0], [0, 60, 0, 30, 0, 0], en, 'ref1')
    dc.addref([0, 1, 0], [0, 60, 0, 30, 0, 90], en, 'ref2')
Exemplo n.º 12
0
def setup_module():
    global hkl
    settings.hardware = SimpleHardwareAdapter([])
    settings.geometry = SixCircle()
    settings.angles_to_hkl_function = Mock()
    settings.ubcalc_strategy = Mock()
    settings.geometry.fixed_constraints = {}

    from diffcalc.hkl.you import hkl
    reload(hkl)

    hkl.hklcalc = Mock()
    hkl.hklcalc.constraints.report_constraints_lines.return_value = [
        'report1', 'report2'
    ]
Exemplo n.º 13
0
 def setup_method(self):
     constraints = Mock()
     constraints.is_fully_constrained.return_value = True
     settings.hardware = createMockHardwareMonitor()
     settings.geometry = SixCircle()
     self.calc = YouHklCalculator(createMockUbcalc(None), constraints)
Exemplo n.º 14
0
 def setup_method(self):
     _UBCommandsBase.setup_method(self)
     settings.geometry = SixCircle()
     settings.ubcalc_strategy = YouUbCalcStrategy()
     settings.angles_to_hkl_function = youAnglesToHkl
     settings.Pos = YouPositionScenario
Exemplo n.º 15
0
from __future__ import absolute_import


from diffcalc import settings
from diffcalc.hkl.you.geometry import SixCircle
from diffcalc.hardware import DummyHardwareAdapter
import diffcalc.util  # @UnusedImport


# Disable error handling designed for interactive use
diffcalc.util.DEBUG = True


# Configure and import diffcalc objects
settings.hardware = DummyHardwareAdapter(('mu', 'delta', 'gam', 'eta', 'chi', 'phi'))
settings.geometry = SixCircle()  # @UndefinedVariable


# These must be imported AFTER the settings have been configured
from diffcalc.dc import dcyou as dc
from diffcalc.ub import ub
from diffcalc import hardware
from diffcalc.hkl.you import hkl

# Set some limits
hardware.setmin('gam', -179)
hardware.setmax('gam', 179)

# These demos reproduce the outline in the developer guide
def demo_all():
    demo_orient()
Exemplo n.º 16
0
 def setup_method(self):
     settings.hardware = createMockHardwareMonitor()
     settings.geometry = SixCircle()
     self.calc = YouHklCalculator(createMockUbcalc(None), Mock())
Exemplo n.º 17
0
 def setup_method(self):
     settings.hardware = createMockHardwareMonitor()
     settings.geometry = SixCircle()
     self.calc = YouHklCalculator(createMockUbcalc(I * 2 * pi), Mock())
     self.e = 12.398420  # 1 Angstrom
 def setup_method(self):
     diffcalc.util.COLOURISE_TERMINAL_OUTPUT = False
     self.cm = YouConstraintManager()
     settings.geometry = SixCircle()