def homecoarsejaws(): print "Homing Coarse Jaws" gen.cset(cjhgap=40,cjvgap=40) gen.waitfor_move() # home north and west gen.set_pv("IN:LARMOR:MOT:JAWS1:JN:MTR.HOMR","1") gen.set_pv("IN:LARMOR:MOT:JAWS1:JW:MTR.HOMR","1") gen.waitfor_move() gen.set_pv("IN:LARMOR:MOT:JAWS1:JN:MTR.VAL","20") gen.set_pv("IN:LARMOR:MOT:JAWS1:JW:MTR.VAL","20") # home south and east gen.set_pv("IN:LARMOR:MOT:JAWS1:JS:MTR.HOMR","1") gen.set_pv("IN:LARMOR:MOT:JAWS1:JE:MTR.HOMR","1") gen.waitfor_move() gen.set_pv("IN:LARMOR:MOT:JAWS1:JS:MTR.VAL","20") gen.set_pv("IN:LARMOR:MOT:JAWS1:JE:MTR.VAL","20")
def run(self, start_temp=1.0, stop_temp=1.0, step_temp=0.5): # Execute the loop once if start_temp == stop_temp: step_temp = 1.0 # Done to account for pythons range non inclusivity small_amount = 0.000001 if start_temp <= stop_temp: stop_temp += small_amount else: stop_temp -= small_amount # Regular range can't use floats for temp in np.arange(start_temp, stop_temp, step_temp): g.cset("temperature", temp) g.begin(quiet=True) g.waitfor_time(seconds=30) g.end(quiet=True)
def __init__(self, block, unit): blocks = g.get_blocks() if block not in blocks: new_name = [ name for name in blocks if name and name.lower() == block.lower() ] if new_name: block = new_name[0] else: raise RuntimeError("Unknown block {}.".format(block)) Motion.__init__( self, lambda: g.cget(block)["value"], lambda x: g.cset(block, x), block, unit=unit, # Workarounds until a better solution to get fields # from blocks is implemented in IBEX. Note that IBEX # blocks must point at AXIS:MTR rather than AXIS for # this to work. velocity_getter=lambda: g.get_pv("CS:SB:{}.VELO".format(block), is_local=True), velocity_setter=lambda vel: g.set_pv( "CS:SB:{}.VELO".format(block), vel, is_local=True), tolerance_getter=lambda: g.get_pv("CS:SB:{}.RDBD".format(block), is_local=True), )
def rotatebench(angle=0.0,delaydet=1): a1=0 a1+=gen.get_pv("IN:LARMOR:CAEN:hv0:0:8:status") a1+=gen.get_pv("IN:LARMOR:CAEN:hv0:0:9:status") a1+=gen.get_pv("IN:LARMOR:CAEN:hv0:0:10:status") a1+=gen.get_pv("IN:LARMOR:CAEN:hv0:0:11:status") if(a1>0): print "The detector is not turned off" print "Not attempting Move" return else: print "The detector is off" if(angle >= -0.5): gen.cset(benchlift=1) print "Lifting Bench (20s)" sleep(20) a1=gen.get_pv("IN:LARMOR:BENCH:STATUS") if(a1==1): print "Rotating Bench" gen.cset(bench_rot=angle) waitfor_move() print "Lowering Bench (20s)" gen.cset(benchlift=0) sleep(20) else: print "Bench failed to lift" print "Move not attempted"
def cset_str(blockString, value): dict = {blockString: value} gen.cset(**dict)
def run(self, temperature=0.0, field=0.0, uamps=0.0): g.cset("temperature", temperature) g.cset("field", field) g.begin() g.waitfor_uamps(uamps) g.end()
def _trans_mode(): """Setup the instrument for a simple transmission measurement.""" setup_dae_transmission() g.cset(m4trans=0) g.waitfor_move()