Ejemplo n.º 1
0
 def __init__(self, name=None, debug=False, **kwargs):
     self.kwargs = kwargs
     self.do_debug = debug
     Detector.__init__(self, name=name)
     LiveDetector.__init__(self)
     TriggeredDetector.__init__(self)
     BurstDetector.__init__(self)
Ejemplo n.º 2
0
def fastshutter_action(state, name):
    """
    Open (state=False) or close (state=True) the fast shutter,
    by setting BITS1.outb high or low on the panda box with
    the give name.
    """
    try:
        panda = [m for m in Detector.getinstances() if m.name == name][0]
    except IndexError:
        raise Exception('No Gadget named %s' % name)
    response = panda.query('BITS1.B=%u' % (int(state)))
    if 'OK' in response:
        act = {False: 'opened', True: 'closed'}[state]
        print('Fastshutter %s' % act)
    else:
        print('Could not actuate the shutter')
Ejemplo n.º 3
0
 def _set_det_trig(self, on):
     # set up all triggered detectors
     for d in Detector.get_active():
         if isinstance(d, TriggeredDetector) and not d.name == 'panda2':
             d.hw_trig = on
             d.hw_trig_n = self.fastmotorintervals + 1
     # special treatment for the panda box which rules all
     panda = self.panda
     if on:
         self.old_hw_trig = panda.hw_trig
         self.old_burst_n = panda.burst_n
         self.old_burst_lat = panda.burst_latency
         panda.burst_n = self.fastmotorintervals + 1
         panda.burst_latency = self.latency
         panda.hw_trig_n = 1
         panda.hw_trig = on
     else:
         panda.burst_n = self.old_burst_n
         panda.burst_latency = self.old_burst_lat
         panda.hw_trig = self.old_hw_trig
Ejemplo n.º 4
0
    env.paths = SdmPathFixer('B303A-E02/CTL/SDM-01')

    # an hdf5 recorder
    h5rec = Hdf5Recorder(name='h5rec')
    h5rec.start()

    # a zmq recorder
    zmqrec = StreamRecorder(name='zmqrec')
    zmqrec.start()  # removed for now

    # a scicat recorder - paused until further notice
    # scicatrec = ScicatRecorder(name='scicatrec')
    # scicatrec.start()

    # default detector selection
    for d in Detector.getinstances():
        d.active = False
    for d in [alba2, panda0, pseudo]:  # eiger,
        d.active = True

    # define pre- and post-scan actions, per scan base class
    def pre_scan_stuff(slf):
        # basex.proxy.PowerOn = False
        # basey.proxy.PowerOn = False
        # basez.proxy.PowerOn = False
        runCommand('stoplive')
        runCommand('fsopen')
        time.sleep(0.2)

    def post_scan_stuff(slf):
        # basex.proxy.PowerOn = True
Ejemplo n.º 5
0
 def __init__(self, name=None, **kwargs):
     self.kwargs = kwargs
     Detector.__init__(self, name=name)
     LiveDetector.__init__(self)
     TriggeredDetector.__init__(self)
     BurstDetector.__init__(self)
Ejemplo n.º 6
0
 def _while_acquiring(self):
     s = ''
     for d in Detector.get_active():
         # it would be nice to print some numbers here
         pass
     print(s + '\r', end='')
Ejemplo n.º 7
0
 def _set_det_trig(self, on):
     for d in Detector.get_active():
         if isinstance(d, TriggeredDetector):
             d.hw_trig = on
             d.hw_trig_n = self.fastmotorintervals + 1
             d.burst_latency = self.latency
Ejemplo n.º 8
0
 def _while_acquiring(self):
     s = ''
     for d in Detector.get_active():
         if d.name in ('xspress3', 'merlin'):
             s += ('%s: %u, ' % (d.name, d.lima.last_image_acquired))
     print(s + '\r', end='')