Example #1
0
def run(s, camera):
    global report
    ss = f('CNC', 'cncstepsize')

    # Cool and Compress MOT
    # ENDCNC is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cncRamps()

    # Set imaging values
    motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = imagingRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, camera)

    #Add waveforms to sequence
    s.analogwfm_add(ss, [motpow, repdet, trapdet, bfield, reppow, trappow])

    #wait normally rounds down using floor, here the duration is changed before so that
    #the wait is rounded up
    ENDCNC = ss * math.ceil(ENDCNC / ss)

    #insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr('CNC', report) == True else 0
    s.digichg('quick', quickval)
    s.wait(10.0)

    #Go to MOT release time and set QUICK back to low
    s.wait(ENDCNC)
    s.digichg('quick', 0)

    #print s.tcur

    return s, ENDCNC
Example #2
0
def run(s,camera):
	global report
	ss=f('CNC','cncstepsize')
	
	# Cool and Compress MOT
	# ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cncRamps()

	# Set imaging values
	motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = imagingRamps(motpow, repdet, trapdet, reppow, trappow, bfield, camera)
	
	#Add waveforms to sequence
	s.analogwfm_add(ss,[motpow,repdet,trapdet,bfield,reppow,trappow])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDCNC = ss*math.ceil(ENDCNC/ss)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	
	#Go to MOT release time and set QUICK back to low
	s.wait(ENDCNC)
	s.digichg('quick',0)
	
	#print s.tcur

	return s, ENDCNC
Example #3
0
def run(s, camera):
    global report
    ss = f('CNC', 'cncstepsize')

    # Cool and Compress MOT
    # DURATION is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcoolRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

    # Imaging
    motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, camera)

    uvfppiezo.extend(maxDT)
    uvpow.extend(maxDT)

    #Add the waveforms
    s.analogwfm_add(
        ss,
        [motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow])

    #wait normally rounds down using floor, here the duration is changed before so that
    #the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    #insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr('CNC', report) == True else 0
    s.digichg('quick', quickval)
    s.wait(10.0)

    #insert UV pulse
    s.wait(ENDCNC)
    s.wait(f('UVRED', 'uvtime'))
    #Shut down the UVAOM's and open the shutter
    s.wait(-50.0)
    s.digichg('uvaom1', 0)
    s.digichg('uvaom2', 0)
    s.digichg('uvshutter', 1)
    s.wait(50.0)
    #Turn on UVAOM
    s.digichg('uvaom1', 1)
    s.wait(-f('UVRED', 'uvtime') - ENDCNC)

    #Go to MOT release time turn off UV and set QUICK back to low
    s.wait(ENDUVMOT)
    s.digichg('uvaom1', 0)
    s.digichg('quick', 0)

    #print s.tcur

    return s, ENDUVMOT
Example #4
0
def run(s,camera):
	global report
	ss=f('CNC','cncstepsize')
	
	# Cool and Compress MOT
	# DURATION is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()
	
	# Load UVMOT from CNCMOT
	uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcoolRamps(motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

	# Imaging
	motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(motpow, repdet, trapdet, reppow, trappow, bfield,camera)

	uvfppiezo.extend(maxDT)
	uvpow.extend(maxDT)
	
	
	#Add the waveforms
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	
	#insert UV pulse
	s.wait(ENDCNC)
	s.wait(f('UVRED','uvtime'))
	#Shut down the UVAOM's and open the shutter
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	#Turn on UVAOM
	s.digichg('uvaom1',1)
	s.wait(-f('UVRED','uvtime') - ENDCNC)
	
	
	#Go to MOT release time turn off UV and set QUICK back to low
	s.wait(ENDUVMOT)
	s.digichg('uvaom1',0)
	s.digichg('quick',0)
	
	#print s.tcur
	
	return s, ENDUVMOT
def doLOAD(s,camera):
	cncduration, duration = constructLoadRamps(camera)
	seqstepsize = f('SEQ','stepsize')
	#Add the load trap waveforms
	s.analogwfm(f('CNC','cncstepsize'),[ 	\
	{'name':'motpow',   'path':'L:/software/apparatus3/seq/ramps/motpow.txt'},\
	{'name':'repdet','path':'L:/software/apparatus3/seq/ramps/repdet.txt'},\
	{'name':'trapdet',  'path':'L:/software/apparatus3/seq/ramps/trapdet.txt'},\
	{'name':'bfield',   'path':'L:/software/apparatus3/seq/ramps/bfield.txt'}, \
	{'name':'reppow','path':'L:/software/apparatus3/seq/ramps/reppow.txt'},\
	{'name':'trappow',  'path':'L:/software/apparatus3/seq/ramps/trappow.txt'},\
			                                 ])
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	duration = seqstepsize*math.ceil(duration/seqstepsize)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	
	#insert UV pulse
	s.wait(cncduration)
	s.wait(f('UV','uvtime'))
	s.digichg('uvaom1',1)
	s.wait(-f('UV','uvtime') - cncduration)
	
	
	#Go to MOT release time and set QUICK back to low
	s.wait(duration)
	s.digichg('uvaom1',0)
	s.digichg('quick',0)
	
	print s.tcur
			


	
	return s, duration
Example #6
0
def run(s,camera):
	duration = constructLoadRamps(camera)
	seqstepsize = f('SEQ','stepsize')
	#Add the load trap waveforms
	s.analogwfm(f('CNC','cncstepsize'),[ 	\
	{'name':'motpow',   'path':'L:/software/apparatus3/seq/ramps/motpow.txt'},\
	{'name':'repdet','path':'L:/software/apparatus3/seq/ramps/repdet.txt'},\
	{'name':'trapdet',  'path':'L:/software/apparatus3/seq/ramps/trapdet.txt'},\
	{'name':'bfield',   'path':'L:/software/apparatus3/seq/ramps/bfield.txt'}, \
	{'name':'reppow','path':'L:/software/apparatus3/seq/ramps/reppow.txt'},\
	{'name':'trappow',  'path':'L:/software/apparatus3/seq/ramps/trappow.txt'},\
			                                 ])
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	duration = seqstepsize*math.ceil(duration/seqstepsize)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	
	#Go to MOT release time and set QUICK back to low
	s.wait(duration)
	s.digichg('quick',0)
	
	print s.tcur
	
	#~ #IR On/Off
	#~ if gen.bstr('IR on',report) == True:
		#~ s.wait(-f('IRTRAP','dtirpow')-f('IRTRAP','irloadtime'))
		#~ s.digichg('iraom1',1)
		#~ s.digichg('iraom2',1)
		#~ s.digichg('iraom3',1)	
		#~ s.wait(f('IRTRAP','dtirpow')+f('IRTRAP','irloadtime'))
		

	
	return s, duration
sys.path.append('L:/software/apparatus3/convert')
import seq, wfm, gen, cnc, andor
report=gen.getreport()

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof      = float(report['ANDOR']['tof'])
exp      = float(report['ANDOR']['exp'])
noatoms  = float(report['ANDOR']['noatoms'])

#SEQUENCE
s=seq.sequence(stepsize)
s=gen.initial(s)

#Keep ODT on
ODT = gen.bstr('ODT',report)
if ODT == True:
    s.digichg('odtttl',1)
s.wait(20.0)

#LOAD ODT
s, duration=cnc.run(s,'ANDOR')

#RELEASE
s=gen.releaseMOT(s)

#UV LIGHT SHIFT PARAMETERS
intrapdt = float(report['UVLIGHTSHIFT']['intrapdt'])
pulse = float(report['UVLIGHTSHIFT']['pulse'])
postdt = float(report['UVLIGHTSHIFT']['postdt'])
Example #8
0
def  go_to_highfield(s):

	#Keep ODT on
	ODT = gen.bstr('ODT',report)
	if ODT == True:
		s.digichg('odtttl',1)
	s.wait(20.0)

	ss = float(report['SEQ']['analogstepsize'])

	# Cool and Compress MOT
	# ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

	# Load UVMOT from CNCMOT
	uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling.uvcoolRamps(motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

	# Set imaging values
	camera = 'ANDOR'
	motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(motpow, repdet, trapdet, reppow, trappow, camera)

	# Switch bfield to FESHBACH
	overlapdt    = float(report['ODT']['overlapdt'])
	rampdelay    = float(report['ODT']['rampdelay'])
	rampbf       = float(report['ODT']['rampbf'])
	bf           = float(report['ODT']['bf'])
	feshbachdt   = float(report['ODT']['feshbachdt'])
	switchondt  = float(report['FESHBACH']['switchondt'])
	switchdelay  = float(report['FESHBACH']['switchdelay'])
	bias         = float(report['FESHBACH']['bias'])
	biasrampdt   = float(report['FESHBACH']['rampdt'])

	bfield.chop(ENDUVMOT-overlapdt)
	bfield.appendhold(rampdelay)
	bfield.linear( bf, rampbf)
	bfield.extend(ENDUVMOT+feshbachdt)
	bfield.linear(0.0, 0.0)
	ENDBFIELD = feshbachdt
	bfield.appendhold( switchondt + switchdelay)
	bfield.linear(bias,biasrampdt)

	rampupdt = float(report['ODT']['rampupdt'])
	updt = float(report['ODT']['updt'])
	overshootdt = float(report['ODT']['overshootdt'])
	
	#~ odtpow0 = wfm.wave('odtpow', 0.0, ss)
	#~ odtpow0.extend(ENDUVMOT-overlapdt-updt-rampupdt)
	#~ odtpow0.odt_linear( 0.0 , f('ODT','odtpow0'), rampupdt)
	#~ odtpow0.appendhold( updt)
	#~ odtpow0.odt_linear(f('ODT','odtpow0'), f('ODT','odtpow'), overshootdt)

	odtpow0 = wfm.wave('odtpow', f('ODT','odtpow0'), ss)
	odtpow0.extend(ENDUVMOT-overlapdt)
	odtpow0.odt_linear(f('ODT','odtpow0'), f('ODT','odtpow'), overshootdt)

	
	EXTRA = max( overshootdt - (bfield.dt() - (ENDUVMOT-overlapdt-updt-rampupdt)) , 0.0) 
	print "...EXTRA time to allow for ODT overshoot = %f"  % EXTRA


	#Add waveforms to sequence
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow, odtpow0])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)	
	s.wait(10.0)

	#insert UV pulse
	uvtime  = float(report['UV']['uvtime'])
	s.wait(ENDCNC)
	s.digichg('quick',0)
	s.wait(uvtime)
	#Shut down the UVAOM's and open the shutter
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	#Turn on UVAOM
	s.digichg('uvaom1',1)
	s.wait(-uvtime - ENDCNC)
	
	#Go to MOT release time and set QUICK back to low
	s.wait(ENDUVMOT)
	s.digichg('quick',0)

	#Leave UVMOT on for state transfer
	fstatedt  = float(report['ODT']['fstatedt'])
	s.wait(fstatedt)
	s.digichg('uvaom1',0)
	s.wait(-fstatedt) 


	#RELEASE FROM MOT
	waitshutter=5.0
	s.wait(waitshutter)
	s.digichg('uvshutter',0)
	#~ s.wait(20.0)
	#~ s.digichg('uvaom1',0)
	#~ s.digichg('uvaom2',0)
	#~ s.wait(-20.0)
	s.wait(-waitshutter)

	s.digichg('motswitch',0) 
	s.digichg('motshutter',1)
	s.digichg('field',0)

	#Insert ODT overlap with UVMOT and switch field to FESHBACH
	overlapdt = float(report['ODT']['overlapdt'])
	servodt = float(report['ODT']['servodt'])
	s.wait(-overlapdt-servodt)
	s.digichg('odt7595',1)
	s.wait(servodt)
	s.digichg('odtttl',1)
	#feshbachdt = rampdelay + rampbf + holdbf
	s.wait(overlapdt)
	s.wait( feshbachdt )
	s.digichg('feshbach',1)
	#s.wait(overlapdt - feshbachdt)
	#s.wait( -feshbachdt)
	

	#s.wait(offdelay)
	#s.wait(2*switchdt)
	#s.wait(quickdelay)
	s.wait(switchondt)
	do_quick=1
	s.digichg('field',1)
	s.digichg('hfquick',do_quick)
	s.digichg('quick',do_quick)
	#Can't leave quick ON for more than quickmax
	quickmax=100.
	s.wait(quickmax)
	s.digichg('hfquick',0)
	s.digichg('quick',0)
	s.wait(-quickmax)
	s.wait(switchdelay+biasrampdt)
	s.digichg('quick',0)
	s.wait(-biasrampdt)
	#s.wait(-switchdelay-quickdelay-2*switchdt-offdelay)
	s.wait(-switchdelay - switchondt - feshbachdt - ss)

	#At this point the time sequence is at ENDUVMOT
	
	#This is the time until the end of the bfield ramp
	#toENDBFIELD = biasrampdt + switchdelay + quickdelay + 2*switchdt + offdelay
	toENDBFIELD = biasrampdt + switchdelay + switchondt + feshbachdt
	
	return s, toENDBFIELD + EXTRA
Example #9
0

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof      = float(report['ANDOR']['tof'])
exp      = float(report['ANDOR']['exp'])
noatoms  = float(report['ANDOR']['noatoms'])

#SEQUENCE
s=seq.sequence(stepsize)
s=gen.initial(s)

s.digichg('hfimg',1)

#Keep ODT on
ODT = gen.bstr('ODT',report)
if ODT == True:
    s.digichg('odtttl',1)
s.wait(20.0)

ss = float(report['SEQ']['analogstepsize'])

# Cool and Compress MOT
# ENDCNC is defined as the time up to release from the MOT
motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

# Load UVMOT from CNCMOT
uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling.uvcoolRamps(motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

# Set imaging values
camera = 'ANDOR'
Example #10
0
def buildramps(aos,params,camera):
	
	[motIMGpow,trapIMGdet,repIMGdet,trapIMGpow,repIMGpow,biascurrentIMG]=IMGvalues(params,aos,camera)
	
	seqstepsize=float(params['SEQ']['stepsize'])
	analogstepsize=float(params['SEQ']['analogstepsize'])
	
	#PARAMETERS FOR CNC RAMPS
	
	motpowSS = aos.motpow(float(params['MOT']['motpow'])) #initial MOT power
	motpowCNC = aos.motpow(float(params['CNC']['motpowf'])) #final MOT power
	motpowDT = float(params['CNC']['dtmotpow']) #MOT ramp time
	motN = int(math.floor(motpowDT/analogstepsize)) #MOT N of samples
	motramp='L:/software/apparatus3/seq/ramps/motpow_CNC.txt'

	repdetSS = aos.repdet(float(params['MOT']['repdetSS'])) #initial rep det
	repdetCNC= aos.repdet(float(params['CNC']['repdetf']))#final rep det
	repdetDT=float(params['CNC']['dtrepdet'])# rep ramp time
	repdetN=int(math.floor(repdetDT/analogstepsize))#rep N of samples
	repramp='L:/software/apparatus3/seq/ramps/repdet_CNC.txt'

	trapdetSS = aos.trapdet(float(params['MOT']['trapdetSS'])) #initial trap det
	trapdetCNC= aos.trapdet(float(params['CNC']['trapdetf']))#final trap det
	trapdetDT=float(params['CNC']['dttrapdet'])# trap ramp time
	trapdetN=int(math.floor(trapdetDT/analogstepsize))#trap N of samples
	trapramp='L:/software/apparatus3/seq/ramps/trapdet_CNC.txt'

	biascurrentSS = aos.biascurrent(float(params['MOT']['biascurrent'])) #initial bias current
	biascurrentCNC = aos.biascurrent(float(params['CNC']['biascurrentf'])) #final bias current
	biascurrentDT = float(params['CNC']['dtbiascurrent']) #bias current ramp time
	biascurrentN = int(math.floor(biascurrentDT/analogstepsize)) #bias current N of samples
	biascurrentramp='L:/software/apparatus3/seq/ramps/biascurrent_CNC.txt'
	
	#PARAMETERS FOR UV COOLING RAMPS
	
	#uvpow=aos.uvpow(float(params['UV']['uvpow']))
	#time constraints means no calibration to start with
	#uvpow=float(params['UV']['uvpow'])
	#uvpowDT=float(params['UV']['dtuvpow'])
	#uvpowN=int(math.floor(motpowDT/analogstepsize))
	#uvpowramp='L:/software/apparatus3/seq/ramps/uvpow.txt'
	#uvpowrampA='L:/software/apparatus3/seq/ramps/uvpow_A.txt'
	
	motpowUV=aos.motpow(float(params['UV']['motpow']))
	uvmotpowDT=float(params['UV']['dtmot'])
	uvmotN=int(math.floor(uvmotpowDT/analogstepsize))
	uvmotramp='L:/software/apparatus3/seq/ramps/motramp_UV.txt'
	
	reppowSS = aos.reppow(float(params['MOT']['reppow'])) #initial rep pow
	reppowUV= aos.reppow(float(params['UV']['reppow']))#final rep pow
	reppowDT=float(params['UV']['dtmot'])# rep ramp time
	reppowN=int(math.floor(repdetDT/analogstepsize))#rep N of samples
	repPowRamp='L:/software/apparatus3/seq/ramps/reppow_CNC.txt'
	uvrepPowRamp='L:/software/apparatus3/seq/ramps/reppow_UV.txt'
	
	trappowSS = aos.trappow(float(params['MOT']['trappow'])) #initial trap pow
	trappowUV= aos.trappow(float(params['UV']['trappow']))#final trap pow
	trappowDT=float(params['UV']['dtmot'])# trap ramp time
	trappowN=int(math.floor(trappowDT/analogstepsize))#trap N of samples
	trapPowRamp='L:/software/apparatus3/seq/ramps/trappow_CNC.txt'
	uvtrapPowRamp='L:/software/apparatus3/seq/ramps/trappow_UV.txt'
	
	#uvdetI=aos.uvdet(float(params['UV']['uvdeti']))
	#uvdetF=aos.uvdet(float(params['UV']['uvdetf']))
	#again need to do calibrations for now use straight voltage
	uvdetI=float(params['UV']['uvdeti'])
	uvdetF=float(params['UV']['uvdetf'])
	uvdetDT=float(params['UV']['dtuvdet'])
	uvdetN=int(math.floor(uvdetDT/analogstepsize))
	uvdetramp='L:/software/apparatus3/seq/ramps/uvdet.txt'
	uvdetrampA='L:/software/apparatus3/seq/ramps/uvdet_A.txt'
	
	uvrepdet=aos.repdet(float(params['UV']['repdet']))
	uvrepdetDT=float(params['UV']['dtmot'])
	uvrepdetN=int(math.floor(uvrepdetDT/analogstepsize))
	uvrepramp='L:/software/apparatus3/seq/ramps/repdet_UV.txt'
	
	biascurrentUV=float(params['UV']['uvbiascurrent'])
	uvbiascurrentDT=float(params['UV']['dtmot'])
	uvbiascurrentN=int(math.floor(uvbiascurrentDT/analogstepsize))
	uvbiascurrentramp='L:/software/apparatus3/seq/ramps/biascurrent_UV.txt'
	
		
	#PARAMETERS FOR TRANSFER RAMPS
	#not ready for prime time
	#motpowTR=aos.motpow(float(params['TRANSFER']['motpow'])
	#trmotpowDT=float(params['TRANSFER']['detmotpow']
	#trmotN=int(math.floor(trmotpowDT/analogstepsize))
	#trmotramp='L:software/apparatus3/seq/ramps/motpow_TR.txt'
	
	maxDT=max(motpowDT,repdetDT,trapdetDT,reppowDT,trappowDT,biascurrentDT)
	maxN=int(math.floor(maxDT/analogstepsize))
	#uvmaxDT=max(uvmotpowDT,reppowDT,trappowDT,uvpowDT,uvdetDT)
	uvmaxDT=max(uvmotpowDT,reppowDT,trappowDT,uvdetDT,uvrepdetDT,uvbiascurrentDT)
	uvmaxN=int(math.floor(uvmaxDT/analogstepsize))
	
	holdtime=float(params['CNC']['holdtime']) 
	uvholdtime=float(params['UV']['holdtime'])
	transtime=float(params['TRANSFER']['holdtime'])
	
	duration=maxDT+holdtime+transtime

	#CREATE CNC RAMP FILES --->     MOT POWER,  REP 

	 #MOT POWER
	f=open(motramp,'w')
	for i in range(motN+1): 
		sample = '%.4f' % (motpowSS + (motpowCNC-motpowSS)*i/motN) #linear ramp
		f.write(sample)
		if i != motN:
			f.write(',')
	f.write('\n')
	f.close()

	#REPUMP DETUNING
	f=open(repramp,'w')
	for i in range(repdetN+1): 
		sample = '%.4f' % (repdetSS + (repdetCNC-repdetSS)*i/repdetN) #linear ramp
		f.write(sample)
		if i != repdetN:
			f.write(',')
	f.write('\n')
	f.close()

	#TRAP DETUNING
	f=open(trapramp,'w')
	for i in range(trapdetN+1): 
		sample = '%.4f' % (trapdetSS + (trapdetCNC-trapdetSS)*i/trapdetN) #linear ramp
		f.write(sample)
		if i != trapdetN:
			f.write(',')
	f.write('\n')
	f.close()
	
	#REPUMP POWER
	f=open(repPowRamp,'w')
	for i in range(maxN+1): 
		sample = '%.4f' % (reppowSS) #held constant
		f.write(sample)
		if i != maxN:
			f.write(',')
	f.write('\n')
	f.close()

	#TRAP POWER
	f=open(trapPowRamp,'w')
	for i in range(maxN+1):
		sample = '%.4f' % (trappowSS)  #held constant
		f.write(sample)
		if i != maxN:
			f.write(',')
	f.write('\n')
	f.close()

	 #BIAS CURRENT
	f=open(biascurrentramp,'w')
	for i in range(biascurrentN+1): #linear ramp
		sample = '%.4f' % (biascurrentSS + (biascurrentCNC-biascurrentSS)*i/biascurrentN)
		f.write(sample)
		if i != biascurrentN:
			f.write(',')
	f.write('\n')
	f.close()
	
	#UV POWER
	#f=open(uvpowramp,'w')
	#for i in range(maxN+1):
	#	sample = '%.4f'%(0.0000)
	#	f.write(sample)
	#	if i !=maxN:
	#		f.write(',')
	#f.write('\n')
	#f.close()

	#UV DETUNING
	f=open(uvdetramp,'w')
	for i in range(maxN+1):
		sample = '%.4f'%(uvdetI) #held constant
		f.write(sample)
		if i !=maxN:
			f.write(',')
	f.write('\n')
	f.close()

	# Append all ramps to longest length	
	wfm.appendhold(motramp, maxDT-motpowDT, analogstepsize)
	wfm.appendhold(trapramp, maxDT-trapdetDT, analogstepsize)
	wfm.appendhold(repramp, maxDT-repdetDT, analogstepsize)
	wfm.appendhold(biascurrentramp, maxDT-biascurrentDT, analogstepsize)
	
	#The rest of the holdtime values are appended to the waveforms
	wfm.appendhold(repramp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(trapramp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(motramp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(biascurrentramp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(repPowRamp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(trapPowRamp, holdtime-uvholdtime, analogstepsize)
	#wfm.appendhold(uvpowramp, holdtime-uvholdtime, analogstepsize)
	wfm.appendhold(uvdetramp, holdtime-uvholdtime, analogstepsize)
	
	#BUILD UV RAMPS

	#MOT POWER UV
	f=open(uvmotramp,'w')
	for i in range(uvmotN+1): 
		sample = '%.4f' % (motpowCNC + (motpowUV-motpowCNC)*i/uvmotN) #linear ramp
		f.write(sample)
		if i != uvmotN:
			f.write(',')
	f.write('\n')
	f.close()

	#REPUMP POWER
	f=open(uvrepPowRamp,'w')
	for i in range(reppowN+1): 
		sample = '%.4f' % (reppowSS + (reppowUV-reppowSS)*i/reppowN) #linear ramp
		f.write(sample)
		if i != reppowN:
			f.write(',')
	f.write('\n')
	f.close()

	#TRAP POWER
	f=open(uvtrapPowRamp,'w')
	for i in range(trappowN+1):
		sample = '%.4f' % (trappowSS + (trappowUV-trappowSS)*i/trappowN)
		f.write(sample)
		if i != trappowN:
			f.write(',')
	f.write('\n')
	f.close()

	#UV DETUNING
	f=open(uvdetrampA,'w')
	for i in range(uvdetN+1):
		sample = '%.4f'%(uvdetI+(uvdetF-uvdetI)*i/uvdetN)
		f.write(sample)
		if i !=uvdetN:
			f.write(',')
	f.write('\n')
	f.close()
	
	#UV REPUMP DETUNING
	f=open(uvrepramp,'w')
	for i in range(uvrepdetN+1):
		sample = '%.4f'%(repdetCNC+(uvrepdet-repdetCNC)*i/uvrepdetN)
		f.write(sample)
		if i !=uvrepdetN:
			f.write(',')
	f.write('\n')
	f.close()
	
	#UV BIAS FIELD
	f=open(uvbiascurrentramp,'w')
	for i in range(biascurrentN+1): #linear ramp
		sample = '%.4f' % (biascurrentCNC + (biascurrentUV-biascurrentCNC)*i/uvbiascurrentN)
		f.write(sample)
		if i != uvbiascurrentN:
			f.write(',')
	f.write('\n')
	f.close()
	
	#UV POWER
	#f=open(uvpowrampA,'w')
	#for i in range(uvpowN+1):
	#	sample = '%.4f'%(uvpow*i/uvpowN)
	#	f.write(sample)
	#	if i !=uvpowN:
	#		f.write(',')
	#f.write('\n')
	#f.close()	
	
	# Append all ramps to longest length
	wfm.appendhold(uvmotramp, uvmaxDT-uvmotpowDT, analogstepsize)
	wfm.appendhold(uvrepPowRamp, uvmaxDT-reppowDT, analogstepsize)
	wfm.appendhold(uvtrapPowRamp, uvmaxDT-trappowDT, analogstepsize)
	wfm.appendhold(uvrepramp, uvmaxDT-uvrepdetDT, analogstepsize)
	wfm.appendhold(uvdetrampA, uvmaxDT-uvdetDT, analogstepsize)
	
	#The rest of the holdtime values are appended to the waveforms
	wfm.appendhold(uvmotramp, uvholdtime-uvmaxDT, analogstepsize)
	wfm.appendhold(uvrepPowRamp, uvholdtime-uvmaxDT, analogstepsize)
	wfm.appendhold(uvtrapPowRamp, uvholdtime-uvmaxDT, analogstepsize)
	wfm.appendhold(uvrepramp, uvholdtime-uvmaxDT, analogstepsize)
	wfm.appendhold(uvdetrampA, uvholdtime-uvmaxDT, analogstepsize)
	
	if gen.bstr('UV on',params)==True:
		#Ramps are combined
		wfm.appendramp(motramp,uvmotramp)
		wfm.appendramp(repPowRamp,uvrepPowRamp)
		wfm.appendramp(trapPowRamp,uvtrapPowRamp)
		wfm.appendramp(repramp,uvrepramp)
		wfm.appendramp(uvdetramp,uvdetrampA)
		wfm.appendramp(biascurrentramp,uvbiascurrentramp)
		#Remaining ramps are filled
		wfm.appendhold(trapramp, uvholdtime, analogstepsize)
	else:
		wfm.appendhold(motramp,uvholdtime,analogstepsize)
		wfm.appendhold(repPowRamp,uvholdtime,analogstepsize)
		wfm.appendhold(trapPowRamp,uvholdtime,analogstepsize)
		wfm.appendhold(repramp,uvholdtime,analogstepsize)
		wfm.appendhold(uvdetramp,uvholdtime,analogstepsize)
		wfm.appendhold(biascurrentramp,uvholdtime,analogstepsize)
		wfm.appendhold(trapramp,uvholdtime,analogstepsize)
	
	
	#10 more sample is appended before turning the MOT power  and trap/rep detuning/power to its imaging values
	#Thiese samples are not counted in the duration of the cncramps so the MOT AOM will be switched off at this point
	wfm.appendhold(motramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(trapramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(repramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(biascurrentramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(repPowRamp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(trapPowRamp, 10*analogstepsize, analogstepsize)
	#wfm.appendhold(uvpowramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(uvdetramp, 10*analogstepsize, analogstepsize)
	
	#Then 10 samples are appended with the imaging value
	wfm.appendvalue(motramp,10*analogstepsize,analogstepsize,motIMGpow)
	wfm.appendvalue(trapramp,10*analogstepsize,analogstepsize,trapIMGdet)
	wfm.appendvalue(repramp,10*analogstepsize,analogstepsize,repIMGdet)
	wfm.appendvalue(repPowRamp, 10*analogstepsize, analogstepsize,repIMGpow)
	wfm.appendvalue(trapPowRamp, 10*analogstepsize, analogstepsize,trapIMGpow)
	wfm.appendvalue(biascurrentramp, 10*analogstepsize, analogstepsize, biascurrentIMG)
	#wfm.appendhold(uvpowramp, 10*analogstepsize, analogstepsize)
	wfm.appendhold(uvdetramp, 10*analogstepsize, analogstepsize)


	#END OF RAMP BUILDING
	return duration
Example #11
0
evap_ss = float(report['EVAP']['evapss'])
s.analogwfm_add(evap_ss, [odtpow])
# ENDEVAP should be equal to image
s.wait(image)

#RELEASE FROM IR TRAP
s.digichg('odtttl', 0)
odttof = float(report['ODT']['odttof'])
s.wait(odttof)

#TAKE PICTURES
light = 'probe'
#light = 'motswitch'
#light = 'bragg'
trap_on_picture = 1
kinetics = gen.bstr('Kinetics', report)
print '...kinetics = ' + str(kinetics)
if kinetics == True:
    s, SERIESDT = andor.KineticSeries4(s, exp, light, noatoms, trap_on_picture)
else:
    s, SERIESDT = andor.FKSeries2(s, stepsize, exp, light, noatoms,
                                  trap_on_picture)

#After taking a picture sequence returns at time of the last probe strobe
#Wait 30ms to get past the end
s.wait(30.0)
s = gen.shutdown(s)
s.digichg('odtttl', 0)
s.digichg('odt7595', 0)

import seqconf
Example #12
0
def go_to_highfield(s):

    #Keep ODT on
    ODT = gen.bstr('ODT', report)
    if ODT == True:
        s.digichg('odtttl', 1)
    s.wait(20.0)

    ss = float(report['SEQ']['analogstepsize'])

    # Cool and Compress MOT
    # ENDCNC is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling.uvcoolRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

    # Set imaging values
    camera = 'ANDOR'
    motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(
        motpow, repdet, trapdet, reppow, trappow, camera)

    # Switch bfield to FESHBACH while UV cools in trap
    overlapdt = float(report['ODT']['overlapdt'])
    rampdelay = float(report['ODT']['rampdelay'])
    rampbf = float(report['ODT']['rampbf'])
    bf = float(report['ODT']['bf'])
    holdbf = float(report['ODT']['holdbf'])
    switchdt = float(report['FESHBACH']['switchdt'])
    offdelay = float(report['FESHBACH']['offdelay'])
    quickdelay = float(report['FESHBACH']['quickdelay'])
    switchdelay = float(report['FESHBACH']['switchdelay'])
    bias = float(report['FESHBACH']['bias'])
    biasrampdt = float(report['FESHBACH']['rampdt'])

    bfield.chop(ENDUVMOT - overlapdt)
    bfield.appendhold(rampdelay)
    bfield.linear(bf, rampbf)
    bfield.appendhold(holdbf)
    bfield.linear(0.0, 0.0)
    ENDBFIELD = (rampdelay + rampbf + holdbf - overlapdt)
    bfield.appendhold(-ENDBFIELD + offdelay + 2 * switchdt + quickdelay +
                      switchdelay)
    bfield.linear(bias, biasrampdt)

    #Add waveforms to sequence
    s.analogwfm_add(
        ss,
        [motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow])

    #wait normally rounds down using floor, here the duration is changed before so that
    #the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    #insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr('CNC', report) == True else 0
    s.digichg('quick', quickval)
    s.wait(10.0)

    #insert UV pulse
    uvtime = float(report['UV']['uvtime'])
    s.wait(ENDCNC)
    s.digichg('quick', 0)
    s.wait(uvtime)
    s.digichg('uvaom1', 1)
    s.wait(-uvtime - ENDCNC)

    #Go to MOT release time
    s.wait(ENDUVMOT)
    s.digichg('quick', 0)

    #Leave UVMOT on for state transfer
    fstatedt = float(report['ODT']['fstatedt'])
    s.wait(fstatedt)
    s.digichg('uvaom1', 0)
    s.wait(-fstatedt)

    #RELEASE FROM MOT
    waitshutter = 5.0
    s.wait(waitshutter)
    s.digichg('uvshutter', 0)
    s.wait(-waitshutter)

    s.digichg('motswitch', 0)
    s.digichg('motshutter', 1)
    s.digichg('field', 0)

    #Insert ODT overlap with UVMOT and switch field to FESHBACH
    overlapdt = float(report['ODT']['overlapdt'])
    s.wait(-overlapdt)
    s.digichg('odtttl', 1)
    s.digichg('odt7595', 1)
    feshbachdt = rampdelay + rampbf + holdbf
    s.wait(feshbachdt)
    s.digichg('feshbach', 1)
    s.wait(overlapdt - feshbachdt)

    s.wait(offdelay)
    s.wait(2 * switchdt)
    s.wait(quickdelay)
    do_quick = 1
    s.digichg('field', 1)
    s.digichg('hfquick', do_quick)
    s.digichg('quick', do_quick)
    #Can't leave quick ON for more than quickmax
    quickmax = 100.
    s.wait(quickmax)
    s.digichg('hfquick', 0)
    s.digichg('quick', 0)
    s.wait(-quickmax)
    s.wait(switchdelay + biasrampdt)
    s.digichg('quick', 0)
    s.wait(-biasrampdt)
    s.wait(-switchdelay - quickdelay - 2 * switchdt - offdelay)

    #At this point the time sequence is at ENDUVMOT

    #This is the time until the end of the bfield ramp
    toENDBFIELD = biasrampdt + switchdelay + quickdelay + 2 * switchdt + offdelay

    return s, toENDBFIELD
Example #13
0
import seq, wfm, gen, cnc, andor, odt

report = gen.getreport()

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof = float(report['ANDOR']['tof'])
exp = float(report['ANDOR']['exp'])
noatoms = float(report['ANDOR']['noatoms'])

#SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

#Keep ODT on
ODT = gen.bstr('ODT', report)
if ODT == True:
    s.digichg('odtttl', 1)
s.wait(20.0)

ss = float(report['CNC']['cncstepsize'])
camera = 'ANDOR'

# Cool and Compress MOT
# ENDCNC is defined as the time up to release from the MOT
motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

# Set imaging values
motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(
    motpow, repdet, trapdet, reppow, trappow, bfield, camera)
sys.path.append('L:/software/apparatus3/convert')
import seq, wfm, gen, cnc, andor
report = gen.getreport()

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof = float(report['ANDOR']['tof'])
exp = float(report['ANDOR']['exp'])
noatoms = float(report['ANDOR']['noatoms'])

#SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

#Keep ODT on
ODT = gen.bstr('ODT', report)
if ODT == True:
    s.digichg('odtttl', 1)
s.wait(20.0)

#LOAD ODT
s, duration = cnc.run(s, 'ANDOR')

#RELEASE
s = gen.releaseMOT(s)

#UV LIGHT SHIFT PARAMETERS
intrapdt = float(report['UVLIGHTSHIFT']['intrapdt'])
pulse = float(report['UVLIGHTSHIFT']['pulse'])
postdt = float(report['UVLIGHTSHIFT']['postdt'])
texp = float(report['BASLER']['exp'])
postexp = float(report['BASLER']['postexp'])
backdt = float(report['BASLER']['backdt'])

#Use MOT beams for fluorescence imaging
probe = 'motswitch'

#SEQUENCE

s = seq.sequence(stepsize)
s = gen.initial(s)

uvmotdt = float(report['UV']['uvmotdt'])

s.wait(20.0)
ionize = gen.bstr('ionize', report)

s.digichg('uvaom1', 1 if ionize == True else 0)
s.wait(-1.0)
s.wait(uvmotdt)

s, duration = photoion.run(s, 'BASLER')
print "Duration = " + str(duration)
s.digichg('uvaom1', 0)

#Take fluorescence imaging shot with the MOT beams.
#LET MOT EXPAND
s.digichg('field', 0)
s.digichg('motswitch', 0)
s.wait(tof)
#PICTURE OF ATOMS
def run_proberepump(s, camera):
    global report
    ss = f("CNC", "cncstepsize")

    # Cool and Compress MOT
    # DURATION is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcoolRamps_proberepump(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC
    )

    # Imaging
    motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, camera
    )

    uvfppiezo.extend(maxDT)
    uvpow.extend(maxDT)

    # Add the waveforms
    s.analogwfm_add(ss, [motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow])

    # wait normally rounds down using floor, here the duration is changed before so that
    # the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    # insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr("CNC", report) == True else 0
    s.digichg("quick", quickval)
    s.wait(10.0)

    # go to end of CNC
    s.wait(ENDCNC)

    # insert UV pulse
    s.wait(f("UV", "uvtime"))

    # turn off MOT light , turn on probe to use as repump
    s.digichg("motswitch", 0)
    s.wait(-10.0)
    s.digichg("prshutter", 0)
    s.wait(10.0)
    s.digichg("probe", 1)

    s.digichg("uvaom1", 1)
    s.wait(-f("UV", "uvtime") - ENDCNC)

    # Go to MOT release time turn off UV and set QUICK back to low
    s.wait(ENDUVMOT)
    s.digichg("uvaom1", 0)
    s.digichg("quick", 0)

    # also turn off probe
    s.digichg("probe", 0)
    s.digichg("prshutter", 1)

    # print s.tcur

    return s, ENDUVMOT
def run_uvrepump(s, camera):
    global report
    ss = f("CNC", "cncstepsize")

    # Cool and Compress MOT
    # DURATION is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow2, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcoolRamps_repump(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC
    )

    # Imaging
    motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, camera
    )

    uvfppiezo.extend(maxDT)
    uvpow.extend(maxDT)
    uvpow2.extend(maxDT)

    # Add the waveforms
    s.analogwfm_add(ss, [motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow, uvpow2])

    # wait normally rounds down using floor, here the duration is changed before so that
    # the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    # insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr("CNC", report) == True else 0
    s.digichg("quick", quickval)
    s.wait(10.0)

    # insert UV pulse
    s.wait(ENDCNC)
    s.wait(f("UV", "uvtime"))
    # Shut down the UVAOM's and open the shutter
    s.wait(-50.0)
    s.digichg("uvaom1", 0)
    s.digichg("uvaom2", 0)
    s.digichg("uvshutter", 1)
    s.wait(50.0)
    # Turn on UVAOM
    s.digichg("uvaom1", 1)
    s.wait(-f("UV", "uvtime"))

    # Turn off Red Light Completly and turn UV repump after uvramp
    uvreptime = float(report["UV"]["uvreptime"])
    s.wait(uvreptime)
    s.digichg("uvaom2", 1)
    s.digichg("motswitch", 0)
    s.wait(-uvreptime)
    s.wait(-ENDCNC)

    # Go to MOT release time turn off UV and set QUICK back to low
    s.wait(ENDUVMOT)

    # Turn red light back on for imaging.
    s.digichg("uvaom1", 0)
    s.digichg("quick", 0)
    s.digichg("uvaom2", 0)
    s.digichg("motswitch", 1)

    # print s.tcur

    return s, ENDUVMOT
Example #18
0
def run(s,camera):
	global report
	ss=f('CNC','cncstepsize')
	
	# Cool and Compress MOT
	# DURATION is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()
	
	# Load UVMOT from CNCMOT
	uvpow2, uvpow, motpow, bfield, ENDUVMOT = uvRamps(motpow, bfield, ENDCNC)

	repdet.extend(ENDUVMOT)
	trapdet.extend(ENDUVMOT)
	reppow.extend(ENDUVMOT)
	trappow.extend(ENDUVMOT)


	# Imaging
	motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(motpow, repdet, trapdet, reppow, trappow, bfield,camera)

	uvpow.extend(maxDT)
	uvpow2.extend(maxDT)
	
	
	#---Add waveforms to sequence
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvpow, uvpow2])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#---Insert QUICK pulse for fast ramping of the field gradient during CNC
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	s.wait(ENDCNC)
	#s.digichg('quick',0)
	
	#---Go back in time, shut down the UVAOM's and open the shutter
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	
	#---Turn OFF red light
	delay_red = float(report['UV']['delay_red'])
	s.wait(delay_red)
	s.digichg('motswitch',0) 
	#s.digichg('motshutter',1)
	s.wait(-delay_red)
	
	#---Turn ON UVAOM's
	delay_uv = float(report['UV']['delay_uv'])
	s.wait(delay_uv)
	s.digichg('uvaom1',1)
	s.digichg('uvaom2',1)
	s.wait(-delay_uv)
	
	s.wait(-ENDCNC)
	
	#---Go to MOT release time and set QUICK back to low, turn off UV
	s.wait(ENDUVMOT)
	s.digichg('quick',0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	
	#---Turn red light back on for imaging.
	s.digichg('motswitch',1)
	
	#print s.tcur
	
	return s, ENDUVMOT
Example #19
0
def buildramps(aos, params, camera):

    [motIMGpow, trapIMGdet, repIMGdet, trapIMGpow, repIMGpow,
     biascurrentIMG] = IMGvalues(params, aos, camera)

    seqstepsize = float(params['SEQ']['stepsize'])
    analogstepsize = float(params['SEQ']['analogstepsize'])

    #PARAMETERS FOR CNC RAMPS

    motpowSS = aos.motpow(float(params['MOT']['motpow']))  #initial MOT power
    motpowCNC = aos.motpow(float(params['CNC']['motpowf']))  #final MOT power
    motpowDT = float(params['CNC']['dtmotpow'])  #MOT ramp time
    motN = int(math.floor(motpowDT / analogstepsize))  #MOT N of samples
    motramp = 'L:/software/apparatus3/seq/ramps/motpow_CNC.txt'

    repdetSS = aos.repdet(float(params['MOT']['repdetSS']))  #initial rep det
    repdetCNC = aos.repdet(float(params['CNC']['repdetf']))  #final rep det
    repdetDT = float(params['CNC']['dtrepdet'])  # rep ramp time
    repdetN = int(math.floor(repdetDT / analogstepsize))  #rep N of samples
    repramp = 'L:/software/apparatus3/seq/ramps/repdet_CNC.txt'

    trapdetSS = aos.trapdet(float(
        params['MOT']['trapdetSS']))  #initial trap det
    trapdetCNC = aos.trapdet(float(params['CNC']['trapdetf']))  #final trap det
    trapdetDT = float(params['CNC']['dttrapdet'])  # trap ramp time
    trapdetN = int(math.floor(trapdetDT / analogstepsize))  #trap N of samples
    trapramp = 'L:/software/apparatus3/seq/ramps/trapdet_CNC.txt'

    biascurrentSS = aos.biascurrent(float(
        params['MOT']['biascurrent']))  #initial bias current
    biascurrentCNC = aos.biascurrent(float(
        params['CNC']['biascurrentf']))  #final bias current
    biascurrentDT = float(
        params['CNC']['dtbiascurrent'])  #bias current ramp time
    biascurrentN = int(math.floor(biascurrentDT /
                                  analogstepsize))  #bias current N of samples
    biascurrentramp = 'L:/software/apparatus3/seq/ramps/biascurrent_CNC.txt'

    #PARAMETERS FOR UV COOLING RAMPS

    #uvpow=aos.uvpow(float(params['UV']['uvpow']))
    #time constraints means no calibration to start with
    #uvpow=float(params['UV']['uvpow'])
    #uvpowDT=float(params['UV']['dtuvpow'])
    #uvpowN=int(math.floor(motpowDT/analogstepsize))
    #uvpowramp='L:/software/apparatus3/seq/ramps/uvpow.txt'
    #uvpowrampA='L:/software/apparatus3/seq/ramps/uvpow_A.txt'

    motpowUV = aos.motpow(float(params['UV']['motpow']))
    uvmotpowDT = float(params['UV']['dtmot'])
    uvmotN = int(math.floor(uvmotpowDT / analogstepsize))
    uvmotramp = 'L:/software/apparatus3/seq/ramps/motramp_UV.txt'

    reppowSS = aos.reppow(float(params['MOT']['reppow']))  #initial rep pow
    reppowUV = aos.reppow(float(params['UV']['reppow']))  #final rep pow
    reppowDT = float(params['UV']['dtmot'])  # rep ramp time
    reppowN = int(math.floor(repdetDT / analogstepsize))  #rep N of samples
    repPowRamp = 'L:/software/apparatus3/seq/ramps/reppow_CNC.txt'
    uvrepPowRamp = 'L:/software/apparatus3/seq/ramps/reppow_UV.txt'

    trappowSS = aos.trappow(float(params['MOT']['trappow']))  #initial trap pow
    trappowUV = aos.trappow(float(params['UV']['trappow']))  #final trap pow
    trappowDT = float(params['UV']['dtmot'])  # trap ramp time
    trappowN = int(math.floor(trappowDT / analogstepsize))  #trap N of samples
    trapPowRamp = 'L:/software/apparatus3/seq/ramps/trappow_CNC.txt'
    uvtrapPowRamp = 'L:/software/apparatus3/seq/ramps/trappow_UV.txt'

    #uvdetI=aos.uvdet(float(params['UV']['uvdeti']))
    #uvdetF=aos.uvdet(float(params['UV']['uvdetf']))
    #again need to do calibrations for now use straight voltage
    uvdetI = float(params['UV']['uvdeti'])
    uvdetF = float(params['UV']['uvdetf'])
    uvdetDT = float(params['UV']['dtuvdet'])
    uvdetN = int(math.floor(uvdetDT / analogstepsize))
    uvdetramp = 'L:/software/apparatus3/seq/ramps/uvdet.txt'
    uvdetrampA = 'L:/software/apparatus3/seq/ramps/uvdet_A.txt'

    uvrepdet = aos.repdet(float(params['UV']['repdet']))
    uvrepdetDT = float(params['UV']['dtmot'])
    uvrepdetN = int(math.floor(uvrepdetDT / analogstepsize))
    uvrepramp = 'L:/software/apparatus3/seq/ramps/repdet_UV.txt'

    biascurrentUV = float(params['UV']['uvbiascurrent'])
    uvbiascurrentDT = float(params['UV']['dtmot'])
    uvbiascurrentN = int(math.floor(uvbiascurrentDT / analogstepsize))
    uvbiascurrentramp = 'L:/software/apparatus3/seq/ramps/biascurrent_UV.txt'

    #PARAMETERS FOR TRANSFER RAMPS
    #not ready for prime time
    #motpowTR=aos.motpow(float(params['TRANSFER']['motpow'])
    #trmotpowDT=float(params['TRANSFER']['detmotpow']
    #trmotN=int(math.floor(trmotpowDT/analogstepsize))
    #trmotramp='L:software/apparatus3/seq/ramps/motpow_TR.txt'

    maxDT = max(motpowDT, repdetDT, trapdetDT, reppowDT, trappowDT,
                biascurrentDT)
    maxN = int(math.floor(maxDT / analogstepsize))
    #uvmaxDT=max(uvmotpowDT,reppowDT,trappowDT,uvpowDT,uvdetDT)
    uvmaxDT = max(uvmotpowDT, reppowDT, trappowDT, uvdetDT, uvrepdetDT,
                  uvbiascurrentDT)
    uvmaxN = int(math.floor(uvmaxDT / analogstepsize))

    holdtime = float(params['CNC']['holdtime'])
    uvholdtime = float(params['UV']['holdtime'])
    transtime = float(params['TRANSFER']['holdtime'])

    duration = maxDT + holdtime + transtime

    #CREATE CNC RAMP FILES --->     MOT POWER,  REP

    #MOT POWER
    f = open(motramp, 'w')
    for i in range(motN + 1):
        sample = '%.4f' % (motpowSS +
                           (motpowCNC - motpowSS) * i / motN)  #linear ramp
        f.write(sample)
        if i != motN:
            f.write(',')
    f.write('\n')
    f.close()

    #REPUMP DETUNING
    f = open(repramp, 'w')
    for i in range(repdetN + 1):
        sample = '%.4f' % (repdetSS +
                           (repdetCNC - repdetSS) * i / repdetN)  #linear ramp
        f.write(sample)
        if i != repdetN:
            f.write(',')
    f.write('\n')
    f.close()

    #TRAP DETUNING
    f = open(trapramp, 'w')
    for i in range(trapdetN + 1):
        sample = '%.4f' % (trapdetSS + (trapdetCNC - trapdetSS) * i / trapdetN
                           )  #linear ramp
        f.write(sample)
        if i != trapdetN:
            f.write(',')
    f.write('\n')
    f.close()

    #REPUMP POWER
    f = open(repPowRamp, 'w')
    for i in range(maxN + 1):
        sample = '%.4f' % (reppowSS)  #held constant
        f.write(sample)
        if i != maxN:
            f.write(',')
    f.write('\n')
    f.close()

    #TRAP POWER
    f = open(trapPowRamp, 'w')
    for i in range(maxN + 1):
        sample = '%.4f' % (trappowSS)  #held constant
        f.write(sample)
        if i != maxN:
            f.write(',')
    f.write('\n')
    f.close()

    #BIAS CURRENT
    f = open(biascurrentramp, 'w')
    for i in range(biascurrentN + 1):  #linear ramp
        sample = '%.4f' % (biascurrentSS +
                           (biascurrentCNC - biascurrentSS) * i / biascurrentN)
        f.write(sample)
        if i != biascurrentN:
            f.write(',')
    f.write('\n')
    f.close()

    #UV POWER
    #f=open(uvpowramp,'w')
    #for i in range(maxN+1):
    #	sample = '%.4f'%(0.0000)
    #	f.write(sample)
    #	if i !=maxN:
    #		f.write(',')
    #f.write('\n')
    #f.close()

    #UV DETUNING
    f = open(uvdetramp, 'w')
    for i in range(maxN + 1):
        sample = '%.4f' % (uvdetI)  #held constant
        f.write(sample)
        if i != maxN:
            f.write(',')
    f.write('\n')
    f.close()

    # Append all ramps to longest length
    wfm.appendhold(motramp, maxDT - motpowDT, analogstepsize)
    wfm.appendhold(trapramp, maxDT - trapdetDT, analogstepsize)
    wfm.appendhold(repramp, maxDT - repdetDT, analogstepsize)
    wfm.appendhold(biascurrentramp, maxDT - biascurrentDT, analogstepsize)

    #The rest of the holdtime values are appended to the waveforms
    wfm.appendhold(repramp, holdtime - uvholdtime, analogstepsize)
    wfm.appendhold(trapramp, holdtime - uvholdtime, analogstepsize)
    wfm.appendhold(motramp, holdtime - uvholdtime, analogstepsize)
    wfm.appendhold(biascurrentramp, holdtime - uvholdtime, analogstepsize)
    wfm.appendhold(repPowRamp, holdtime - uvholdtime, analogstepsize)
    wfm.appendhold(trapPowRamp, holdtime - uvholdtime, analogstepsize)
    #wfm.appendhold(uvpowramp, holdtime-uvholdtime, analogstepsize)
    wfm.appendhold(uvdetramp, holdtime - uvholdtime, analogstepsize)

    #BUILD UV RAMPS

    #MOT POWER UV
    f = open(uvmotramp, 'w')
    for i in range(uvmotN + 1):
        sample = '%.4f' % (motpowCNC +
                           (motpowUV - motpowCNC) * i / uvmotN)  #linear ramp
        f.write(sample)
        if i != uvmotN:
            f.write(',')
    f.write('\n')
    f.close()

    #REPUMP POWER
    f = open(uvrepPowRamp, 'w')
    for i in range(reppowN + 1):
        sample = '%.4f' % (reppowSS +
                           (reppowUV - reppowSS) * i / reppowN)  #linear ramp
        f.write(sample)
        if i != reppowN:
            f.write(',')
    f.write('\n')
    f.close()

    #TRAP POWER
    f = open(uvtrapPowRamp, 'w')
    for i in range(trappowN + 1):
        sample = '%.4f' % (trappowSS + (trappowUV - trappowSS) * i / trappowN)
        f.write(sample)
        if i != trappowN:
            f.write(',')
    f.write('\n')
    f.close()

    #UV DETUNING
    f = open(uvdetrampA, 'w')
    for i in range(uvdetN + 1):
        sample = '%.4f' % (uvdetI + (uvdetF - uvdetI) * i / uvdetN)
        f.write(sample)
        if i != uvdetN:
            f.write(',')
    f.write('\n')
    f.close()

    #UV REPUMP DETUNING
    f = open(uvrepramp, 'w')
    for i in range(uvrepdetN + 1):
        sample = '%.4f' % (repdetCNC + (uvrepdet - repdetCNC) * i / uvrepdetN)
        f.write(sample)
        if i != uvrepdetN:
            f.write(',')
    f.write('\n')
    f.close()

    #UV BIAS FIELD
    f = open(uvbiascurrentramp, 'w')
    for i in range(biascurrentN + 1):  #linear ramp
        sample = '%.4f' % (
            biascurrentCNC +
            (biascurrentUV - biascurrentCNC) * i / uvbiascurrentN)
        f.write(sample)
        if i != uvbiascurrentN:
            f.write(',')
    f.write('\n')
    f.close()

    #UV POWER
    #f=open(uvpowrampA,'w')
    #for i in range(uvpowN+1):
    #	sample = '%.4f'%(uvpow*i/uvpowN)
    #	f.write(sample)
    #	if i !=uvpowN:
    #		f.write(',')
    #f.write('\n')
    #f.close()

    # Append all ramps to longest length
    wfm.appendhold(uvmotramp, uvmaxDT - uvmotpowDT, analogstepsize)
    wfm.appendhold(uvrepPowRamp, uvmaxDT - reppowDT, analogstepsize)
    wfm.appendhold(uvtrapPowRamp, uvmaxDT - trappowDT, analogstepsize)
    wfm.appendhold(uvrepramp, uvmaxDT - uvrepdetDT, analogstepsize)
    wfm.appendhold(uvdetrampA, uvmaxDT - uvdetDT, analogstepsize)

    #The rest of the holdtime values are appended to the waveforms
    wfm.appendhold(uvmotramp, uvholdtime - uvmaxDT, analogstepsize)
    wfm.appendhold(uvrepPowRamp, uvholdtime - uvmaxDT, analogstepsize)
    wfm.appendhold(uvtrapPowRamp, uvholdtime - uvmaxDT, analogstepsize)
    wfm.appendhold(uvrepramp, uvholdtime - uvmaxDT, analogstepsize)
    wfm.appendhold(uvdetrampA, uvholdtime - uvmaxDT, analogstepsize)

    if gen.bstr('UV on', params) == True:
        #Ramps are combined
        wfm.appendramp(motramp, uvmotramp)
        wfm.appendramp(repPowRamp, uvrepPowRamp)
        wfm.appendramp(trapPowRamp, uvtrapPowRamp)
        wfm.appendramp(repramp, uvrepramp)
        wfm.appendramp(uvdetramp, uvdetrampA)
        wfm.appendramp(biascurrentramp, uvbiascurrentramp)
        #Remaining ramps are filled
        wfm.appendhold(trapramp, uvholdtime, analogstepsize)
    else:
        wfm.appendhold(motramp, uvholdtime, analogstepsize)
        wfm.appendhold(repPowRamp, uvholdtime, analogstepsize)
        wfm.appendhold(trapPowRamp, uvholdtime, analogstepsize)
        wfm.appendhold(repramp, uvholdtime, analogstepsize)
        wfm.appendhold(uvdetramp, uvholdtime, analogstepsize)
        wfm.appendhold(biascurrentramp, uvholdtime, analogstepsize)
        wfm.appendhold(trapramp, uvholdtime, analogstepsize)

    #10 more sample is appended before turning the MOT power  and trap/rep detuning/power to its imaging values
    #Thiese samples are not counted in the duration of the cncramps so the MOT AOM will be switched off at this point
    wfm.appendhold(motramp, 10 * analogstepsize, analogstepsize)
    wfm.appendhold(trapramp, 10 * analogstepsize, analogstepsize)
    wfm.appendhold(repramp, 10 * analogstepsize, analogstepsize)
    wfm.appendhold(biascurrentramp, 10 * analogstepsize, analogstepsize)
    wfm.appendhold(repPowRamp, 10 * analogstepsize, analogstepsize)
    wfm.appendhold(trapPowRamp, 10 * analogstepsize, analogstepsize)
    #wfm.appendhold(uvpowramp, 10*analogstepsize, analogstepsize)
    wfm.appendhold(uvdetramp, 10 * analogstepsize, analogstepsize)

    #Then 10 samples are appended with the imaging value
    wfm.appendvalue(motramp, 10 * analogstepsize, analogstepsize, motIMGpow)
    wfm.appendvalue(trapramp, 10 * analogstepsize, analogstepsize, trapIMGdet)
    wfm.appendvalue(repramp, 10 * analogstepsize, analogstepsize, repIMGdet)
    wfm.appendvalue(repPowRamp, 10 * analogstepsize, analogstepsize, repIMGpow)
    wfm.appendvalue(trapPowRamp, 10 * analogstepsize, analogstepsize,
                    trapIMGpow)
    wfm.appendvalue(biascurrentramp, 10 * analogstepsize, analogstepsize,
                    biascurrentIMG)
    #wfm.appendhold(uvpowramp, 10*analogstepsize, analogstepsize)
    wfm.appendhold(uvdetramp, 10 * analogstepsize, analogstepsize)

    #END OF RAMP BUILDING
    return duration
def constructLoadRamps(cam):
	global report

	# Initialize channels to MOT SS values and with cncstepsize
	ss=f('CNC','cncstepsize')
	motpow   = wfm.wave(cnv('motpow',f('MOT','motpow'))     ,ss)
	repdet   = wfm.wave(cnv('repdet',f('MOT','repdetSS'))   ,ss)
	trapdet  = wfm.wave(cnv('trapdet',f('MOT','trapdetSS')) ,ss)
	reppow   = wfm.wave(cnv('reppow',f('MOT','reppowSS'))   ,ss)
	trappow  = wfm.wave(cnv('trappow',f('MOT','trappowSS')) ,ss)
	bfield   = wfm.wave(cnv('bfield',f('MOT','bfield'))     ,ss)
	
	CNC = gen.bstr('CNC',report)
	#If CNC is selected in the report then insert necessary linear ramps
	
	#First ramp bfield
	SINH = gen.bstr('sinh',report)
	if SINH == True:
		bfield.sinhRise(  cnv('bfield',  f('CNC','bfieldf'))    if CNC == True else  cnv('bfield',f('MOT','bfield'))    ,  f('CNC','dtbfield'), f('CNC','dtbfield')*f('CNC','taubfield'))
	else:
		bfield.linear(  cnv('bfield',  f('CNC','bfieldf'))    if CNC == True else  cnv('bfield',f('MOT','bfield'))    ,  f('CNC','dtbfield'))
	
	#Hold off start of laser ramps
	delay = f('CNC','delay')
	motpow.appendhold( delay )
	repdet.appendhold( delay )
	trapdet.appendhold( delay )
	reppow.appendhold( delay )
	trappow.appendhold( delay )
	
	#Do laser ramps
	motpow.linear(  cnv('motpow',  f('CNC','motpowf'))    if CNC == True else  cnv('motpow',f('MOT','motpow'))    ,  f('CNC','dtmotpow'))
	repdet.linear(  cnv('repdet',  f('CNC','repdetf'))    if CNC == True else  cnv('repdet',f('MOT','repdetSS'))  ,  f('CNC','dtrepdet'))
	trapdet.linear( cnv('trapdet', f('CNC','trapdetf'))   if CNC == True else  cnv('trapdet',f('MOT','trapdetSS')),  f('CNC','dttrapdet'))
	reppow.linear(  cnv('reppow',  f('CNC','reppowf'))    if CNC == True else  cnv('reppow',f('MOT','reppowSS'))  ,  f('CNC','dtreppow'))
	trappow.linear( cnv('trappow', f('CNC','trappowf'))   if CNC == True else  cnv('trappow',f('MOT','trappowSS')),  f('CNC','dttrappow'))
	
	print motpow.dt()
	#Extend all ramps to match current total duration
	print CNC
	lifetime = gen.bstr('Lifetime',report)
	ht = (f('CNC','holdtime') if CNC == True or lifetime == True else 0.0)
	print "holdtime = " + str(ht)
	DURATION = max( motpow.dt(), repdet.dt(), trapdet.dt(), reppow.dt(), trappow.dt(), bfield.dt() ) + ht
	#DURATION = DURATION + ht
	motpow.extend( DURATION)
	print motpow.dt()
	repdet.extend( DURATION)
	trapdet.extend(DURATION)
	bfield.extend( DURATION)
	reppow.extend( DURATION)
	trappow.extend( DURATION)
	maxN=int(math.floor( (DURATION)/ss))+1
	
	#print motpow.dt()
	#print reppow.dt()
	#print trappow.dt()
	#print repdet.dt()
	#print trapdet.dt()
	#print bfield.dt()
	#print uvdet.dt()
	
	#Up to here you have a Cooled and Compressed MOT
	#
	
	#Ramp down things quickly to UV values
	uvdt = f('UV','dt')
	motpow.linear(  cnv('motpow', f('UV','uvmotpow')), uvdt)
	reppow.linear(  cnv('reppow', f('UV','uvreppow')), uvdt)
	trappow.linear( 0.0                               ,uvdt)
	repdet.linear(  cnv('repdet', f('UV','uvrepdet')), uvdt)
	trapdet.linear( cnv('trapdet',f('UV','uvtrapdet')),uvdt)
	bfield.linear(  cnv('bfield', f('UV','uvbfield')), uvdt)
	
	#Hold UV MOT for uvmotdt 
	uvmotdt = f('UV','uvmotdt')
	motpow.appendhold(uvmotdt)
	reppow.appendhold(uvmotdt)
	trappow.appendhold(uvmotdt)
	repdet.appendhold(uvmotdt)
	trapdet.appendhold(uvmotdt)
	bfield.appendhold(uvmotdt)

	#Ramp up the bfield during uvramp
	uvramp = f('UV','uvramp')
	motpow.appendhold(uvramp)
	reppow.appendhold(uvramp)
	trappow.appendhold(uvramp)
	repdet.appendhold(uvramp)
	trapdet.appendhold(uvramp)
	bfield.linear( cnv('bfield', f('UV','uvbfieldf')), uvramp)
	
	#Hold everything for a little more
	uvhold = f('UV','uvhold')
	motpow.appendhold(uvhold)
	reppow.appendhold(uvhold)
	trappow.appendhold(uvhold)
	repdet.appendhold(uvhold)
	trapdet.appendhold(uvhold)
	bfield.appendhold(uvhold)
	
	CNCDURATION = DURATION
	UVMOTDURATION = DURATION + uvdt + uvmotdt + uvramp
	DURATION = UVMOTDURATION + uvhold	


	#Insert bfield imaging value at release
	bfield.linear(cnv('bfield',f(cam,'imgbfield')),0.0)
	
	#Insert AOM imaging values 30us after release
	imgdt=0.03
	motpow.appendhold(imgdt)
	repdet.appendhold(imgdt)
	trapdet.appendhold(imgdt)
	reppow.appendhold(imgdt)
	trappow.appendhold(imgdt)
	
	motpow.linear( cnv('motpow' ,f(cam,'imgpow')),    0.0)
	repdet.linear( cnv('repdet' ,f(cam,'imgdetrep')), 0.0)
	trapdet.linear(cnv('trapdet',f(cam,'imgdettrap')),0.0)
	reppow.linear( cnv('reppow' ,f(cam,'imgpowrep')), 0.0)
	trappow.linear(cnv('trappow',f(cam,'imgpowtrap')),0.0)

	maxDT = max( motpow.dt(), repdet.dt(), trapdet.dt(), bfield.dt(), reppow.dt(), trappow.dt())

	motpow.extend(maxDT)
	repdet.extend(maxDT)
	trapdet.extend(maxDT)
	bfield.extend(maxDT)
	reppow.extend(maxDT)
	trappow.extend(maxDT)

	motpow.fileoutput( 'L:/software/apparatus3/seq/ramps/motpow.txt')
	repdet.fileoutput( 'L:/software/apparatus3/seq/ramps/repdet.txt')
	trapdet.fileoutput('L:/software/apparatus3/seq/ramps/trapdet.txt')
	bfield.fileoutput( 'L:/software/apparatus3/seq/ramps/bfield.txt')
	reppow.fileoutput( 'L:/software/apparatus3/seq/ramps/reppow.txt')
	trappow.fileoutput('L:/software/apparatus3/seq/ramps/trappow.txt')

	return CNCDURATION, DURATION
def go_to_highfield(s):

    #Keep ODT on
    ODT = gen.bstr('ODT', report)
    if ODT == True:
        s.digichg('odtttl', 1)
    s.wait(20.0)

    ss = float(report['SEQ']['analogstepsize'])

    # Cool and Compress MOT
    # ENDCNC is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvred.uvcoolRamps(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

    # Set imaging values
    camera = 'ANDOR'
    motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(
        motpow, repdet, trapdet, reppow, trappow, camera)

    # Switch bfield to FESHBACH
    overlapdt = float(report['ODT']['overlapdt'])
    rampdelay = float(report['FESHBACH']['rampdelay'])
    rampbf = float(report['FESHBACH']['rampbf'])
    bf = float(report['FESHBACH']['bf'])
    feshbachdt = float(report['FESHBACH']['feshbachdt'])
    switchondt = float(report['FESHBACH']['switchondt'])
    switchdelay = float(report['FESHBACH']['switchdelay'])
    bias = float(report['FESHBACH']['bias'])
    biasrampdt = float(report['FESHBACH']['rampdt'])

    bfield.chop(ENDUVMOT - overlapdt)
    bfield.appendhold(rampdelay)
    bfield.linear(bf, rampbf)
    bfield.extend(ENDUVMOT + feshbachdt)
    bfield.linear(0.0, 0.0)
    ENDBFIELD = feshbachdt
    bfield.appendhold(switchondt + switchdelay)
    bfield.linear(bias, biasrampdt)

    #---Ramp up ODT
    odtpow0 = odt.odt_wave('odtpow', f('ODT', 'odtpow0'), ss)
    odtpow0.extend(ENDUVMOT)

    #Add waveforms to sequence
    s.analogwfm_add(ss, [
        motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow,
        odtpow0
    ])

    #wait normally rounds down using floor, here the duration is changed before so that
    #the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    #insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr('CNC', report) == True else 0
    s.digichg('quick', quickval)
    s.wait(10.0)

    #insert UV pulse
    uvtime = float(report['UVRED']['uvtime'])
    s.wait(ENDCNC)
    s.digichg('quick', 0)
    s.wait(uvtime)
    #Shut down the UVAOM's and open the shutter
    s.wait(-50.0)
    s.digichg('uvaom1', 0)
    s.digichg('uvaom2', 0)
    s.digichg('uvshutter', 1)
    s.wait(50.0)
    #Turn on UVAOM
    s.digichg('uvaom1', 1)
    s.wait(-uvtime - ENDCNC)

    #Go to MOT release time and set QUICK back to low
    s.wait(ENDUVMOT)
    s.digichg('quick', 0)

    #CAREFUL: State transfer should be programmed in uvred.py, as it is done un uvmot.py
    s.digichg('uvaom1', 0)

    #RELEASE FROM MOT
    waitshutter = 5.0
    s.wait(waitshutter)
    s.digichg('uvshutter', 0)
    #~ s.wait(20.0)
    #~ s.digichg('uvaom1',0)
    #~ s.digichg('uvaom2',0)
    #~ s.wait(-20.0)
    s.wait(-waitshutter)

    s.digichg('motswitch', 0)
    s.digichg('motshutter', 1)
    s.digichg('field', 0)

    #Insert ODT overlap with UVMOT and switch field to FESHBACH
    overlapdt = float(report['ODT']['overlapdt'])
    servodt = float(report['ODT']['servodt'])
    s.wait(-overlapdt - servodt)
    s.digichg('odt7595', 1)
    s.wait(servodt)
    s.digichg('odtttl', 1)
    #feshbachdt = rampdelay + rampbf + holdbf
    s.wait(overlapdt)
    s.wait(feshbachdt)
    s.digichg('feshbach', 1)
    #s.wait(overlapdt - feshbachdt)
    #s.wait( -feshbachdt)

    #s.wait(offdelay)
    #s.wait(2*switchdt)
    #s.wait(quickdelay)
    s.wait(switchondt)
    do_quick = 1
    s.digichg('field', 1)
    s.digichg('hfquick', do_quick)
    s.digichg('quick', do_quick)
    #Can't leave quick ON for more than quickmax
    quickmax = 100.
    s.wait(quickmax)
    s.digichg('hfquick', 0)
    s.digichg('quick', 0)
    s.wait(-quickmax)
    s.wait(switchdelay + biasrampdt)
    s.digichg('quick', 0)
    s.wait(-biasrampdt)
    #s.wait(-switchdelay-quickdelay-2*switchdt-offdelay)
    s.wait(-switchdelay - switchondt - feshbachdt - ss)

    #At this point the time sequence is at ENDUVMOT

    #This is the time until the end of the bfield ramp
    #toENDBFIELD = biasrampdt + switchdelay + quickdelay + 2*switchdt + offdelay
    toENDBFIELD = biasrampdt + switchdelay + switchondt + feshbachdt

    return s, toENDBFIELD
report = gen.getreport()

# PARAMETERS
stepsize = float(report["SEQ"]["stepsize"])
tof = float(report["BASLER"]["tof"])
preexp = float(report["BASLER"]["preexp"])
texp = float(report["BASLER"]["exp"])
postexp = float(report["BASLER"]["postexp"])
noatoms = float(report["BASLER"]["noatoms"])

# SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

# Keep ODT on
ODT = gen.bstr("ODT", report)
if ODT == True:
    s.digichg("odtttl", 1)
s.wait(20.0)

# LOAD ODT
s, ENDUVMOT = uvcooling.run(s, "BASLER")
s.digichg("uvaom1", 1)

# Insert ODT overlap with UVMOT
overlapdt = float(report["ODT"]["overlapdt"])
s.wait(-overlapdt)
s.digichg("odtttl", 1)
s.wait(overlapdt)

# Leave UVMOT on for state transfer
Example #23
0
def run(s,camera):
	global report
	ss=f('CNC','cncstepsize')
	
	# Cool and Compress MOT
	# DURATION is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()
	
	# Load UVMOT from CNCMOT
	uvfppiezo, uvpow2, uvpow, motpow, bfield, ENDUVMOT = uvRamps(motpow, bfield, ENDCNC)

	repdet.extend(ENDUVMOT)
	trapdet.extend(ENDUVMOT)
	reppow.extend(ENDUVMOT)
	trappow.extend(ENDUVMOT)


	# Imaging
	motpow, repdet, trapdet, reppow, trappow, bfield, maxDT = cnc.imagingRamps(motpow, repdet, trapdet, reppow, trappow, bfield,camera)

	uvfppiezo.extend(maxDT)
	uvpow.extend(maxDT)
	uvpow2.extend(maxDT)
	
	
	#---Add waveforms to sequence
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow, uvpow2])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#---Insert QUICK pulse for fast ramping of the field gradient during CNC
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)
	s.wait(10.0)
	s.wait(ENDCNC)
	#s.digichg('quick',0)
	
	#---Go back in time, shut down the UVAOM's and open the shutter
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	
	#---Turn OFF red light
	delay_red = float(report['UV']['delay_red'])
	s.wait(delay_red)
	s.digichg('motswitch',0) 
	#s.digichg('motshutter',1)
	s.wait(-delay_red)
	
	#---Turn ON UVAOM's
	delay_uv = float(report['UV']['delay_uv'])
	s.wait(delay_uv)
	s.digichg('uvaom1',1)
	s.digichg('uvaom2',1)
	s.wait(-delay_uv)
	
	s.wait(-ENDCNC)
	
	#---Go to MOT release time and set QUICK back to low, turn off UV
	s.wait(ENDUVMOT)
	s.digichg('quick',0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	
	#---Turn red light back on for imaging.
	s.digichg('motswitch',1)
	
	#print s.tcur
	
	return s, ENDUVMOT

# PARAMETERS
stepsize = float(report["SEQ"]["stepsize"])
tof = float(report["ANDOR"]["tof"])
exp = float(report["ANDOR"]["exp"])
noatoms = float(report["ANDOR"]["noatoms"])

# SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

s.digichg("odt7595", 0)

# Keep ODT on
ODT = gen.bstr("ODT", report)
if ODT == True:
    s.digichg("odtttl", 1)
s.wait(20.0)

# LOAD ODT
s, ENDUVMOT = uvred.run(s, "ANDOR")
s.digichg("uvaom1", 1)

# Insert ODT overlap with UVMOT
overlapdt = float(report["ODT"]["overlapdt"])
s.wait(-overlapdt)
s.digichg("odtttl", 1)
s.digichg("odt7595", 1)
s.wait(overlapdt)
Example #25
0
def cncRamps():
    # Initialize channels to MOT SS values and with cncstepsize
    ss = f('CNC', 'cncstepsize')
    motpow = wfm.wave('motpow', f('MOT', 'motpow'), ss)
    repdet = wfm.wave('repdet', f('MOT', 'repdetSS'), ss)
    trapdet = wfm.wave('trapdet', f('MOT', 'trapdetSS'), ss)
    reppow = wfm.wave('reppow', f('MOT', 'reppowSS'), ss)
    trappow = wfm.wave('trappow', f('MOT', 'trappowSS'), ss)
    bfield = wfm.wave('bfield', f('MOT', 'bfield'), ss)

    CNC = gen.bstr('CNC', report)
    #If CNC is selected in the report then insert necessary linear ramps

    #First ramp bfield
    SINH = gen.bstr('sinh', report)
    if SINH == True:
        bfield.sinhRise(
            f('CNC', 'bfieldf') if CNC == True else f('MOT', 'bfield'),
            f('CNC', 'dtbfield'),
            f('CNC', 'dtbfield') * f('CNC', 'taubfield'))
    else:
        bfield.linear(
            f('CNC', 'bfieldf') if CNC == True else f('MOT', 'bfield'),
            f('CNC', 'dtbfield'))

    #Hold off start of laser ramps
    delay = f('CNC', 'delay')
    motpow.appendhold(delay)
    repdet.appendhold(delay)
    trapdet.appendhold(delay)
    reppow.appendhold(delay)
    trappow.appendhold(delay)

    #Do laser ramps
    motpow.linear(
        f('CNC', 'motpowf') if CNC == True else f('MOT', 'motpow'),
        f('CNC', 'dtmotpow'))
    repdet.linear(
        f('CNC', 'repdetf') if CNC == True else f('MOT', 'repdetSS'),
        f('CNC', 'dtrepdet'))
    trapdet.linear(
        f('CNC', 'trapdetf') if CNC == True else f('MOT', 'trapdetSS'),
        f('CNC', 'dttrapdet'))
    reppow.linear(
        f('CNC', 'reppowf') if CNC == True else f('MOT', 'reppowSS'),
        f('CNC', 'dtreppow'))
    trappow.linear(
        f('CNC', 'trappowf') if CNC == True else f('MOT', 'trappowSS'),
        f('CNC', 'dttrappow'))

    #print motpow.dt()
    #Extend all ramps to match current total duration
    print '...CNC = ' + str(CNC)
    ht = (f('CNC', 'holdtime') if CNC == True else 0.0)
    #print "holdtime = " + str(ht)
    ENDCNC = max(motpow.dt(), repdet.dt(), trapdet.dt(), reppow.dt(),
                 trappow.dt(), bfield.dt()) + ht

    motpow.extend(ENDCNC)
    #print motpow.dt()
    repdet.extend(ENDCNC)
    trapdet.extend(ENDCNC)
    bfield.extend(ENDCNC)
    reppow.extend(ENDCNC)
    trappow.extend(ENDCNC)
    maxN = int(math.floor((ENDCNC) / ss)) + 1

    #print motpow.dt()
    #print reppow.dt()
    #print trappow.dt()
    #print repdet.dt()
    #print trapdet.dt()
    #print bfield.dt()
    #print uvdet.dt()

    #Up to here you have a Cooled and Compressed MOT
    #
    return motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC
report = gen.getreport()


# PARAMETERS
stepsize = float(report["SEQ"]["stepsize"])
tof = float(report["ANDOR"]["tof"])
exp = float(report["ANDOR"]["exp"])
noatoms = float(report["ANDOR"]["noatoms"])

# SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

# Keep ODT on
ODT = gen.bstr("ODT", report)
if ODT == True:
    s.digichg("odtttl", 1)
s.wait(20.0)

ss = float(report["CNC"]["cncstepsize"])

# Cool and Compress MOT
# ENDCNC is defined as the time up to release from the MOT
motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()
motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.statetransfer_F32(
    motpow, repdet, trapdet, reppow, trappow, bfield
)
# motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.statetransfer_F12(motpow, repdet, trapdet, reppow, trappow, bfield)

camera = "ANDOR"
Example #27
0
def cncRamps():
	# Initialize channels to MOT SS values and with cncstepsize
	ss=f('CNC','cncstepsize')
	motpow   = wfm.wave('motpow', f('MOT','motpow')   ,ss)
	repdet   = wfm.wave('repdet', f('MOT','repdetSS') ,ss)
	trapdet  = wfm.wave('trapdet',f('MOT','trapdetSS'),ss)
	reppow   = wfm.wave('reppow', f('MOT','reppowSS') ,ss)
	trappow  = wfm.wave('trappow',f('MOT','trappowSS'),ss)
	bfield   = wfm.wave('bfield', f('MOT','bfield')   ,ss)
	
	CNC = gen.bstr('CNC',report)
	#If CNC is selected in the report then insert necessary linear ramps
	
	#First ramp bfield
	SINH = gen.bstr('sinh',report)
	if SINH == True:
		bfield.sinhRise(f('CNC','bfieldf') if CNC == True else  f('MOT','bfield'),  f('CNC','dtbfield'), f('CNC','dtbfield')*f('CNC','taubfield'))
	else:
		bfield.linear(  f('CNC','bfieldf') if CNC == True else  f('MOT','bfield'),  f('CNC','dtbfield'))
	
	#Hold off start of laser ramps
	delay = f('CNC','delay')
	motpow.appendhold( delay )
	repdet.appendhold( delay )
	trapdet.appendhold( delay )
	reppow.appendhold( delay )
	trappow.appendhold( delay )
	
	#Do laser ramps
	motpow.linear(  f('CNC','motpowf')  if CNC == True else  f('MOT','motpow')    , f('CNC','dtmotpow'))
	repdet.linear(  f('CNC','repdetf')  if CNC == True else  f('MOT','repdetSS')  , f('CNC','dtrepdet'))
	trapdet.linear( f('CNC','trapdetf') if CNC == True else  f('MOT','trapdetSS'),  f('CNC','dttrapdet'))
	reppow.linear(  f('CNC','reppowf')  if CNC == True else  f('MOT','reppowSS')  , f('CNC','dtreppow'))
	trappow.linear( f('CNC','trappowf') if CNC == True else  f('MOT','trappowSS'),  f('CNC','dttrappow'))
	
	#print motpow.dt()
	#Extend all ramps to match current total duration
	print '...CNC = ' + str(CNC)
	ht = (f('CNC','holdtime') if CNC == True else 0.0)
	#print "holdtime = " + str(ht)
	ENDCNC = max( motpow.dt(), repdet.dt(), trapdet.dt(), reppow.dt(), trappow.dt(), bfield.dt() ) + ht
	
	motpow.extend( ENDCNC)
	#print motpow.dt()
	repdet.extend( ENDCNC)
	trapdet.extend(ENDCNC)
	bfield.extend( ENDCNC)
	reppow.extend( ENDCNC)
	trappow.extend( ENDCNC)
	maxN=int(math.floor( (ENDCNC)/ss))+1
	
	#print motpow.dt()
	#print reppow.dt()
	#print trappow.dt()
	#print repdet.dt()
	#print trapdet.dt()
	#print bfield.dt()
	#print uvdet.dt()
	
	#Up to here you have a Cooled and Compressed MOT
	#
	return motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC
Example #28
0
def  go_to_highfield(s):

	#---Keep ODT on
	odton = gen.bstr('ODT',report)
	if odton == True:
		s.digichg('odtttl',1)
	s.wait(20.0)

	ss = SEQ.analogstepsize

	#---Cool and Compress MOT
	#---ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

	#---Load UVMOT from CNCMOT
	uvpow2, uvpow, motpow, bfield, ENDUVMOT = uvmot.uvRamps(motpow, bfield, ENDCNC)

	repdet.extend(ENDUVMOT)
	trapdet.extend(ENDUVMOT)
	reppow.extend(ENDUVMOT)
	trappow.extend(ENDUVMOT)
	
	#---Make sure everything has the same length before setting imaging values
	#--- Set imaging values
	camera = 'ANDOR'
	motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(motpow, repdet, trapdet, reppow, trappow, camera)


	#---Switch bfield to FESHBACH 
	bfield.appendhold(FB.rampdelay)
	bfield.linear( FB.bf, FB.rampbf)
	bfield.appendhold( FB.feshbachdt)
	bfield.linear(0.0, 0.0)
	bfield.appendhold( FB.switchondt + FB.switchdelay + UV.extradt)
	bfield.linear(FB.bias,FB.rampdt)


	#---Set the starting voltage for the ODT
	odtpow0 = odt.odt_wave('odtpow', ODT.odtpow0, ss)
	odtpow0.extend(ENDUVMOT)
	
	#---Change shunt value from motV to hfV before going to highfield
	shunt = wfm.wave('gradientfield', SHUNT.motV, ss, volt = SHUNT.motV)
	shunt.extend(ENDUVMOT + FB.rampdelay + FB.rampbf + FB.feshbachdt + UV.extradt) 
	#shunt.linear(SHUNT.hfV, 0.0,volt =SHUNT.hfV)	
	shunt.linear(SHUNT.hfV, 0.0,volt =0.0)	
	
	
	wfms = [ motpow, repdet, trapdet, bfield, reppow, trappow, uvpow, uvpow2,odtpow0, shunt]

	
	#---Add waveforms to sequence
	s.analogwfm_add(ss,wfms)
	
		
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#---Insert QUICK pulse for fast ramping of the field gradient during CNC
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)	
	s.wait(10.0)
	s.wait(ENDCNC)
	s.digichg('quick',0)
	
	#---Go back in time, shut down the UVAOM's 
	#---UVAOM's were on to keep them warm
	s.wait(UV.clearaoms)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.wait(-UV.clearaoms)
	
	#---Insert ODT overlap 
	s.wait(-ODT.overlapdt-ODT.servodt)
	s.digichg('odt7595',1)
	s.wait(ODT.servodt)
	s.digichg('odtttl',1)
	s.wait(ODT.overlapdt)
	
	#---Turn OFF red light
	s.wait(UV.delay_red)
	s.digichg('motswitch',0) 
	s.digichg('motshutter',1)
	s.wait(-UV.delay_red)
	
	#---Turn ON UVAOM's
	s.wait(UV.delay_uv)
        #---make sure to open the shutter:
        s.wait(UV.openshutter)
	s.digichg('uvshutter',1)
        s.wait(-UV.openshutter)

	s.digichg('uvaom1',1)
	s.digichg('uvaom2',1)
	s.wait(-UV.delay_uv)
	

	#---Go to MOT release time
	s.wait(-ENDCNC)
	s.wait(ENDUVMOT)
	

	#---Go to end of field rampdown and set QUICK back to low
	s.wait(FB.rampdelay+FB.rampbf) 
	s.digichg('quick',0)
	

	#---Wait in the UVMOT and then do optical pumping
	s.wait(UV.extradt) 
	s.wait(-UV.pumptime)
	s.digichg('uvaom2',0)
	s.wait(UV.pumptime)
	#---Turn OFF UVAOM
	s.digichg('uvaom1',0)
	#---Close UV shutter
	waitshutter=UV.closeshutter
	s.wait(waitshutter)
	s.digichg('uvshutter',0)
	s.wait(-waitshutter)

	#---Turn OFF MOT magnetic field and switch it to FESHBACH
	s.digichg('field',0)
	s.wait( FB.feshbachdt )
	s.digichg('feshbach',1)
	s.wait(FB.switchondt)
	do_quick=1
	s.digichg('field',1)
	s.digichg('hfquick',do_quick)
	s.digichg('quick',do_quick)
	#Can't leave quick ON for more than quickmax
	quickmax=100.
	s.wait(quickmax)
	s.digichg('hfquick',0)
	s.digichg('quick',0)
	s.wait(-quickmax)
	#
	s.wait(FB.switchdelay+FB.rampdt)
	s.digichg('quick',0)
	s.wait(-FB.rampdt)
	s.wait(-FB.switchdelay - FB.switchondt - FB.feshbachdt - ss)


	#---At this point the time sequence is at ENDUVMOT
	#---Leave the sequence at the end of the UVMOT, but provide the amount
	#---of time that it needs to wait to go to ENDBFIELD
	toENDBFIELD = FB.rampdt + FB.switchdelay + FB.switchondt + FB.feshbachdt
	
	return s, toENDBFIELD
def  go_to_highfield(s):

	#---Keep ODT on
	odton = gen.bstr('ODT',report)
	if odton == True:
		s.digichg('odtttl',1)
	s.wait(20.0)

	ss = SEQ.analogstepsize

	#---Cool and Compress MOT
	#---ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

	#---Load UVMOT from CNCMOT
	uvpow2, uvpow, motpow, bfield, ENDUVMOT = uvmot.uvRamps(motpow, bfield, ENDCNC)

	repdet.extend(ENDUVMOT)
	trapdet.extend(ENDUVMOT)
	reppow.extend(ENDUVMOT)
	trappow.extend(ENDUVMOT)
	
	#---Make sure everything has the same length before setting imaging values
	#--- Set imaging values
	camera = 'ANDOR'
	motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(motpow, repdet, trapdet, reppow, trappow, camera)


	#---Switch bfield to FESHBACH 
	bfield.appendhold(FB.rampdelay)
	bfield.linear( FB.bf, FB.rampbf)
	bfield.appendhold( FB.feshbachdt)
	bfield.linear(0.0, 0.0)
	bfield.appendhold( FB.switchondt + FB.switchdelay + UV.extradt)
	bfield.linear(FB.bias,FB.rampdt)


	#---Set the starting voltage for the ODT
	odtpow0 = odt.odt_wave('odtpow', ODT.odtpow0, ss)
	odtpow0.extend(ENDUVMOT)
	
	#---Change shunt value from motV to hfV before going to highfield
	shunt = wfm.wave('gradientfield', SHUNT.motV, ss, volt = SHUNT.motV)
	shunt.extend(ENDUVMOT + FB.rampdelay + FB.rampbf + FB.feshbachdt + UV.extradt) 
	#shunt.linear(SHUNT.hfV, 0.0,volt =SHUNT.hfV)	
	shunt.linear(SHUNT.hfV, 0.0,volt =0.0)	
	
	
	wfms = [ motpow, repdet, trapdet, bfield, reppow, trappow, uvpow, uvpow2,odtpow0, shunt]

	
	#---Add waveforms to sequence
	s.analogwfm_add(ss,wfms)
	
		
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#---Insert QUICK pulse for fast ramping of the field gradient during CNC
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)	
	s.wait(10.0)
	s.wait(ENDCNC)
	s.digichg('quick',0)
	
	#---Go back in time, shut down the UVAOM's and open the shutter
	#---UVAOM's were on to keep them warm
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	
	#---Insert ODT overlap 
	s.wait(-ODT.overlapdt-ODT.servodt)
	s.digichg('odt7595',1)
	s.wait(ODT.servodt)
	s.digichg('odtttl',1)
	s.wait(ODT.overlapdt)
	
	#---Turn OFF red light
	s.wait(UV.delay_red)
	s.digichg('motswitch',0) 
	s.digichg('motshutter',1)
	s.wait(-UV.delay_red)
	
	#---Turn ON UVAOM's
	s.wait(UV.delay_uv)
	s.digichg('uvaom1',1)
	s.digichg('uvaom2',1)
	s.wait(-UV.delay_uv)
	

	#---Go to MOT release time
	s.wait(-ENDCNC)
	s.wait(ENDUVMOT)
	

	#---Go to end of field rampdown and set QUICK back to low
	s.wait(FB.rampdelay+FB.rampbf) 
	s.digichg('quick',0)
	

	#---Wait in the UVMOT and then do optical pumping
	s.wait(UV.extradt) 
	s.wait(-UV.pumptime)
	s.digichg('uvaom2',0)
	s.wait(UV.pumptime)
	#---Turn OFF UVAOM
	s.digichg('uvaom1',0)
	#---Close UV shutter
	waitshutter=5.0
	s.wait(waitshutter)
	s.digichg('uvshutter',0)
	s.wait(-waitshutter)

	#---Turn OFF MOT magnetic field and switch it to FESHBACH
	s.digichg('field',0)
	s.wait( FB.feshbachdt )
	s.digichg('feshbach',1)
	s.wait(FB.switchondt)
	do_quick=1
	s.digichg('field',1)
	s.digichg('hfquick',do_quick)
	s.digichg('quick',do_quick)
	#Can't leave quick ON for more than quickmax
	quickmax=100.
	s.wait(quickmax)
	s.digichg('hfquick',0)
	s.digichg('quick',0)
	s.wait(-quickmax)
	#
	s.wait(FB.switchdelay+FB.rampdt)
	s.digichg('quick',0)
	s.wait(-FB.rampdt)
	s.wait(-FB.switchdelay - FB.switchondt - FB.feshbachdt - ss)


	#---At this point the time sequence is at ENDUVMOT
	#---Leave the sequence at the end of the UVMOT, but provide the amount
	#---of time that it needs to wait to go to ENDBFIELD
	toENDBFIELD = FB.rampdt + FB.switchdelay + FB.switchondt + FB.feshbachdt
	
	return s, toENDBFIELD
def  go_to_highfield(s):

	#---Keep ODT on
	ODT = gen.bstr('ODT',report)
	if ODT == True:
		s.digichg('odtttl',1)
	s.wait(20.0)

	ss = float(report['SEQ']['analogstepsize'])

	#---Cool and Compress MOT
	#---ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

	#---Load UVMOT from CNCMOT
	uvfppiezo, uvpow2, uvpow, motpow, bfield, ENDUVMOT = uvmot.uvRamps(motpow, bfield, ENDCNC)

	repdet.extend(ENDUVMOT)
	trapdet.extend(ENDUVMOT)
	reppow.extend(ENDUVMOT)
	trappow.extend(ENDUVMOT)
	
	#---Make sure everything has the same length before setting imaging values
	#print motpow.dt(), repdet.dt(), trapdet.dt(), bfield.dt(), reppow.dt(), trappow.dt(), uvfppiezo.dt()
	#print motpow.N(), repdet.N(), trapdet.N(), bfield.N(), reppow.N(), trappow.N(), uvfppiezo.N()
	#--- Set imaging values
	camera = 'ANDOR'
	motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(motpow, repdet, trapdet, reppow, trappow, camera)

	#---Switch bfield to FESHBACH 
	overlapdt    = float(report['ODT']['overlapdt'])
	rampdelay    = float(report['FESHBACH']['rampdelay'])
	rampbf       = float(report['FESHBACH']['rampbf'])
	bf           = float(report['FESHBACH']['bf'])
	feshbachdt   = float(report['FESHBACH']['feshbachdt'])
	switchondt  = float(report['FESHBACH']['switchondt'])
	switchdelay  = float(report['FESHBACH']['switchdelay'])
	bias         = float(report['FESHBACH']['bias'])
	biasrampdt   = float(report['FESHBACH']['rampdt'])
	
	bfield.chop(ENDUVMOT-overlapdt,1)
	bfield.appendhold(rampdelay)
	bfield.linear( bf, rampbf)
	bfield.extend(ENDUVMOT+feshbachdt)
	bfield.linear(0.0, 0.0)
	ENDBFIELD = feshbachdt
	bfield.appendhold( switchondt + switchdelay)
	bfield.linear(bias,biasrampdt)
	
	
	#---Ramp up ODT
	odtpow0 = odt.odt_wave('odtpow', f('ODT','odtpow0'), ss)
	odtpow0.extend(ENDUVMOT)
	
	#---Add waveforms to sequence
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow, uvpow2,odtpow0])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#---Insert QUICK pulse for fast ramping of the field gradient during CNC
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)	
	s.wait(10.0)
	s.wait(ENDCNC)
	s.digichg('quick',0)

	#---Go back in time, shut down the UVAOM's and open the shutter
	s.wait(-50.0)
	s.digichg('uvaom1',0)
	s.digichg('uvaom2',0)
	s.digichg('uvshutter',1)
	s.wait(50.0)
	
	#---Turn OFF red light
	delay_red = float(report['UV']['delay_red'])
	s.wait(delay_red)
	s.digichg('motswitch',0) 
	s.digichg('motshutter',1)
	s.wait(-delay_red)
	
	#---Turn ON UVAOM's
	delay_uv = float(report['UV']['delay_uv'])
	s.wait(delay_uv)
	s.digichg('uvaom1',1)
	s.digichg('uvaom2',1)
	s.wait(-delay_uv)
	
	s.wait(-ENDCNC)
	
	#---Go to MOT release time and set QUICK back to low
	s.wait(ENDUVMOT)
	s.digichg('quick',0)

	#---Turn OFF UVAOM2 for optical pumping
	pumptime = float(report['UV']['pumptime'])
	s.wait(-pumptime)
	s.digichg('uvaom2',0)
	s.wait(pumptime)
	#---Turn OFF UVAOM
	s.digichg('uvaom1',0)
	#---Close UV shutter
	waitshutter=5.0
	s.wait(waitshutter)
	s.digichg('uvshutter',0)
	s.wait(-waitshutter)
	
	#---Turn OFF MOT magnetic field
	s.digichg('field',0)

	#---Insert ODT overlap with UVMOT and switch field to FESHBACH
	overlapdt = float(report['ODT']['overlapdt'])
	servodt = float(report['ODT']['servodt'])
	#
	s.wait(-overlapdt-servodt)
	s.digichg('odt7595',1)
	s.wait(servodt)
	s.digichg('odtttl',1)
	s.wait(overlapdt)
	s.wait( feshbachdt )
	s.digichg('feshbach',1)
	s.wait(switchondt)
	do_quick=1
	s.digichg('field',1)
	s.digichg('hfquick',do_quick)
	s.digichg('quick',do_quick)
	#Can't leave quick ON for more than quickmax
	quickmax=100.
	s.wait(quickmax)
	s.digichg('hfquick',0)
	s.digichg('quick',0)
	s.wait(-quickmax)
	#
	s.wait(switchdelay+biasrampdt)
	s.digichg('quick',0)
	s.wait(-biasrampdt)
	s.wait(-switchdelay - switchondt - feshbachdt - ss)

	#---At this point the time sequence is at ENDUVMOT
	
	#This is the time until the end of the bfield ramp
	toENDBFIELD = biasrampdt + switchdelay + switchondt + feshbachdt
	
	return s, toENDBFIELD
postexp     =float(report['BASLER']['postexp'])
backdt      =float(report['BASLER']['backdt'])


#Use MOT beams for fluorescence imaging
probe = 'motswitch'

#SEQUENCE

s=seq.sequence(stepsize)
s=gen.initial(s)

uvmotdt = float(report['UV']['uvmotdt'])

s.wait(20.0)
ionize = gen.bstr('ionize',report)

s.digichg('uvaom1',1 if ionize == True else 0)
s.wait(-1.0)
s.wait(uvmotdt)

s, duration = photoion.run(s,'BASLER')
print "Duration = " + str(duration)
s.digichg('uvaom1',0)

#Take fluorescence imaging shot with the MOT beams. 
#LET MOT EXPAND
s.digichg('field',0)
s.digichg('motswitch',0) 
s.wait(tof)
#PICTURE OF ATOMS
Example #32
0
def go_to_highfield(s):

    #Keep ODT on
    ODT = gen.bstr('ODT', report)
    if ODT == True:
        s.digichg('odtttl', 1)
    s.wait(20.0)

    ss = float(report['SEQ']['analogstepsize'])

    # Cool and Compress MOT
    # ENDCNC is defined as the time up to release from the MOT
    motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

    # Load UVMOT from CNCMOT
    uvfppiezo, uvpow2, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling_repump.uvcoolRamps_repump(
        motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

    # Set imaging values
    camera = 'ANDOR'
    motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(
        motpow, repdet, trapdet, reppow, trappow, camera)

    # Switch bfield to FESHBACH
    overlapdt = float(report['ODT']['overlapdt'])
    rampdelay = float(report['ODT']['rampdelay'])
    rampbf = float(report['ODT']['rampbf'])
    bf = float(report['ODT']['bf'])
    feshbachdt = float(report['ODT']['feshbachdt'])
    switchondt = float(report['FESHBACH']['switchondt'])
    switchdelay = float(report['FESHBACH']['switchdelay'])
    bias = float(report['FESHBACH']['bias'])
    biasrampdt = float(report['FESHBACH']['rampdt'])

    bfield.chop(ENDUVMOT - overlapdt, 1)
    bfield.appendhold(rampdelay)
    bfield.linear(bf, rampbf)
    bfield.extend(ENDUVMOT + feshbachdt)
    bfield.linear(0.0, 0.0)
    ENDBFIELD = feshbachdt
    bfield.appendhold(switchondt + switchdelay)
    bfield.linear(bias, biasrampdt)

    rampupdt = float(report['ODT']['rampupdt'])
    updt = float(report['ODT']['updt'])
    overshootdt = float(report['ODT']['overshootdt'])

    #~ odtpow0 = wfm.wave('odtpow', 0.0, ss)
    #~ odtpow0.extend(ENDUVMOT-overlapdt-updt-rampupdt)
    #~ odtpow0.odt_linear( 0.0 , f('ODT','odtpow0'), rampupdt)
    #~ odtpow0.appendhold( updt)
    #~ odtpow0.odt_linear(f('ODT','odtpow0'), f('ODT','odtpow'), overshootdt)

    odtpow0 = wfm.wave('odtpow', f('ODT', 'odtpow0'), ss)
    odtpow0.extend(ENDUVMOT - overlapdt)
    odtpow0.odt_linear(f('ODT', 'odtpow0'), f('ODT', 'odtpow'), overshootdt)

    EXTRA = max(
        overshootdt - (bfield.dt() - (ENDUVMOT - overlapdt - updt - rampupdt)),
        0.0)
    print "...EXTRA time to allow for ODT overshoot = %f" % EXTRA

    #Add waveforms to sequence
    s.analogwfm_add(ss, [
        motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow,
        uvpow2, odtpow0
    ])

    #wait normally rounds down using floor, here the duration is changed before so that
    #the wait is rounded up
    ENDUVMOT = ss * math.ceil(ENDUVMOT / ss)

    #insert QUICK pulse  for fast ramping of the field gradient
    s.wait(-10.0)
    quickval = 1 if gen.bstr('CNC', report) == True else 0
    s.digichg('quick', quickval)
    s.wait(10.0)

    #insert UV pulse
    uvtime = float(report['UV']['uvtime'])
    s.wait(ENDCNC)
    s.digichg('quick', 0)
    s.wait(uvtime)
    #Shut down the UVAOM's and open the shutter
    s.wait(-50.0)
    s.digichg('uvaom1', 0)
    s.digichg('uvaom2', 0)
    s.digichg('uvshutter', 1)
    s.wait(50.0)
    #Turn on UVAOM
    s.digichg('uvaom1', 1)
    s.wait(-uvtime)

    #Turn on UVAOM2
    uvreptime = float(report['UV']['uvreptime'])
    s.wait(uvreptime)
    s.digichg('uvaom2', 1)

    #Tur off RED light
    s.digichg('motswitch', 0)
    s.digichg('motshutter', 1)
    s.wait(-uvreptime)

    s.wait(-ENDCNC)

    #Go to MOT release time and set QUICK back to low
    s.wait(ENDUVMOT)
    s.digichg('quick', 0)

    #Turn OFF UVAOM2 for optical pumping
    pumptime = float(report['UV']['pumptime'])
    uvhold = float(report['UV']['uvhold'])
    s.wait(-pumptime)
    s.digichg('uvaom2', 0)
    s.wait(pumptime)

    #Leave UVMOT on for state transfer
    fstatedt = float(report['ODT']['fstatedt'])
    s.wait(fstatedt)
    s.digichg('uvaom1', 0)
    s.wait(-fstatedt)

    #Close UV shutter
    waitshutter = 5.0
    s.wait(waitshutter)
    s.digichg('uvshutter', 0)
    s.wait(-waitshutter)

    #Turn OFF MOT magnetic field
    s.digichg('field', 0)

    #Insert ODT overlap with UVMOT and switch field to FESHBACH
    overlapdt = float(report['ODT']['overlapdt'])
    servodt = float(report['ODT']['servodt'])
    s.wait(-overlapdt - servodt)
    s.digichg('odt7595', 1)
    s.wait(servodt)
    s.digichg('odtttl', 1)
    #feshbachdt = rampdelay + rampbf + holdbf
    s.wait(overlapdt)
    s.wait(feshbachdt)
    s.digichg('feshbach', 1)
    #s.wait(overlapdt - feshbachdt)
    #s.wait( -feshbachdt)

    #s.wait(offdelay)
    #s.wait(2*switchdt)
    #s.wait(quickdelay)
    s.wait(switchondt)
    do_quick = 1
    s.digichg('field', 1)
    s.digichg('hfquick', do_quick)
    s.digichg('quick', do_quick)
    #Can't leave quick ON for more than quickmax
    quickmax = 100.
    s.wait(quickmax)
    s.digichg('hfquick', 0)
    s.digichg('quick', 0)
    s.wait(-quickmax)
    s.wait(switchdelay + biasrampdt)
    s.digichg('quick', 0)
    s.wait(-biasrampdt)
    #s.wait(-switchdelay-quickdelay-2*switchdt-offdelay)
    s.wait(-switchdelay - switchondt - feshbachdt - ss)

    #At this point the time sequence is at ENDUVMOT

    #This is the time until the end of the bfield ramp
    #toENDBFIELD = biasrampdt + switchdelay + quickdelay + 2*switchdt + offdelay
    toENDBFIELD = biasrampdt + switchdelay + switchondt + feshbachdt

    return s, toENDBFIELD + EXTRA

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof      = float(report['ANDOR']['tof'])
exp      = float(report['ANDOR']['exp'])
noatoms  = float(report['ANDOR']['noatoms'])

#SEQUENCE
s=seq.sequence(stepsize)
s=gen.initial(s)

s.digichg('odt7595',0)

#Keep ODT on
ODT = gen.bstr('ODT',report)
if ODT == True:
    s.digichg('odtttl',1)
s.wait(20.0)

#LOAD ODT
s, ENDUVMOT = uvred.run(s,'ANDOR')
s.digichg('uvaom1',1)

#Insert ODT overlap with UVMOT
overlapdt = float(report['ODT']['overlapdt'])
s.wait(-overlapdt)
s.digichg('odtttl',1)
s.digichg('odt7595',1)
s.wait(overlapdt)
Example #34
0
def  go_to_highfield(s):

	#Keep ODT on
	ODT = gen.bstr('ODT',report)
	if ODT == True:
		s.digichg('odtttl',1)
	s.wait(20.0)

	ss = float(report['SEQ']['analogstepsize'])

	# Cool and Compress MOT
	# ENDCNC is defined as the time up to release from the MOT
	motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()

	# Load UVMOT from CNCMOT
	uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling.uvcoolRamps(motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

	# Set imaging values
	camera = 'ANDOR'
	motpow, repdet, trapdet, reppow, trappow, maxDT = cnc.imagingRamps_nobfield(motpow, repdet, trapdet, reppow, trappow, camera)

	# Switch bfield to FESHBACH while UV cools in trap
	overlapdt    = float(report['ODT']['overlapdt'])
	rampdelay    = float(report['ODT']['rampdelay'])
	rampbf       = float(report['ODT']['rampbf'])
	bf           = float(report['ODT']['bf'])
	holdbf       = float(report['ODT']['holdbf'])
	switchdt     = float(report['FESHBACH']['switchdt'])
	offdelay     = float(report['FESHBACH']['offdelay'])
	quickdelay   = float(report['FESHBACH']['quickdelay'])
	switchdelay  = float(report['FESHBACH']['switchdelay'])
	bias         = float(report['FESHBACH']['bias'])
	biasrampdt   = float(report['FESHBACH']['rampdt'])

	bfield.chop(ENDUVMOT-overlapdt)
	bfield.appendhold(rampdelay)
	bfield.linear( bf, rampbf)
	bfield.appendhold(holdbf)
	bfield.linear(0.0, 0.0)
	ENDBFIELD=(rampdelay+rampbf+holdbf-overlapdt)
	bfield.appendhold(-ENDBFIELD+offdelay+2*switchdt+quickdelay+switchdelay)
	bfield.linear(bias,biasrampdt)

	#Add waveforms to sequence
	s.analogwfm_add(ss,[ motpow, repdet, trapdet, bfield, reppow, trappow, uvfppiezo, uvpow])
	
	#wait normally rounds down using floor, here the duration is changed before so that
	#the wait is rounded up
	ENDUVMOT = ss*math.ceil(ENDUVMOT/ss)
	
	#insert QUICK pulse  for fast ramping of the field gradient
	s.wait(-10.0)
	quickval = 1 if gen.bstr('CNC',report) == True else 0
	s.digichg('quick',quickval)	
	s.wait(10.0)

	#insert UV pulse
	uvtime  = float(report['UV']['uvtime'])
	s.wait(ENDCNC)
	s.digichg('quick',0)
	s.wait(uvtime)
	s.digichg('uvaom1',1)
	s.wait(-uvtime - ENDCNC)
	
	#Go to MOT release time
	s.wait(ENDUVMOT)
	s.digichg('quick',0)

	#Leave UVMOT on for state transfer
	fstatedt  = float(report['ODT']['fstatedt'])
	s.wait(fstatedt)
	s.digichg('uvaom1',0)
	s.wait(-fstatedt) 


	#RELEASE FROM MOT
	waitshutter=5.0
	s.wait(waitshutter)
	s.digichg('uvshutter',0)
	s.wait(-waitshutter)

	s.digichg('motswitch',0) 
	s.digichg('motshutter',1)
	s.digichg('field',0)

	#Insert ODT overlap with UVMOT and switch field to FESHBACH
	overlapdt = float(report['ODT']['overlapdt'])
	s.wait(-overlapdt)
	s.digichg('odtttl',1)
	s.digichg('odt7595',1)
	feshbachdt = rampdelay + rampbf + holdbf
	s.wait( feshbachdt )
	s.digichg('feshbach',1)
	s.wait(overlapdt - feshbachdt)

	s.wait(offdelay)
	s.wait(2*switchdt)
	s.wait(quickdelay)
	do_quick=1
	s.digichg('field',1)
	s.digichg('hfquick',do_quick)
	s.digichg('quick',do_quick)
	#Can't leave quick ON for more than quickmax
	quickmax=100.
	s.wait(quickmax)
	s.digichg('hfquick',0)
	s.digichg('quick',0)
	s.wait(-quickmax)
	s.wait(switchdelay+biasrampdt)
	s.digichg('quick',0)
	s.wait(-biasrampdt)
	s.wait(-switchdelay-quickdelay-2*switchdt-offdelay)

	#At this point the time sequence is at ENDUVMOT
	
	#This is the time until the end of the bfield ramp
	toENDBFIELD = biasrampdt + switchdelay + quickdelay + 2*switchdt + offdelay
	
	return s, toENDBFIELD
import seq, wfm, gen, cnc, uvcooling, odt, andor
report=gen.getreport()


#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof      = float(report['ANDOR']['tof'])
exp      = float(report['ANDOR']['exp'])
noatoms  = float(report['ANDOR']['noatoms'])

#SEQUENCE
s=seq.sequence(stepsize)
s=gen.initial(s)

#Keep ODT on
ODT = gen.bstr('ODT',report)
if ODT == True:
    s.digichg('odtttl',1)
s.wait(20.0)

ss=float(report['CNC']['cncstepsize'])
	
# Cool and Compress MOT
# DURATION is defined as the time up to release from the MOT
motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC = cnc.cncRamps()
	
# Load UVMOT from CNCMOT
uvfppiezo, uvpow, motpow, repdet, trapdet, reppow, trappow, bfield, ENDUVMOT = uvcooling.uvcoolRamps(motpow, repdet, trapdet, reppow, trappow, bfield, ENDCNC)

# Optical pumping
motpow, repdet, trapdet, reppow, trappow, bfield, ENDPUMPING= cnc.statetransfer_wprobe(motpow, repdet, trapdet, reppow, trappow, bfield)
Example #36
0
s.wait(tof)

# ~ braggtime=0.15
# ~ waittime=1.0
# ~ s.wait(-braggtime-waittime)
# ~ s.digichg('bragg',1)
# ~ s.wait(braggtime)
# ~ s.digichg('bragg',0)
# ~ s.wait(waittime)

# TAKE PICTURES
light = "probe"
# light = 'motswitch'
# light = 'bragg'
trap_on_picture = 1
kinetics = gen.bstr("Kinetics", report)
print "...kinetics = " + str(kinetics)
if kinetics == True:
    s, SERIESDT = andor.KineticSeries4(s, exp, light, noatoms, trap_on_picture)
else:
    s, SERIESDT = andor.FKSeries2(s, stepsize, exp, light, noatoms, trap_on_picture)


# After taking a picture sequence returns at time of the last probe strobe
# Wait 30ms to get past the end
s.wait(30.0)
s = gen.shutdown(s)
s.digichg("odtttl", 0)
s.digichg("odt7595", 0)

import seqconf
import seq, wfm, gen, cnc, andor

report = gen.getreport()

#PARAMETERS
stepsize = float(report['SEQ']['stepsize'])
tof = float(report['ANDOR']['tof'])
exp = float(report['ANDOR']['exp'])
noatoms = float(report['ANDOR']['noatoms'])

#SEQUENCE
s = seq.sequence(stepsize)
s = gen.initial(s)

#Keep ODT on
ODT = gen.bstr('ODT', report)
if ODT == True:
    s.digichg('odtttl', 1)
s.wait(20.0)

#LOAD ODT
s, ENDCNC = cnc.run(s, 'ANDOR')

#Insert ODT overlap
overlapdt = float(report['ODT']['overlapdt'])
s.wait(-overlapdt)
s.digichg('odtttl', 1)
s.wait(overlapdt)

#Flash UVMOT for state transfer
#~ fstatedt  = float(report['ODT']['fstatedt'])
# Set uv1freq for lightshift probing
freq=float(report['UVLIGHTSHIFT']['freq'])
uv1freq = wfm.wave('uv1freq',cnv('uv1freq',freq),ss)
uv1freq.extend(maxDT)
	
#Add waveforms to sequence
s.analogwfm_add(ss,[motpow,repdet,trapdet,bfield,reppow,trappow,uv1freq])
	
#wait normally rounds down using floor, here the duration is changed before so that
#the wait is rounded up
ENDCNC = ss*math.ceil(ENDCNC/ss)
	
#insert QUICK pulse  for fast ramping of the field gradient
s.wait(-10.0)
quickval = 1 if gen.bstr('CNC',report) == True else 0
s.digichg('quick',quickval)
s.wait(10.0)
	
#Go to MOT release time and set QUICK back to low
s.wait(ENDCNC)
s.digichg('quick',0)

#RELEASE FROM MOT
s.digichg('motswitch',0) 
s.digichg('motshutter',1)
s.digichg('field',0)

freedt=float(report['UVLIGHTSHIFT']['freedt'])
pulse  = float(report['UVLIGHTSHIFT']['pulse'])
s.wait(freedt)

#WAIT IN TRAP AND THEN RELEASE FROM IR TRAP
trapdt = float(report['UVLS']['trapdt'])
s.wait( trapdt)
lstof = float(report['UVLS']['lstof'])
s.digichg('odtttl',0)
s.wait(lstof)
    

#TAKE PICTURES
light = 'probe'
#light = 'motswitch'
#light = 'bragg'
trap_on_picture = 1
kinetics = gen.bstr('Kinetics',report)
print '...kinetics = ' + str(kinetics)
if kinetics == True:
    s,SERIESDT = andor.KineticSeries4(s,exp,light,noatoms, trap_on_picture)
else:
    s,SERIESDT = andor.FKSeries2(s,stepsize,exp,light,noatoms, trap_on_picture)


#After taking a picture sequence returns at time of the last probe strobe
#Wait 30ms to get past the end
s.wait(30.0)
s=gen.shutdown(s)
s.digichg('odtttl',0)
s.digichg('odt7595',0)

Example #40
0
def constructLoadRamps(cam):
    global report

    # Initialize channels to MOT SS values and with cncstepsize
    ss = f('CNC', 'cncstepsize')
    motpow = wfm.wave(cnv('motpow', f('MOT', 'motpow')), ss)
    repdet = wfm.wave(cnv('repdet', f('MOT', 'repdetSS')), ss)
    trapdet = wfm.wave(cnv('trapdet', f('MOT', 'trapdetSS')), ss)
    reppow = wfm.wave(cnv('reppow', f('MOT', 'reppowSS')), ss)
    trappow = wfm.wave(cnv('trappow', f('MOT', 'trappowSS')), ss)
    bfield = wfm.wave(cnv('bfield', f('MOT', 'bfield')), ss)

    CNC = gen.bstr('CNC', report)
    #If CNC is selected in the report then insert necessary linear ramps

    #First ramp bfield
    SINH = gen.bstr('sinh', report)
    if SINH == True:
        bfield.sinhRise(
            cnv('bfield', f('CNC', 'bfieldf')) if CNC == True else cnv(
                'bfield', f('MOT', 'bfield')), f('CNC', 'dtbfield'),
            f('CNC', 'dtbfield') * f('CNC', 'taubfield'))
    else:
        bfield.linear(
            cnv('bfield', f('CNC', 'bfieldf')) if CNC == True else cnv(
                'bfield', f('MOT', 'bfield')), f('CNC', 'dtbfield'))

    #Hold off start of laser ramps
    delay = f('CNC', 'delay')
    motpow.appendhold(delay)
    repdet.appendhold(delay)
    trapdet.appendhold(delay)
    reppow.appendhold(delay)
    trappow.appendhold(delay)

    #Do laser ramps
    motpow.linear(
        cnv('motpow', f('CNC', 'motpowf')) if CNC == True else cnv(
            'motpow', f('MOT', 'motpow')), f('CNC', 'dtmotpow'))
    repdet.linear(
        cnv('repdet', f('CNC', 'repdetf')) if CNC == True else cnv(
            'repdet', f('MOT', 'repdetSS')), f('CNC', 'dtrepdet'))
    trapdet.linear(
        cnv('trapdet', f('CNC', 'trapdetf')) if CNC == True else cnv(
            'trapdet', f('MOT', 'trapdetSS')), f('CNC', 'dttrapdet'))
    reppow.linear(
        cnv('reppow', f('CNC', 'reppowf')) if CNC == True else cnv(
            'reppow', f('MOT', 'reppowSS')), f('CNC', 'dtreppow'))
    trappow.linear(
        cnv('trappow', f('CNC', 'trappowf')) if CNC == True else cnv(
            'trappow', f('MOT', 'trappowSS')), f('CNC', 'dttrappow'))

    print motpow.dt()
    #Extend all ramps to match current total duration
    print CNC
    lifetime = gen.bstr('Lifetime', report)
    ht = (f('CNC', 'holdtime') if CNC == True or lifetime == True else 0.0)
    print "holdtime = " + str(ht)
    DURATION = max(motpow.dt(), repdet.dt(), trapdet.dt(), reppow.dt(),
                   trappow.dt(), bfield.dt()) + ht
    #DURATION = DURATION + ht
    motpow.extend(DURATION)
    print motpow.dt()
    repdet.extend(DURATION)
    trapdet.extend(DURATION)
    bfield.extend(DURATION)
    reppow.extend(DURATION)
    trappow.extend(DURATION)
    maxN = int(math.floor((DURATION) / ss)) + 1

    #print motpow.dt()
    #print reppow.dt()
    #print trappow.dt()
    #print repdet.dt()
    #print trapdet.dt()
    #print bfield.dt()
    #print uvdet.dt()

    #Up to here you have a Cooled and Compressed MOT
    #

    #Ramp down things quickly to UV values
    uvdt = f('UV', 'dt')
    motpow.linear(cnv('motpow', f('UV', 'uvmotpow')), uvdt)
    reppow.linear(cnv('reppow', f('UV', 'uvreppow')), uvdt)
    trappow.linear(0.0, uvdt)
    repdet.linear(cnv('repdet', f('UV', 'uvrepdet')), uvdt)
    trapdet.linear(cnv('trapdet', f('UV', 'uvtrapdet')), uvdt)
    bfield.linear(cnv('bfield', f('UV', 'uvbfield')), uvdt)

    #Hold UV MOT for uvmotdt
    uvmotdt = f('UV', 'uvmotdt')
    motpow.appendhold(uvmotdt)
    reppow.appendhold(uvmotdt)
    trappow.appendhold(uvmotdt)
    repdet.appendhold(uvmotdt)
    trapdet.appendhold(uvmotdt)
    bfield.appendhold(uvmotdt)

    #Ramp up the bfield during uvramp
    uvramp = f('UV', 'uvramp')
    motpow.appendhold(uvramp)
    reppow.appendhold(uvramp)
    trappow.appendhold(uvramp)
    repdet.appendhold(uvramp)
    trapdet.appendhold(uvramp)
    bfield.linear(cnv('bfield', f('UV', 'uvbfieldf')), uvramp)

    #Hold everything for a little more
    uvhold = f('UV', 'uvhold')
    motpow.appendhold(uvhold)
    reppow.appendhold(uvhold)
    trappow.appendhold(uvhold)
    repdet.appendhold(uvhold)
    trapdet.appendhold(uvhold)
    bfield.appendhold(uvhold)

    CNCDURATION = DURATION
    UVMOTDURATION = DURATION + uvdt + uvmotdt + uvramp
    DURATION = UVMOTDURATION + uvhold

    #Insert bfield imaging value at release
    bfield.linear(cnv('bfield', f(cam, 'imgbfield')), 0.0)

    #Insert AOM imaging values 30us after release
    imgdt = 0.03
    motpow.appendhold(imgdt)
    repdet.appendhold(imgdt)
    trapdet.appendhold(imgdt)
    reppow.appendhold(imgdt)
    trappow.appendhold(imgdt)

    motpow.linear(cnv('motpow', f(cam, 'imgpow')), 0.0)
    repdet.linear(cnv('repdet', f(cam, 'imgdetrep')), 0.0)
    trapdet.linear(cnv('trapdet', f(cam, 'imgdettrap')), 0.0)
    reppow.linear(cnv('reppow', f(cam, 'imgpowrep')), 0.0)
    trappow.linear(cnv('trappow', f(cam, 'imgpowtrap')), 0.0)

    maxDT = max(motpow.dt(), repdet.dt(), trapdet.dt(), bfield.dt(),
                reppow.dt(), trappow.dt())

    motpow.extend(maxDT)
    repdet.extend(maxDT)
    trapdet.extend(maxDT)
    bfield.extend(maxDT)
    reppow.extend(maxDT)
    trappow.extend(maxDT)

    motpow.fileoutput('L:/software/apparatus3/seq/ramps/motpow.txt')
    repdet.fileoutput('L:/software/apparatus3/seq/ramps/repdet.txt')
    trapdet.fileoutput('L:/software/apparatus3/seq/ramps/trapdet.txt')
    bfield.fileoutput('L:/software/apparatus3/seq/ramps/bfield.txt')
    reppow.fileoutput('L:/software/apparatus3/seq/ramps/reppow.txt')
    trappow.fileoutput('L:/software/apparatus3/seq/ramps/trappow.txt')

    return CNCDURATION, DURATION