def sequence(): binnedFlour = numpy.zeros(binNumber) for iteration in range(iterations): print 'iteration {}'.format(iteration) trfpga.perform_time_resolved_measurement() dp866.reset_list() #should reset here trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags {0}'.format(iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence'.format(),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) #finalizing measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] #measuredDict = dvParameters.measureParameters(cxn, measureList) #dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) print 'switching beams back into manual mode' for name in ['axial','radial']: trigger.switch_manual(name) dp866.activate_list_mode(False)
def sequence(): binnedFlour = numpy.zeros(binNumber) for iteration in range(iterations): print 'recording trace {0} out of {1}'.format(iteration, iterations) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray print timetags #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags iter{0}'.format(iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned time.sleep(1) # corresponds to the cooling time between dark times. (1 sec lasercooling) print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def finalize(): global binnedFlour print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def initialize(): #pulser sequence seq = darkHeat(pulser) pulser.new_sequence() seq.setVariables(**params) seq.defineSequence() pulser.program_sequence() pulser.switch_auto('axial', True) #high TTL corresponds to light ON pulser.switch_auto('110DP', False) #high TTL corresponds to light OFF pulser.switch_auto('866DP', False) #high TTL corresponds to light OFF pulser.switch_manual('crystallization', False) #high TTL corresponds to light OFF #set up data vault dv.cd(['','Experiments', experimentName, dirappend], True) dv.new('fluorDiff',[('Iterations', 'Arb')],[('Counts','Counts / Sec','Counts / Sec')] ) params['plotLive'] = True dvParameters.saveParameters(dv, params)
def sequence(): binnedFlour = numpy.zeros(binNumber) for iteration in range(iterations): print 'iteration {}'.format(iteration) trfpga.perform_time_resolved_measurement() dp866.reset_list() #should reset here trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['', 'Experiments', experimentName, dirappend, 'timetags'], True) dv.new('timetags {0}'.format(iteration), [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) dv.add_parameter('iteration', iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags, ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray)[0] binnedFlour = binnedFlour + newbinned trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion( ) #have to call twice until bug is fixed print 'getting result and adding to data vault' dv.cd(['', 'Experiments', experimentName, dirappend]) dv.new('binnedFlourescence'.format(), [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive', True) #finalizing measureList = [ 'trapdrive', 'endcaps', 'compensation', 'dcoffsetonrf', 'cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'axialDP', 'radialDP' ] #measuredDict = dvParameters.measureParameters(cxn, measureList) #dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) print 'switching beams back into manual mode' for name in ['axial', 'radial']: trigger.switch_manual(name) dp866.activate_list_mode(False)
def sequence(): for radfreq in freqList: #start new dataprocessing process dp.new_process('timeResolvedBinning') dpass.frequency(radfreq) for iteration in range(iterations): print 'recording trace {0} out of {1} with frequency {2}'.format(iteration, iterations, radfreq) print 'now perform measurement' trfpga.perform_time_resolved_measurement() print 'now trigger' trigger.trigger('PaulBox') print 'now get result' (arrayLength, timeLength, timeResolution), measuredData = trfpga.get_result_of_measurement() measuredData = measuredData.asarray infoarray = numpy.array([arrayLength,timeLength,timeResolution]) saveName = 'trace{0}{1}'.format(iteration,radfreq) print 'now saving {}'.format(saveName) numpy.savez(saveName,measuredData, infoarray) print 'now adding to dataprocessing server' dp.process_new_data('timeResolvedBinning',measuredData) print 'now waiting to complete recooling' trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed print 'getting result and adding to data vault' binned = dp.get_result('timeResolvedBinning').asarray dv.new('binnedFlourescence freq {}'.format(radfreq),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) dv.add(binned) print 'gathering parameters and adding them to data vault' measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def sequence(self): sP = self.seqP xP = self.expP self.dv.cd(['','Experiments', self.experimentName, self.topdirectory, self.dirappend], True) self.dv.new('binned_timetags',[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) self.dv.add_parameter('Window',['Binned Fluorescence']) self.dv.add_parameter('plotLive', True) for iteration in range(xP.iterations): self.pulser.reset_timetags() self.pulser.start_single() self.pulser.wait_sequence_done() self.pulser.stop_sequence() timetags = self.pulser.get_timetags().asarray #print len(timetags) print len(timetags) self.Binner.add(timetags) # Recording data binX, binY = self.Binner.getBinned() data = numpy.vstack((binX,binY)).transpose() self.dv.add(data) print sum(binY) measureList = ['cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'pulser'] measureDict = dvParameters.measureParameters(self.cxn, self.cxnlab, measureList) dvParameters.saveParameters(self.dv, measureDict) dvParameters.saveParameters(self.dv, sP.toDict()) dvParameters.saveParameters(self.dv, xP.toDict())
def sequence(): binnedFlour = numpy.zeros(binNumber) for axfreq in axFreqList: for iteration in range(iterations): print 'recording trace {0} out of {1} ax freq {2}'.format(iteration+1, iterations, axfreq) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags ax{0} iter{1}'.format(axfreq, iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('axfrequency',axfreq) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned print 'now waiting to complete recooling' trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed #time.sleep(3.0) print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence ax{0}'.format(axfreq),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) print 'gathering parameters and adding them to data vault' measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP'] measuredDict = dvParameters.measureParameters(cxn, cxnlab, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def sequence(): binnedFlour = numpy.zeros(binNumber) for iteration in range(iterations): rs110DP.reset_list() print 'recording trace {0} out of {1}'.format(iteration+1, iterations) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags iter{0}'.format(iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned print 'now waiting to complete recooling' trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed if auto_crystal: success = auto_crystalize() if not success: break print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) print 'gathering parameters and adding them to data vault' measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP'] measuredDict = dvParameters.measureParameters(cxn, cxnlab, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def finalize(): measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) for name in ['radial']: trigger.switch_manual(name)
def finalize(): measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) for name in ['axial','radial','global']: trigger.switch_manual(name)
def sequence(): binnedFlour = numpy.zeros(binNumber) dpass.select('radial') initfreq = dpass.frequency() for freqIteration, freq in enumerate(scanList): print 'frequency now {}'.format(freq) dpass.frequency(freq) for iteration in range(iterationsPerFreq): print 'recording trace {0} out of {1}'.format( iteration, iterationsPerFreq) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['', 'Experiments', experimentName, dirappend, 'timetags'], True) dv.new('timetags {0} {1}'.format(freq, iteration), [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) dv.add_parameter('frequency', freq) dv.add_parameter('iteration', iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags, ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray)[0] binnedFlour = binnedFlour + newbinned newHeatCounts, newCoolCounts = extractHeatCoolCounts(timetags) heatCountsArray[freqIteration] += newHeatCounts coolCountsArray[freqIteration] += newCoolCounts trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion( ) #have to call twice until bug is fixed print 'getting result and adding to data vault' dv.cd(['', 'Experiments', experimentName, dirappend]) dv.new('binnedFlourescence {}'.format(freq), [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) print 'adding line scan to data vault' data = numpy.vstack( (scanList, heatCountsArray, coolCountsArray)).transpose() dv.cd(['', 'Experiments', experimentName, dirappend]) dv.new('lineScan', [('Freq', 'sec')], [('PMT counts', 'Heating', 'Counts'), ('PMT counts', 'Cooling', 'Counts')]) dv.add(data) dv.add_parameter('plotLive', True) measureList = [ 'trapdrive', 'endcaps', 'compensation', 'dcoffsetonrf', 'cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'axialDP', 'radialDP' ] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) print 'switching beams back into manual mode' for name in ['axial', 'radial', 'global']: trigger.switch_manual(name) dpass.frequency(initfreq)
def finalize(): print 'getting result and adding to data vault' binned = dp.get_result('timeResolvedBinning').asarray dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) dv.add(binned) print 'gathering parameters and adding them to data vault' measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def sequence(self): sP = self.seqP xP = self.expP #binning on the fly binNumber = int(sP.recordTime / xP.binTime) binArray = xP.binTime * numpy.arange(binNumber + 1) binnedFlour = numpy.zeros(binNumber) #do iterations for iteration in range(xP.iterations): print 'recording trace {0} out of {1}'.format( iteration + 1, xP.iterations) self.pulser.reset_timetags() self.pulser.start_single() self.pulser.wait_sequence_done() self.pulser.stop_sequence() timetags = self.pulser.get_timetags().asarray #saving timetags self.dv.cd([ '', 'Experiments', self.experimentName, self.dirappend, 'timetags' ], True) self.dv.new('timetags iter{0}'.format(iteration), [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) self.dv.add_parameter('iteration', iteration) ones = numpy.ones_like(timetags) self.dv.add(numpy.vstack((timetags, ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray)[0] binnedFlour = binnedFlour + newbinned if xP.auto_crystal: success = self.auto_crystalize() if not success: break # getting result and adding to data vault #normalize binnedFlour = binnedFlour / float(xP.iterations) binnedFlour = binnedFlour / xP.binTime self.dv.cd(['', 'Experiments', self.experimentName, self.dirappend]) self.dv.new('binnedFlourescence', [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() self.dv.add(data) self.dv.add_parameter('plotLive', True) # gathering parameters and adding them to data vault measureList = [ 'trapdrive', 'endcaps', 'compensation', 'dcoffsetonrf', 'cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'axialDP', 'pulser' ] measuredDict = dvParameters.measureParameters(self.cxn, self.cxnlab, measureList) dvParameters.saveParameters(self.dv, measuredDict) dvParameters.saveParameters(self.dv, sP.toDict()) dvParameters.saveParameters(self.dv, xP.toDict())
def finalize(): print 'getting result and adding to data vault' binned = dp.get_result('timeResolvedBinning').asarray dv.new('binnedFlourescence', [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) dv.add(binned) print 'gathering parameters and adding them to data vault' measureList = [ 'trapdrive', 'endcaps', 'compensation', 'dcoffsetonrf', 'cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'axialDP', 'radialDP' ] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def sequence(): binnedFlour = numpy.zeros(binNumber) dpass.select('radial') initfreq = dpass.frequency() for freqIteration,freq in enumerate(scanList): print 'frequency now {}'.format(freq) dpass.frequency(freq) for iteration in range(iterationsPerFreq): print 'recording trace {0} out of {1}'.format(iteration, iterationsPerFreq) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags {0} {1}'.format(freq,iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('frequency', freq) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned newHeatCounts,newCoolCounts = extractHeatCoolCounts(timetags) heatCountsArray[freqIteration] += newHeatCounts coolCountsArray[freqIteration] += newCoolCounts trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence {}'.format(freq),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) print 'adding line scan to data vault' data = numpy.vstack((scanList, heatCountsArray, coolCountsArray)).transpose() dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('lineScan',[('Freq', 'sec')], [('PMT counts','Heating','Counts'),('PMT counts','Cooling','Counts')] ) dv.add(data) dv.add_parameter('plotLive',True) measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) print 'switching beams back into manual mode' for name in ['axial','radial','global']: trigger.switch_manual(name) dpass.frequency(initfreq)
def sequence(self): sP = self.seqP xP = self.expP now = datetime.datetime.now() date = now.strftime("%Y%m%d") ti = now.strftime('%H%M%S') timetag_context = self.dv.context() self.dv.cd(['',date, self.experimentName, ti, 'binned'], True) self.dv.cd(['',date, self.experimentName, ti, 'timetags'], True, context = timetag_context) #self.dv.new('binned_timetags',[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) self.dv.new('timetags',[('Time', 'sec')], [('Iteration', 'Arb','Arb')] , context = timetag_context ) numUpdates = 1 for n in range(numUpdates): for iteration in range(xP.iterations / numUpdates): self.pulser.reset_timetags() self.pulser.start_single() self.pulser.wait_sequence_done() self.pulser.stop_sequence() timetags = self.pulser.get_timetags().asarray iterationUmber = (n*(xP.iterations/numUpdates) + iteration) * numpy.ones(len(timetags)) timetag_raw = numpy.vstack((iterationUmber,timetags)).transpose() self.dv.add( timetag_raw, context=timetag_context) print n*(xP.iterations/numUpdates) + iteration self.Binner.add(timetags) self.dv.new('binned_timetags_' + str(n+1) + '_of_' + str(numUpdates),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) self.dv.add_parameter('Window',['Binned Fluorescence']) self.dv.add_parameter('plotLive', True) binX, binY = self.Binner.getBinned() data = numpy.vstack((binX,binY)).transpose() self.dv.add(data) measureList = ['cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'pulser'] measureDict = dvParameters.measureParameters(self.cxn, self.cxnlab, measureList) dvParameters.saveParameters(self.dv, measureDict) dvParameters.saveParameters(self.dv, sP.toDict()) dvParameters.saveParameters(self.dv, xP.toDict())
def sequence(self): sP = self.seqP xP = self.expP #binning on the fly binNumber = int(sP.recordTime / xP.binTime) binArray = xP.binTime * numpy.arange(binNumber + 1) binnedFlour = numpy.zeros(binNumber) #do iterations for iteration in range(xP.iterations): print 'recording trace {0} out of {1}'.format(iteration+1, xP.iterations) self.pulser.reset_timetags() self.pulser.start_single() self.pulser.wait_sequence_done() self.pulser.stop_sequence() timetags = self.pulser.get_timetags().asarray #saving timetags self.dv.cd(['','Experiments', self.experimentName, self.dirappend, 'timetags'],True ) self.dv.new('timetags iter{0}'.format(iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) self.dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) self.dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned if xP.auto_crystal: success = self.auto_crystalize() if not success: break # getting result and adding to data vault #normalize binnedFlour = binnedFlour / float(xP.iterations) binnedFlour = binnedFlour / xP.binTime self.dv.cd(['','Experiments', self.experimentName, self.dirappend] ) self.dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() self.dv.add(data) self.dv.add_parameter('plotLive',True) # gathering parameters and adding them to data vault measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP', 'pulser'] measuredDict = dvParameters.measureParameters(self.cxn, self.cxnlab, measureList) dvParameters.saveParameters(self.dv, measuredDict) dvParameters.saveParameters(self.dv, sP.toDict()) dvParameters.saveParameters(self.dv, xP.toDict())
def sequence(self): sP = self.seqP xP = self.expP self.dv.cd([ '', 'Experiments', self.experimentName, self.topdirectory, self.dirappend ], True) self.dv.new('binned_timetags', [('Time', 'sec')], [('PMT counts', 'Arb', 'Arb')]) self.dv.add_parameter('Window', ['Binned Fluorescence']) self.dv.add_parameter('plotLive', True) for iteration in range(xP.iterations): self.pulser.reset_timetags() self.pulser.start_single() self.pulser.wait_sequence_done() self.pulser.stop_sequence() timetags = self.pulser.get_timetags().asarray #print len(timetags) print len(timetags) self.Binner.add(timetags) # Recording data binX, binY = self.Binner.getBinned() data = numpy.vstack((binX, binY)).transpose() self.dv.add(data) print sum(binY) measureList = [ 'cavity397', 'cavity866', 'multiplexer397', 'multiplexer866', 'pulser' ] measureDict = dvParameters.measureParameters(self.cxn, self.cxnlab, measureList) dvParameters.saveParameters(self.dv, measureDict) dvParameters.saveParameters(self.dv, sP.toDict()) dvParameters.saveParameters(self.dv, xP.toDict())
def sequence(): binnedFlour = numpy.zeros(binNumber) for radfreq in radFreqList: #start new dataprocessing process dpass.select('radial') dpass.frequency(radfreq) for axfreq in axFreqList: for iteration in range(iterations): print 'recording trace {0} out of {1} with rad frequency {2}, ax freq {3}'.format(iteration, iterations -1, radfreq, axfreq) trfpga.perform_time_resolved_measurement() trigger.trigger('PaulBox') timetags = trfpga.get_result_of_measurement().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags rad{0} ax{1} iter{2}'.format(radfreq,axfreq, iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('radfrequency', radfreq) dv.add_parameter('axfrequency',axfreq) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned print 'now waiting to complete recooling' trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed print 'getting result and adding to data vault' dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence rad{0} ax{1}'.format(radfreq, axfreq),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) print 'gathering parameters and adding them to data vault' measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict)
def sequence(): dpass.select('radial') initfreq = dpass.frequency() for freq in scanList: print 'frequency now {}'.format(freq) dpass.frequency(freq) dp.new_process('timeResolvedBinning') for iteration in range(iterationsPerFreq): print 'recording trace {0} out of {1}'.format(iteration, iterationsPerFreq) print 'now perform measurement' trfpga.perform_time_resolved_measurement() print 'now trigger' trigger.trigger('PaulBox') print 'now get result' (arrayLength, timeLength, timeResolution), measuredData = trfpga.get_result_of_measurement() measuredData = measuredData.asarray infoarray = numpy.array([arrayLength,timeLength,timeResolution]) saveName = 'trace{0}{1}'.format(iteration,freq) print 'now saving {}'.format(saveName) numpy.savez(saveName,measuredData, infoarray) print 'now adding to dataprocessing server' dp.process_new_data('timeResolvedBinning',measuredData) print 'now waiting to complete recooling' trigger.wait_for_pbox_completion() trigger.wait_for_pbox_completion() #have to call twice until bug is fixed print 'getting result and adding to data vault' binned = dp.get_result('timeResolvedBinning').asarray dv.new('binnedFlourescence {}'.format(freq),[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) dv.add(binned) measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP','radialDP'] measuredDict = dvParameters.measureParameters(cxn, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, pboxDict) print 'switching beams back into manual mode' for name in ['axial','radial','global']: trigger.switch_manual(name) dpass.frequency(initfreq)
def sequence(): binnedFlour = numpy.zeros(binNumber) for iteration in range(iterations): print 'recording trace {0} out of {1}'.format(iteration+1, iterations) pulser.reset_timetags() pulser.start_single() pulser.wait_sequence_done() pulser.stop_sequence() timetags = pulser.get_timetags().asarray #saving timetags dv.cd(['','Experiments', experimentName, dirappend, 'timetags'],True ) dv.new('timetags iter{0}'.format(iteration),[('Time', 'sec')],[('PMT counts','Arb','Arb')] ) dv.add_parameter('iteration',iteration) ones = numpy.ones_like(timetags) dv.add(numpy.vstack((timetags,ones)).transpose()) #add to binning of the entire sequence newbinned = numpy.histogram(timetags, binArray )[0] binnedFlour = binnedFlour + newbinned if auto_crystal: success = auto_crystalize() if not success: break # getting result and adding to data vault #normalize binnedFlour = binnedFlour / float(iterations) binnedFlour = binnedFlour / binTime dv.cd(['','Experiments', experimentName, dirappend] ) dv.new('binnedFlourescence',[('Time', 'sec')], [('PMT counts','Arb','Arb')] ) data = numpy.vstack((binArray[0:-1], binnedFlour)).transpose() dv.add(data) dv.add_parameter('plotLive',True) # gathering parameters and adding them to data vault measureList = ['trapdrive','endcaps','compensation','dcoffsetonrf','cavity397','cavity866','multiplexer397','multiplexer866','axialDP', 'pulser'] measuredDict = dvParameters.measureParameters(cxn, cxnlab, measureList) dvParameters.saveParameters(dv, measuredDict) dvParameters.saveParameters(dv, globalDict) dvParameters.saveParameters(dv, params)