# make an index scannable from gda.device.scannable import SimpleScannable ix = SimpleScannable() ix.name = "ix" pos ix 0 #make scannablegroup for driving sample stage from gda.device.scannable.scannablegroup import ScannableGroup idd_pos_neg = ScannableGroup() #idd_pos_neg.addGroupMember(idd_pos_neg_switchable) idd_pos_neg.addGroupMember(idd_pos_neg_switcher) idd_pos_neg.addGroupMember(idd_pos_neg_switchable) idd_pos_neg.addGroupMember(ix) idd_pos_neg.setName("idd_pos_neg") idd_pos_neg.configure() #make ScanPointProvider def readfile(filepath): """ reads a 2 column csv file returns a list of tuple """ values=[] f = open( filepath ) lines = f.readlines() f.close() lineno=0 for l in lines: lineno +=1
from gda.device.scannable import SimpleScannable from gda.device.scannable.scannablegroup import ScannableGroup from BeamlineI06.Mainline.xmcd import XMCDScanPositionProvider imagenum = SimpleScannable() imagenum.name = "imagenum" imagenum.moveTo(0) print "Creating energy scannable groups...\n" print " dxmcd uses iddpol & denergy" dxmcd = ScannableGroup("dxmcd", (imagenum, iddpol, denergy)) dxmcd.configure() print " uxmcd uses idupol & uenergy" uxmcd = ScannableGroup("uxmcd", (imagenum, idupol, uenergy)) uxmcd.configure() print " xxmcd uses xpol & xenergy" xxmcd = ScannableGroup("xxmcd", (imagenum, xpol, xenergy)) xxmcd.configure() print "\nCreating xmcd_positions...\n" xmcd_positions = XMCDScanPositionProvider(name='xmcd_positions', numberOfImages=10, pols=('PosCirc', 'NegCirc'), energies=(706.7, 702.3)) print " xmcd_positions.numberOfImages = %r" % xmcd_positions.numberOfImages print " xmcd_positions.pols = %r" % (xmcd_positions.pols,) print " xmcd_positions.energies = %r" % (xmcd_positions.energies,) print "\nExamples\n"