Ejemplo n.º 1
0
def test_lima_basler():
    config = beacon_get_config()
    m0 = config.get("bcumot2")
    m0.velocity(360)
    m0.acceleration(720)

    chain = AcquisitionChain()
    nb_points = 4
    emotion_master = SoftwarePositionTriggerMaster(m0,
                                                   0,
                                                   360,
                                                   nb_points,
                                                   time=1)
    tango_host = "lid00limax:20000"
    lima_dev = DeviceProxy("//%s/id00/limaccds/basler_bcu" % tango_host)
    params = {
        "acq_nb_frames": nb_points,
        "acq_expo_time": 10e-3,
        "acq_trigger_mode": "INTERNAL_TRIGGER_MULTI"
    }
    lima_acq_dev = LimaAcquisitionMaster(lima_dev, **params)
    chain.add(emotion_master, lima_acq_dev)

    hdf5_writer = hdf5.Writer(root_path='/tmp')
    toto = Container('test_lima_basler')
    scan = Scan(chain, name='test_acq', parent=toto, writer=hdf5_writer)

    scan.run()
Ejemplo n.º 2
0
def test_p201_hdf5():
    chain = AcquisitionChain()
    p201_device = P201()
    p201_device.request_exclusive_access()
    p201_device.disable_interrupts()
    p201_device.reset()
    p201_device.software_reset()
    p201_device.reset_FIFO_error_flags()
    p201_device.enable_interrupts(100)
    p201_device.set_clock(Clock.CLK_100_MHz)
    p201_master = P201AcquisitionMaster(p201_device,
                                        nb_points=10,
                                        acq_expo_time=50e-6)
    p201_counters = P201AcquisitionDevice(p201_device,
                                          nb_points=10,
                                          acq_expo_time=50e-6,
                                          channels={
                                              "c0": 1,
                                              "c1": 2,
                                              "timer": 11
                                          })
    chain.add(p201_master, p201_counters)
    hdf5_writer = hdf5.Writer(root_path='/tmp')
    toto = Container('toto')
    scan = Scan(chain, name='test_acq', parent=toto, writer=hdf5_writer)
    scan.run()
Ejemplo n.º 3
0
def test_p201():
    #import logging; logging.basicConfig(level=logging.DEBUG)

    chain = AcquisitionChain()
    p201_device = P201()
    p201_device.request_exclusive_access()
    p201_device.set_interrupts()
    p201_device.reset()
    p201_device.software_reset()
    p201_device.reset_FIFO_error_flags()
    p201_device.set_clock(Clock.CLK_100_MHz)
    p201_master = P201AcquisitionMaster(p201_device,
                                        nb_points=100000,
                                        acq_expo_time=50e-6)
    p201_counters = P201AcquisitionDevice(p201_device,
                                          nb_points=100000,
                                          acq_expo_time=50e-6,
                                          channels={
                                              "c0": 1,
                                              "c1": 2,
                                              "timer": 11
                                          })
    chain.add(p201_master, p201_counters)
    scan = Scan(chain)
    scan.run()
Ejemplo n.º 4
0
def test_dm_lima():
    config_xml = """
<config>
  <controller class="mockup">
    <axis name="m0">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
  </controller>
</config>"""

    emotion.load_cfg_fromstring(config_xml)
    m0 = emotion.get_axis("m0")

    chain = AcquisitionChain()
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 5, time=5)
    lima_dev = DeviceProxy("id30a3/limaccd/simulation")
    params = {
        "acq_nb_frames": 5,
        "acq_expo_time": 3 / 10.0,
        "acq_trigger_mode": "INTERNAL_TRIGGER_MULTI"
    }
    lima_acq_dev = LimaAcquisitionMaster(lima_dev, **params)
    chain.add(emotion_master, lima_acq_dev)

    toto = Container('toto')
    scan = Scan(chain, name='test_acq', parent=toto)

    scan.run()
Ejemplo n.º 5
0
def test_lima():
    config_xml = """
<config>
  <controller class="mockup">
    <axis name="m0">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
  </controller>
</config>"""

    emotion.load_cfg_fromstring(config_xml)
    m0 = emotion.get_axis("m0")

    def cb(*args, **kwargs):
        print args, kwargs

    chain = AcquisitionChain()
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 10, time=5)
    lima_dev = DeviceProxy("id30a3/limaccd/simulation")
    params = {
        "acq_nb_frames": 10,
        "acq_expo_time": 3 / 10.0,
        "acq_trigger_mode": "INTERNAL_TRIGGER_MULTI"
    }
    lima_acq_dev = LimaAcquisitionMaster(lima_dev, **params)
    dispatcher.connect(cb, sender=lima_acq_dev)
    chain.add(emotion_master, lima_acq_dev)
    scan = Scan(chain)
    scan.run()
    m0.wait_move()
    print m0.velocity() == 10
Ejemplo n.º 6
0
def test2():
    chain = AcquisitionChain()
    musst_master = TestAcquisitionMaster("musst")
    p201_master = TestAcquisitionMaster("P201")
    p201_acq_dev = TestAcquisitionDevice("P201")
    chain.add(musst_master, p201_master)
    chain.add(p201_master, p201_acq_dev)
    chain._tree.show()

    scan = Scan(chain)
    scan.run()
Ejemplo n.º 7
0
def test():
    chain = AcquisitionChain()
    mono_master = TestAcquisitionMaster("mono")
    cam1_dev = TestAcquisitionDevice("cam1")
    cam1_master = TestAcquisitionMaster("cam1")
    cam2_dev = TestAcquisitionDevice("cam2")
    timer_master = TestAcquisitionMaster("timer")
    c0_dev = TestAcquisitionDevice("c0")
    c1_dev = TestAcquisitionDevice("c1")
    chain.add(mono_master, cam1_dev)
    chain.add(mono_master, cam1_master)
    chain.add(cam1_master, cam2_dev)
    chain.add(timer_master, c0_dev)
    chain.add(timer_master, c1_dev)
    chain._tree.show()

    scan = Scan(chain)
    scan.run()
Ejemplo n.º 8
0
def test_emotion_p201():
    config_xml = """
<config>
  <controller class="mockup">
    <axis name="m0">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
  </controller>
</config>"""

    emotion.load_cfg_fromstring(config_xml)
    m0 = emotion.get_axis("m0")
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 5, time=1)
    chain = AcquisitionChain()

    p201_device = P201()
    p201_device.request_exclusive_access()
    p201_device.set_interrupts()
    p201_device.reset()
    p201_device.software_reset()
    p201_device.reset_FIFO_error_flags()
    p201_device.set_clock(Clock.CLK_100_MHz)
    p201_master = P201AcquisitionMaster(p201_device,
                                        nb_points=10,
                                        acq_expo_time=1e-3)
    p201_counters = P201AcquisitionDevice(p201_device,
                                          nb_points=10,
                                          acq_expo_time=1e-3,
                                          channels={
                                              "c0": 1,
                                              "c1": 2
                                          })
    chain.add(emotion_master, p201_master)
    chain.add(p201_master, p201_counters)
    chain._tree.show()
    scan = Scan(chain)
    scan.run()
Ejemplo n.º 9
0
def test_emotion_master():
    config_xml = """
<config>
  <controller class="mockup">
    <axis name="m0">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
  </controller>
</config>"""

    emotion.load_cfg_fromstring(config_xml)
    m0 = emotion.get_axis("m0")

    chain = AcquisitionChain()
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 7)
    test_acq_dev = TestAcquisitionDevice("c0", 0)
    chain.add(emotion_master, test_acq_dev)
    scan = Scan(chain)
    scan.run()
Ejemplo n.º 10
0
def test_step_cont():
    config_xml = """
<config>
  <controller class="mockup">
    <axis name="m0">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
    <axis name="m1">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="1"/>
      <acceleration value="10"/>
    </axis>
    <axis name="m2">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="10"/>
      <acceleration value="100"/>
    </axis>
  </controller>
</config>"""

    load_cfg_fromstring(config_xml)
    m0 = get_axis("m0")
    m1 = get_axis("m1")
    m2 = get_axis("m2")

    ascan = AcquisitionChain(parallel_prepare=True)
    ascan_mot = LinearStepTriggerMaster(11, m0, 10, 20)
    timer = SoftwareTimerMaster(0.1)
    ascan.add(ascan_mot, timer)
    test_acq_dev = TestAcquisitionDevice("timer_test",
                                         2,
                                         prepare_once=True,
                                         start_once=True)
    ascan.add(timer, test_acq_dev)
    test2_acq_dev = TestAcquisitionDevice("timer_test2",
                                          2,
                                          prepare_once=True,
                                          start_once=True)
    ascan.add(timer, test2_acq_dev)
    step_scan = Container('step_scan')
    scan = Scan(chain)
    scan.run()

    chain = AcquisitionChain(parallel_prepare=True)

    step_master = MeshStepTriggerMaster(m1,
                                        -2,
                                        2,
                                        5,
                                        m2,
                                        -5,
                                        5,
                                        3,
                                        backnforth=True)
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 7, time=1)
    chain.add(step_master, emotion_master)
    chain.add(emotion_master, test_acq_dev)
    scan = Scan(chain, name='super_zap_image', parent=step_scan)
    scan.run()

    print "next scan"
    chain = AcquisitionChain()
    emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 7)
    test_acq_dev = TestAcquisitionDevice("super_mario", 0)
    chain.add(emotion_master, test_acq_dev)
    scan = Scan(chain, name='soft_zapline', parent=step_scan)
    scan.run()