コード例 #1
0
def save_and_plot_data(data, histogram):
    #Data processing

    sync = 2**par_binsize_sync * arange(par_range_sync) / 1e3  #sync axis in ns
    dt = 2**par_binsize_g2 * linspace(-par_range_g2 / 2, par_range_g2 / 2,
                                      par_range_g2) / 1e3  #dt axis in ns
    X, Y = meshgrid(dt, sync)
    data.create_file()

    #plt = qt.Plot3D(data, name='Interference',clear = Truprint 'Optimisation step completed'e, coorddims=(0,1), valdim=1, style='image')

    #data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    filename = data.get_filepath()[:-4]
    pqm.savez(filename, dt=dt, sync=sync, counts=histogram)

    #Plot Data
    plt = plot3(ravel(X),
                ravel(Y),
                ravel(histogram),
                style='image',
                palette='hot',
                title='interference')

    #data.new_block()
    plt.set_xlabel('dt [ns]')
    plt.set_ylabel('delay wrt sync pulse [ns]')
    plt.save_png(filename)

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #2
0
def save_and_plot_data(data,histogram):
    #Data processing
    
    sync = 2**par_binsize_sync * arange(par_range_sync) * 1e3    #sync axis in ns
    dt = 2**par_binsize_g2 * linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)*1e3 #dt axis in ns
    X,Y = meshgrid(dt, sync)
    data.create_file()
    
    #plt = qt.Plot3D(data, name='Interference',clear = True, coorddims=(0,1), valdim=1, style='image')
    
    data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    filename=data.get_filepath()[:-4]
    pqm.savez(filename,dt=dt,sync=sync, counts=histogram)

    #Plot Data
    plt = plot3(ravel(X),ravel(Y),ravel(histogram),
           style='image',palette='hot',
           title='interference')
    
    #data.new_block()
    plt.set_xlabel('dt [ns]')
    plt.set_ylabel('delay wrt sync pulse [ns]')
    plt.save_png(filename)

    
    data.close_file()
    

    print 'interference'
    print '(entanglement expected in 3 weeks)'
コード例 #3
0
def save_and_plot_data(data, histogram, histogram_summed, hist_ch0, hist_ch1,
                       hist_ch1_long):
    #Data processing

    sync = 2**(par_binsize_sync +
               par_binsize_T3) * arange(par_range_sync) / 1e3  #sync axis in ns
    dt = 2**(par_binsize_g2 + par_binsize_T3) * linspace(
        -par_range_g2 / 2, par_range_g2 / 2,
        par_range_g2) / 1e3  #dt axis in ns
    X, Y = meshgrid(dt, sync)
    data.create_file()
    #plt = qt.Plot3D(data, name='Interference',clear = Truprint 'Optimisation step completed'e, coorddims=(0,1), valdim=1, style='image')
    #data.add_data_point(ravel(X),ravel(Y),ravel(histogram))

    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(71, 1, max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(72, 1, max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(71, 1, max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(72, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 71, 1,
                                     max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 72, 1,
                                     max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 71, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 72, 1, max_cts)

    filename = data.get_filepath()[:-4]
    pqm.savez(filename,
              dt=dt,
              sync=sync,
              counts=histogram,
              counts_summed=histogram_summed,
              hist_ch0=hist_ch0,
              hist_ch1=hist_ch1,
              hist_ch1_long=hist_ch1_long,
              cr_hist_LT1_first=cr_hist_LT1_first,
              cr_hist_LT1_total=cr_hist_LT1_total,
              cr_hist_LT2_first=cr_hist_LT2_first,
              cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot = False
    if do_plot:
        plt = plot3(ravel(X),
                    ravel(Y),
                    ravel(histogram),
                    style='image',
                    palette='hot',
                    title='interference')

        data.new_block()
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('delay wrt sync pulse [ns]')
        plt.save_png(filename)

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #4
0
def save_and_plot_data(data, histogram, histogram_summed, hist_ch0, hist_ch1,
                       hist_ch1_long, hist_roi, hist_roi_summed):
    #Data processing

    adpars_lt1 = adwin_lt1.get_remote_tpqi_control_var('par')
    adpars_lt2 = adwin_lt2.get_remote_tpqi_control_var('par')

    sync = 2**(par_binsize_sync +
               par_binsize_T3) * arange(par_range_sync) / 1e3  #sync axis in ns
    dt = 2**(par_binsize_g2+par_binsize_T3) * \
            linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)/ 1e3 #dt axis in ns

    data.create_file()

    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8, 1, max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1,
                                     max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1,
                                     max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1, max_cts)

    filename = data.get_filepath()[:-4]
    pqm.savez(filename,
              dt=dt,
              sync=sync,
              counts=histogram,
              counts_summed=histogram_summed,
              hist_ch0=hist_ch0,
              hist_ch1=hist_ch1,
              hist_ch1_long=hist_ch1_long,
              hist_roi=hist_roi,
              hist_roi_summed=hist_roi_summed,
              cr_hist_LT1_first=cr_hist_LT1_first,
              cr_hist_LT1_total=cr_hist_LT1_total,
              cr_hist_LT2_first=cr_hist_LT2_first,
              cr_hist_LT2_total=cr_hist_LT2_total,
              adwin_lt1_pars=adpars_lt1,
              adwin_lt2_pars=adpars_lt2)

    #Plot Data
    do_plot = not (debug_mode)
    if do_plot:
        plt = plot(dt, hist_roi)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in current cycle')
        plt.save_png(filename + '.png')
        plt.clear()
        plt = plot(dt, hist_roi_summed)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in total')
        plt.save_png(filename + 'total.png')
        plt.clear()

    data.close_file()
def save_and_plot_data(data,histogram,histogram_summed,
        hist_ch0,hist_ch1,hist_ch1_long,hist_roi,hist_roi_summed):
    #Data processing

    adpars_lt1 = adwin_lt1.get_remote_tpqi_control_var('par')
    adpars_lt2 = adwin_lt2.get_remote_tpqi_control_var('par')
    
    sync = 2**(par_binsize_sync+par_binsize_T3) * arange(par_range_sync) / 1e3 #sync axis in ns
    dt = 2**(par_binsize_g2+par_binsize_T3) * \
            linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)/ 1e3 #dt axis in ns

    data.create_file()
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            sync=sync,
            counts=histogram,
            counts_summed = histogram_summed,
            hist_ch0=hist_ch0,
            hist_ch1=hist_ch1,
            hist_ch1_long=hist_ch1_long,
            hist_roi = hist_roi,
            hist_roi_summed = hist_roi_summed,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total,
            adwin_lt1_pars = adpars_lt1,
            adwin_lt2_pars = adpars_lt2)

    #Plot Data
    do_plot=not(debug_mode)
    if do_plot:
        plt = plot(dt,hist_roi)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in current cycle')
        plt.save_png(filename+'.png')
        plt.clear()
        plt = plot(dt,hist_roi_summed)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in total')
        plt.save_png(filename+'total.png')
        plt.clear()

    data.close_file()
コード例 #6
0
def save_and_plot_data(data,histogram,histogram_summed,hist_ch0,hist_ch1,hist_ch1_long,hist_roi,hist_roi_summed):
    #Data processing
    
    sync = 2**(par_binsize_sync+par_binsize_T3) * arange(par_range_sync) / 1e3    #sync axis in ns
    dt = 2**(par_binsize_g2+par_binsize_T3) * linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)/ 1e3 #dt axis in ns
    #X,Y = meshgrid(dt, sync)
    data.create_file()
    #plt = qt.Plot3D(data, name='Interference',clear = Truprint 'Optimisation step completed'e, coorddims=(0,1), valdim=1, style='image')
    #data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            sync=sync,
            counts=histogram,
            counts_summed = histogram_summed,
            hist_ch0=hist_ch0,
            hist_ch1=hist_ch1,
            hist_ch1_long=hist_ch1_long,
            hist_roi = hist_roi,
            hist_roi_summed = hist_roi_summed,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=not(debug_mode)
    if do_plot:

        plt = plot(dt,hist_roi)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in current cycle')
        plt.save_png(filename+'.png')
        plt.clear()
        plt = plot(dt,hist_roi_summed)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in total')
        plt.save_png(filename+'total.png')
        plt.clear()

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #7
0
def save_and_plot_data(data, hist_ch0, hist_ch1, gated_ch0, gated_ch1,
                       gated_ch0_summed, gated_ch1_summed):
    #Data processing

    dt = 2**(par_binsize_T3) * arange(0, par_range_g2) / 1e3  #dt axis in ns
    #X,Y = meshgrid(dt, sync)
    data.create_file()

    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8, 1, max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1,
                                     max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1,
                                     max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1, max_cts)

    filename = data.get_filepath()[:-4]
    pqm.savez(filename,
              dt=dt,
              hist_ch0=hist_ch0,
              hist_ch1=hist_ch1,
              gated_ch0=gated_ch0,
              gated_ch1=gated_ch1,
              gated_ch0_summed=gated_ch0_summed,
              gated_ch1_summed=gated_ch1_summed,
              cr_hist_LT1_first=cr_hist_LT1_first,
              cr_hist_LT1_total=cr_hist_LT1_total,
              cr_hist_LT2_first=cr_hist_LT2_first,
              cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot = not (debug_mode)
    if do_plot:

        plt = plot(dt, gated_ch0, name='plu_ch0', clear=True)
        plt.add(dt, hist_ch0)
        plt.set_ylog(True)
        plt.set_xrange(25, 130)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('Gated histogram ch0')
        plt.save_png(filename + '_gated_ch0.png')

        plt = plot(dt, gated_ch1, name='plu_ch1', clear=True)
        plt.add(dt, hist_ch1)
        plt.set_ylog(True)
        plt.set_xrange(25, 130)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('Gated histogram ch1')
        plt.save_png(filename + '_gated_ch1.png')

    data.close_file()
コード例 #8
0
def save_and_plot_data(data,histogram,histogram_summed,hist_ch0,hist_ch1,hist_ch1_long,hist_roi,hist_roi_summed):
    #Data processing
    
    sync = 2**(par_binsize_sync+par_binsize_T3) * arange(par_range_sync) / 1e3    #sync axis in ns
    dt = 2**(par_binsize_g2+par_binsize_T3) * linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)/ 1e3 #dt axis in ns
    #X,Y = meshgrid(dt, sync)
    data.create_file()
    #plt = qt.Plot3D(data, name='Interference',clear = Truprint 'Optimisation step completed'e, coorddims=(0,1), valdim=1, style='image')
    #data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            sync=sync,
            counts=histogram,
            counts_summed = histogram_summed,
            hist_ch0=hist_ch0,
            hist_ch1=hist_ch1,
            hist_ch1_long=hist_ch1_long,
            hist_roi = hist_roi,
            hist_roi_summed = hist_roi_summed,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=not(debug_mode)
    if do_plot:

        plt = plot(dt,hist_roi)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in current cycle')
        plt.save_png(filename+'.png')
        plt.clear()
        plt = plot(dt,hist_roi_summed)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in total')
        plt.save_png(filename+'total.png')
        plt.clear()

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #9
0
ファイル: PLU_test.py プロジェクト: AdriaanRol/measurement
def save_and_plot_data(data,hist_ch0,hist_ch1,gated_ch0,gated_ch1,gated_ch0_summed,gated_ch1_summed ):
    #Data processing
    
    dt = 2**(par_binsize_T3) * arange(0,par_range_g2)/ 1e3 #dt axis in ns
    #X,Y = meshgrid(dt, sync)
    data.create_file()
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)



    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            hist_ch0=hist_ch0,
            hist_ch1=hist_ch1,
            gated_ch0=gated_ch0,
            gated_ch1=gated_ch1,
            gated_ch0_summed=gated_ch0_summed,
            gated_ch1_summed=gated_ch1_summed,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=not(debug_mode)
    if do_plot:

        plt = plot(dt,gated_ch0, name='plu_ch0', clear=True)
        plt.add(dt,hist_ch0)
        plt.set_ylog(True)
        plt.set_xrange(25,130)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('Gated histogram ch0')
        plt.save_png(filename+'_gated_ch0.png')

        plt = plot(dt,gated_ch1, name='plu_ch1', clear=True)
        plt.add(dt,hist_ch1)
        plt.set_ylog(True)
        plt.set_xrange(25,130)        
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('Gated histogram ch1')
        plt.save_png(filename+'_gated_ch1.png')

    data.close_file()  
コード例 #10
0
def save_data():
    mw_pulse_length = length
    counts_during_repump   = physical_adwin.Get_Data_Long(27,0, nr_of_datapoints+1)
    
    data.create_file()
    filename=data.get_filepath()[:-4]
    pqm.savez(filename, repetitions_per_datapoint = repetitions_per_datapoint,
            mw_pulse_length = length, 
            counts_during_repump = counts_during_repump,)
    data.close_file()

    print 'Data saved'
コード例 #11
0
def save_and_plot_data(data,histogram,histogram_summed,hist_ch0,hist_ch1,hist_ch1_long):
    #Data processing
    
    sync = 2**(par_binsize_sync+par_binsize_T3) * arange(par_range_sync) / 1e3    #sync axis in ns
    dt = 2**(par_binsize_g2+par_binsize_T3) * linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)/ 1e3 #dt axis in ns
    X,Y = meshgrid(dt, sync)
    data.create_file()
    #plt = qt.Plot3D(data, name='Interference',clear = Truprint 'Optimisation step completed'e, coorddims=(0,1), valdim=1, style='image')
    #data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(71,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(72,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(71,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(72,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),71,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),72,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),71,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),72,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            sync=sync,
            counts=histogram,
            counts_summed = histogram_summed,
            hist_ch0=hist_ch0,
            hist_ch1=hist_ch1,
            hist_ch1_long=hist_ch1_long,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=False
    if do_plot:
        plt = plot3(ravel(X),ravel(Y),ravel(histogram),
                style='image',palette='hot',
                title='interference')
    
        data.new_block()
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('delay wrt sync pulse [ns]')
        plt.save_png(filename)

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
def save_data():
    mw_pulse_length = length
    counts_during_repump = physical_adwin.Get_Data_Long(
        27, 0, nr_of_datapoints + 1)

    data.create_file()
    filename = data.get_filepath()[:-4]
    pqm.savez(
        filename,
        repetitions_per_datapoint=repetitions_per_datapoint,
        mw_pulse_length=length,
        counts_during_repump=counts_during_repump,
    )
    data.close_file()

    print 'Data saved'
コード例 #13
0
def save_data():
    data = qt.Data(name='spin_control')
    data.add_coordinate('mw_pulse_length')
    data.add_value('counts_during_readout')
    
    mw_pulse_length = length
    counts_during_readout   = physical_adwin.Get_Data_Long(27,1, nr_of_datapoints)
    
    data.create_file()
    filename=data.get_filepath()[:-4]
    pqm.savez(filename, repetitions_per_datapoint = repetitions_per_datapoint,
            mw_pulse_length = length, 
            counts_during_readout = counts_during_readout)
    data.close_file()

    print 'Data saved'
コード例 #14
0
def save_and_plot_data(data, histogram, histogram_summed):
    #Data processing

    dt = linspace(0, 16777.216, 65536)
    data.create_file()

    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(71, 1, max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(72, 1, max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(71, 1, max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(72, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 71, 1,
                                     max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 72, 1,
                                     max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 71, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 72, 1, max_cts)

    filename = data.get_filepath()[:-4]
    pqm.savez(filename,
              dt=dt,
              counts=histogram,
              counts_summed=histogram_summed,
              cr_hist_LT1_first=cr_hist_LT1_first,
              cr_hist_LT1_total=cr_hist_LT1_total,
              cr_hist_LT2_first=cr_hist_LT2_first,
              cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot = True
    if do_plot:

        plt = plot(dt[0:2000], histogram[0:2000])
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of events in 20 min')
        plt.save_png(filename)
        plt.clear()
        plt = plot(dt[0:2000], histogram_summed[0:2000])
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of events in total')
        plt.save_png(filename + 'total')
        plt.clear()

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #15
0
def save_and_plot_data(data,histogram,histogram_summed):
    #Data processing
    
    dt = linspace(0,16777.216,65536)
    data.create_file()
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(71,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(72,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(71,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(72,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),71,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),72,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),71,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),72,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            dt=dt,
            counts=histogram,
            counts_summed = histogram_summed,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=True
    if do_plot:

        plt = plot(dt[0:2000],histogram[0:2000])
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of events in 20 min')
        plt.save_png(filename)
        plt.clear()
        plt = plot(dt[0:2000],histogram_summed[0:2000])
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of events in total')
        plt.save_png(filename+'total')
        plt.clear()

    data.close_file()

    print 'interference, bitch'
    print '(entanglement expected in 3 weeks)'
コード例 #16
0
def save_and_plot_data(data):
    # Data processing

    data.create_file()

    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8, 1, max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7, 1, max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1, max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 7, 1, max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts, dtype=int32), 8, 1, max_cts)

    filename = data.get_filepath()[:-4]
    pqm.savez(
        filename,
        cr_hist_LT1_first=cr_hist_LT1_first,
        cr_hist_LT1_total=cr_hist_LT1_total,
        cr_hist_LT2_first=cr_hist_LT2_first,
        cr_hist_LT2_total=cr_hist_LT2_total,
    )

    # Plot Data
    do_plot = not (debug_mode)
    if do_plot:

        plt = plot(dt, hist_roi)
        plt.set_xlabel("dt [ns]")
        plt.set_ylabel("number of coincidences in current cycle")
        plt.save_png(filename + ".png")
        plt.clear()
        plt = plot(dt, hist_roi_summed)
        plt.set_xlabel("dt [ns]")
        plt.set_ylabel("number of coincidences in total")
        plt.save_png(filename + "total.png")
        plt.clear()

    data.close_file()
コード例 #17
0
def save_and_plot_data(data):
    #Data processing
    
    data.create_file()
    
    max_cts = 100
    cr_hist_LT1_first = physical_adwin_lt1.Get_Data_Long(7,1,max_cts)
    cr_hist_LT1_total = physical_adwin_lt1.Get_Data_Long(8,1,max_cts)
    cr_hist_LT2_first = physical_adwin.Get_Data_Long(7,1,max_cts)
    cr_hist_LT2_total = physical_adwin.Get_Data_Long(8,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin_lt1.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),7,1,max_cts)
    physical_adwin.Set_Data_Long(zeros(max_cts,dtype=int32),8,1,max_cts)

    filename=data.get_filepath()[:-4]
    pqm.savez(filename,
            cr_hist_LT1_first=cr_hist_LT1_first,
            cr_hist_LT1_total=cr_hist_LT1_total,
            cr_hist_LT2_first=cr_hist_LT2_first,
            cr_hist_LT2_total=cr_hist_LT2_total)

    #Plot Data
    do_plot=not(debug_mode)
    if do_plot:

        plt = plot(dt,hist_roi)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in current cycle')
        plt.save_png(filename+'.png')
        plt.clear()
        plt = plot(dt,hist_roi_summed)
        plt.set_xlabel('dt [ns]')
        plt.set_ylabel('number of coincidences in total')
        plt.save_png(filename+'total.png')
        plt.clear()

    data.close_file()
コード例 #18
0
def save_and_plot_data(data,histogram):
    #Data processing
    
    sync = 2**par_binsize_sync * arange(par_range_sync) * 1e3    #sync axis in ns
    dt = 2**par_binsize_g2 * linspace(-par_range_g2/2,par_range_g2/2,par_range_g2)*1e3 #dt axis in ns
    X,Y = meshgrid(dt, sync)
    data.create_file()
    
    #plt = qt.Plot3D(data, name='Interference',clear = True, coorddims=(0,1), valdim=1, style='image')
    
    data.add_data_point(ravel(X),ravel(Y),ravel(histogram))
    filename=data.get_filepath()[:-4]
    pqm.savez(filename,dt=dt,sync=sync, counts=histogram)

    #Plot Data
    plt = plot3(ravel(X),ravel(Y),ravel(histogram),
           style='image',palette='hot',
           title='interference')
    
    #data.new_block()
    plt.set_xlabel('dt [ns]')
    plt.set_ylabel('delay wrt sync pulse [ns]')
    plt.save_png(filename)msvcrtmsvcrt.getch() == "q" : 
            break