s = seq.sequence(stepsize)
# set initial values for TTL lines
s = gen.initial(s)
s.digichg('iraom1', 0)
s.digichg('iraom2', 0)
s.digichg('iraom3', 0)
s.wait(10.0)

s = cnc.doCNC(s, aos, params, 'ANDOR')

#Release MOT
s = gen.releaseMOT(s)
s.wait(tof)

#Here t=0, the time where the atoms shot is taken
s = andor.OpenShuttersFluor(s)

#Delay between shots is limited by the camera exposure (kexp) and the number of rows being shifted
shotdelay = float(params['ANDOR']['kexp']) / 1000. + float(
    params['ANDOR']['rows']) * 0.5 / 1000. + 100. / 1000.

###Clear CCD trigger
###s.wait(-2.0*shotdelay)
###s=andor.AndorPictureExternal(s,kexp,0.0,'motswitch')
###s.wait(shotdelay)

###First junk shot
s.wait(-shotdelay)
s = andor.AndorPictureExternal(s, kexp, 0.0, 'motswitch')
s.wait(shotdelay)
Esempio n. 2
0
def Manta2_SmartBackground(s,
                           exp,
                           light,
                           noatoms,
                           bglist,
                           bgdictPRETOF=None,
                           enforcelight=1):
    #Takes a kinetic series of 4 exposures:  atoms, noatoms, atomsref, noatomsref

    #print s.digital_chgs_str(1000,100000.,['cameratrig','probe','odtttl','prshutter'])

    t0 = s.tcur

    #OPEN SHUTTERS
    if light == 'probe':
        s = andor.OpenShuttersProbe(s)
    elif light == 'motswitch':
        s = andor.OpenShuttersFluor(s)

    #print s.digital_chgs_str(1000,100000.,['cameratrig','probe','odtttl','prshutter'])

    bgdict = {}
    for ch in bglist:
        bgdict[ch] = s.digistatus(ch)

    #PICTURE OF ATOMS
    if enforcelight == 0:
        print "USE ARB FOR PICTURES? = YES"
        s.wait(-0.006)
        s.digichg(light, 1)
        s.wait(+0.006)
        s.digichg(light, 0)
    else:
        print "USE ARB FOR PICTURES? = NO"
    s = MantaPicture(s, exp, light, enforcelight)

    #print s.digital_chgs_str(1000,100000.,['cameratrig','probe','odtttl','prshutter'])

    #SHUT DOWN TRAP, THEN TURN BACK ON FOR SAME BACKGROUND
    #minimum time for no atoms is given by max trigger period in Andor settings

    s.wait(noatoms)
    s.digichg('quick2', 0)
    s.digichg('field', 0)
    s.digichg('odtttl', 0)
    s.digichg('irttl1', 0)
    s.digichg('irttl2', 0)
    s.digichg('irttl3', 0)
    s.digichg('greenttl1', 0)
    s.digichg('greenttl2', 0)
    s.digichg('greenttl3', 0)
    s.wait(noatoms)

    if bgdictPRETOF is not None:
        #RESTORE LIGHTS FOR BACKGROUND - PRETOF
        for key in bgdictPRETOF.keys():
            if key is not 'tof':
                s.digichg(key, bgdictPRETOF[key])
        s.wait(noatoms)

        tof = bgdictPRETOF['tof']
        if tof > 0:
            s.wait(-tof)
            for key in bgdict.keys():
                s.digichg(key, bgdict[key])
            s.wait(tof)
    else:
        #RESTORE LIGHTS FOR BACKGROUND
        for key in bgdict.keys():
            s.digichg(key, bgdict[key])
        s.wait(noatoms)

    #PICTURE OF BACKGROUND
    if enforcelight == 0:
        print "USE ARB FOR PICTURES? = YES"
        s.wait(-0.006)
        s.digichg(light, 1)
        s.wait(+0.006)
        s.digichg(light, 0)
    else:
        print "USE ARB FOR PICTURES? = NO"
    s = MantaPicture(s, exp, light, enforcelight)

    s.wait(noatoms * 1)
    s.digichg('odtttl', 0)
    s.digichg('irttl1', 0)
    s.digichg('irttl2', 0)
    s.digichg('irttl3', 0)
    s.digichg('greenttl1', 0)
    s.digichg('greenttl2', 0)
    s.digichg('greenttl3', 0)

    tf = s.tcur
    return s, tf - t0