Example #1
0
import sys
import time
import math

# Constants
DEVICE_SAMX = 'samx'

# safe count rates
local_rateSafe =     15.0
global_rateSafe = 40000.0

# Enums
guideConfig = enum.Enum(\
    'ga', 'mt', 'lp', 'lens', \
    'p1', 'p1lp', 'p1lens', 'g1', \
    'p2', 'g2', 'p3', 'g3', 'p4', 'g4', 'p5', 'g5', \
    'p6', 'g6', 'p7', 'g7', 'p8', 'g8', 'p9', 'g9')
action = enum.Enum('up', 'down')
hmMode = enum.Enum('time', 'monitor')
scanMode = enum.Enum('time', 'count', 'monitor', 'unlimited', 'MONITOR_1')
dataType = enum.Enum('HISTOGRAM_XY')
saveType = enum.Enum('save', 'nosave')

# Global variables
# Beam stop controllers
bsList = [BeamStopController(1), \
          BeamStopController(2), \
          BeamStopController(3), \
          BeamStopController(4), \
          BeamStopController(5)]
Example #2
0
File: bilby.py Project: nxi/gumtree
            sics.drive('bs4', 0)
            sics.drive('bs5', 0)
        elif bs_num == 4:
            sics.drive('bs4', bs_angle)
            sics.drive('bs3', 0)
            sics.drive('bs5', 0)
        elif bs_num == 5:
            sics.drive('bs5', bs_angle)
            sics.drive('bs3', 0)
            sics.drive('bs4', 0)
    else:
        # Do not let the BS_Att command drive to an unsafe configuration
        raise Exception, 'No valid beamstop or attenuator has been selected  no movement of beamstop or attempted'


hmMode = enum.Enum('timer', 'monitor')
scanMode = enum.Enum('time', 'count', 'monitor', 'unlimited', 'MONITOR_1')
dataType = enum.Enum('HISTOGRAM_XYT')
saveType = enum.Enum('save', 'nosave')


# This scan rely on samx
def scan(deviceName,
         start,
         stop,
         numpoints,
         scanMode,
         dataType,
         preset,
         force='true',
         saveType=saveType.save):