a.flux_axis, a.pwr - 40 - 60, absolute(a.MagcomFilt[50, :, :]).transpose(), auto_xlim=False, x_min=0.33, x_max=0.40, auto_ylim=False, y_min=-30 - 110, y_max=10 - 110, ) ax = pl.axes ax.set_yticks(linspace(-30.0 - 110, 10.0 - 110, 3)) ax.set_xticks(linspace(0.34, 0.38, 3)) onres = 20 * log10(absolute(a.MagcomFilt[50, :, :])) + 10 - bg_A1( a.frequency[50]) colormesh(a.flux_axis, a.pwr - 40 - 60, absolute(10**(onres / 20.0)).transpose(), pl=pl, auto_xlim=False, x_min=0.33, x_max=0.40, auto_ylim=False, y_min=-30 - 100, y_max=10 - 100, ylabel="Power (dBm) ", xlabel=r"$\Phi/\Phi_0$") #b.save_plots([pl1]) print a.pwr print a.flux_axis.shape
b.filt.center=14 b.filt.halfwidth=5 b.fitter.fit_type="lorentzian" b.fitter.gamma=0.05 #0.01 b.flux_axis_type="fq" #"flux" b.end_skip=10 b.save_folder.main_dir=b.name if __name__=="__main__": if 1: b.read_data() scatter(absolute(b.MagcomFilt[50, 370, :])) colormesh(absolute(b.MagcomFilt[50, :, :]))#.show() onres=20*log10(absolute(b.MagcomFilt[50, 362, :]))-bg_A1(b.frequency[50]) offres=20*log10(absolute(a.MagcomFilt[50, 0, :]))-bg_A1(b.frequency[50]) scatter(b.pwr-30-60, absolute(onres-offres)) scatter(b.pwr-30-60, absolute(10**(onres/20.0)-10**(offres/20.0))) b.magabs_colormesh() b.ifft_plot() b.filter_type="FFT" #b.ifft_plot() b.pwr_ind=0 b.magabs_colormesh() b.pwr_ind=3 b.magabs_colormesh() b.pwr_ind=6 b.magabs_colormesh()
line(a.frequency, angle(magfilt)) X=idt.Np*pi*(a.frequency-idt.f0)/idt.f0 #line(a.frequency, 20*log10(0.5*(sin(X)/(X))**2), pl=pl) ifft_plot(a)#.show() from D0317_S4A1_frq_pulse_flux import a as c from numpy import mean c.read_data() print c.comment cdata=10.0**((20.0*log10(mean(absolute(c.MagcomData[64:76, :, 0]), axis=0))-c.probe_pwr)/20.0) pl=scatter(c.frequency, 20*log10(cdata)+10-1.0-bg_A1(c.frequency), pl=pl, color="purple", marker="x") #pl=scatter(c.frequency, 20*log10(mean(absolute(c.MagcomData[64:76, :, 0]), axis=0))+0*8.5-bg(c.frequency), # pl=pl, color="purple", marker="x") #a.save_plots([pl,]) pl.show() if __name__=="__main__": #b.filt_compare(a.on_res_ind) print a.net_loss, a.rt_atten #pl=a.magabs_colormesh()#magabs_colormesh3(s3a4_wg) #pl=a.hann_ifft_plot() pl=a.ifft_plot()#.show()
#cbr.set_label("$|S_{21}|$", size=8, labelpad=-10) #cbr.set_ticks(linspace(0.0, 0.12, 2)) #plbg.axes.set_xticks(linspace(0.7, 1.5, 3)) #plbg.axes.set_yticks(linspace(4.35, 4.55, 5)) #plbg.axes.set_ylabel("Frequency (GHz)") #plbg.axes.set_xlabel("$\Phi/\Phi_0$") if 0: frq1 = c.freq_axis[595] pl.nplot = 3 flux_axis = c.flux_axis[c.flat_flux_indices] freq_axis = c.freq_axis[c.indices] c.filter_type = "Fit" cdata2 = (20 * log10(c.MagAbs).transpose() - bg_A1(c.frequency[c.indices])).transpose() start_ind = 0 #c.magabs_colormesh(pl=plbg) if 0: ind = argmin(absolute(frq1 - c.freq_axis)) - 1 line(flux_axis, 10**(cdata2[ind, :] / 20.0), pl=pl, auto_xlim=False, x_min=0.65, x_max=1.5, auto_ylim=False, y_min=0.0, y_max=0.12,
line(d0527.frequency/1e9, 20*log10(absolute(S13xS31))-4, color="red", pl=pl88, auto_ylim=False, y_min=-40, y_max=0, auto_xlim=False, x_min=4.2, x_max=4.7, xlabel="Frequency (GHz)", ylabel="Transmission (dB)", linewidth=1.0, )#.show() pl88.axes.set_xticks(linspace(4.2, 4.7, 3)) pl88.axes.set_yticks(linspace(-40, 0, 5)) d0317.read_data() cdata=10.0**((20.0*log10(mean(absolute(d0317.MagcomData[64:76, :, 0]), axis=0))-d0317.probe_pwr)/20.0) pl88.axes.plot(d0317.frequency/1e9, 20*log10(cdata)+10-1.0-bg_A1(d0317.frequency), "x", 10, color="green") pl88.nplot=2 c.read_data() c.filter_type="FFT" print c.MagcomFilt.shape cdata=(20*log10(absolute(c.MagcomFilt[:,:])).transpose()-bg_A4(c.frequency)).transpose() flux_axis=c.flux_axis[c.flat_flux_indices] freq_axis=c.freq_axis[c.indices] #pl, pf=colormesh(flux_axis, freq_axis, (cdata[d1118.end_skip:-d1118.end_skip, :]/1.0), # pl=pl, pf_too=True, auto_zlim=False, # auto_xlim=False, x_min=0.35, x_max=0.5, # auto_ylim=False, y_min=4.1, y_max=4.8, vmin=-65.0, vmax=-15.0)
x_max=4.7, xlabel="Frequency (GHz)", ylabel="Transmission (dB)", linewidth=1.0, ) #.show() pl88.axes.set_xticks(linspace(4.2, 4.7, 3)) pl88.axes.set_yticks(linspace(-40, 0, 5)) d0317.read_data() cdata = 10.0**( (20.0 * log10(mean(absolute(d0317.MagcomData[64:76, :, 0]), axis=0)) - d0317.probe_pwr) / 20.0) pl88.axes.plot(d0317.frequency / 1e9, 20 * log10(cdata) + 10 - 1.0 - bg_A1(d0317.frequency), "x", 10, color="green") pl88.nplot = 2 c.read_data() c.filter_type = "FFT" print c.MagcomFilt.shape cdata = (20 * log10(absolute(c.MagcomFilt[:, :])).transpose() - bg_A4(c.frequency)).transpose() flux_axis = c.flux_axis[c.flat_flux_indices] freq_axis = c.freq_axis[c.indices] #pl, pf=colormesh(flux_axis, freq_axis, (cdata[d1118.end_skip:-d1118.end_skip, :]/1.0), # pl=pl, pf_too=True, auto_zlim=False, # auto_xlim=False, x_min=0.35, x_max=0.5,
pl=plbg, auto_ylim=False, y_min=-80, y_max=0, auto_xlim=False, x_min=3.85, x_max=5.5, xlabel="Frequency (GHz) ", ylabel="Transmission (dB) ", ) cdata = 10.0**( (20.0 * log10(mean(absolute(d0317.MagcomData[64:76, :, :]), axis=0)) - d0317.probe_pwr) / 20.0) cdata2 = (20 * log10(cdata).transpose() + 10 - 1.0 - bg_A1(d0317.frequency)).transpose() #cdata=(20*log10(absolute(d0317.MagcomData[64:76, :, :])-bg_A1(c.frequency)).transpose() # flux_axis=c.flux_axis[c.flat_flux_indices] # freq_axis=c.freq_axis[c.indices] plbg.nplot = 6 plbg, pfbg = colormesh(d0317.flux_axis / pi, d0317.freq_axis, 10**(cdata2 / 20.0), pl=plbg, pf_too=True, auto_zlim=False, auto_xlim=False, x_min=0.65 / 3.14, x_max=1.5 / 3.14, auto_ylim=False, y_min=4.342,
line(d0527.frequency/1e9, 20*log10(absolute(S13*S31))-4, color="green", pl=plbg, auto_ylim=False, y_min=-40, y_max=0, auto_xlim=False, x_min=4.2, x_max=4.7, xlabel="Frequency (GHz)", ylabel="Transmission (dB)", )#.show() #line(a.frequency, angle(magfilt)) #ifft_plot(a)#.show() d0317.read_data() cdata=10.0**((20.0*log10(mean(absolute(d0317.MagcomData[64:76, :, 0]), axis=0))-d0317.probe_pwr)/20.0) scatter(d0317.frequency/1e9, 20*log10(cdata)+10-1.0-bg_A1(d0317.frequency), pl=pl, color="purple", marker="x") scatter(d0317.frequency/1e9, 20*log10(cdata)+10-1.0-bg_A1(d0317.frequency), pl=plbg, color="purple", marker="x") #a.save_plots([pl,]) #pl.show() def ifft_plot(self, pl, plbg, **kwargs): #process_kwargs(self, kwargs, pl="hannifft_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name)) on_res=10*log10(absolute(self.filt.window_ifft(self.MagcomData[:,0]))) plbg=line(self.time_axis-0.05863, self.filt.fftshift(on_res), color="purple", plot_name="onres_{}".format(self.on_res_ind), alpha=0.8, label="IFFT", pl=plbg, **kwargs)
#cbr=colorbar(pfbg.clt, ax=plbg.axes) #cbr.set_label("$|S_{21}|$", size=8, labelpad=-10) #cbr.set_ticks(linspace(0.0, 0.12, 2)) #plbg.axes.set_xticks(linspace(0.7, 1.5, 3)) #plbg.axes.set_yticks(linspace(4.35, 4.55, 5)) #plbg.axes.set_ylabel("Frequency (GHz)") #plbg.axes.set_xlabel("$\Phi/\Phi_0$") if 0: frq1=c.freq_axis[595] pl.nplot=3 flux_axis=c.flux_axis[c.flat_flux_indices] freq_axis=c.freq_axis[c.indices] c.filter_type="Fit" cdata2=(20*log10(c.MagAbs).transpose()-bg_A1(c.frequency[c.indices])).transpose() start_ind=0 #c.magabs_colormesh(pl=plbg) if 0: ind=argmin(absolute(frq1-c.freq_axis))-1 line(flux_axis, 10**(cdata2[ind, :]/20.0), pl=pl, auto_xlim=False, x_min=0.65, x_max=1.5, auto_ylim=False, y_min=0.0, y_max=0.12, color="red") scatter(flux_axis, 10**(cdata[595, :]/20.0), pl=pl, auto_xlim=False, x_min=0.65, x_max=1.5, auto_ylim=False, y_min=0.0, y_max=0.12, xlabel="$|S_{21}|$", ylabel="$\Phi/\Phi_0$") pl.axes.set_xticks(linspace(0.7, 1.5, 3)) pl.axes.set_yticks(linspace(0.0, 0.1, 5))
X = idt.Np * pi * (a.frequency - idt.f0) / idt.f0 #line(a.frequency, 20*log10(0.5*(sin(X)/(X))**2), pl=pl) ifft_plot(a) #.show() from D0317_S4A1_frq_pulse_flux import a as c from numpy import mean c.read_data() print c.comment cdata = 10.0**( (20.0 * log10(mean(absolute(c.MagcomData[64:76, :, 0]), axis=0)) - c.probe_pwr) / 20.0) pl = scatter(c.frequency, 20 * log10(cdata) + 10 - 1.0 - bg_A1(c.frequency), pl=pl, color="purple", marker="x") #pl=scatter(c.frequency, 20*log10(mean(absolute(c.MagcomData[64:76, :, 0]), axis=0))+0*8.5-bg(c.frequency), # pl=pl, color="purple", marker="x") #a.save_plots([pl,]) pl.show() if __name__ == "__main__": #b.filt_compare(a.on_res_ind) print a.net_loss, a.rt_atten #pl=a.magabs_colormesh()#magabs_colormesh3(s3a4_wg)
if 1: print a.comment scatter(absolute(a.MagcomFilt[50, 370, :])) print a.frequency[50] colormesh(absolute(a.MagcomFilt[a.end_skip:-a.end_skip, 362, :]))#.show() pl.nplot=3 pl1=colormesh(a.flux_axis, a.pwr-40-60, absolute(a.MagcomFilt[50, :, :]).transpose(), auto_xlim=False, x_min=0.33, x_max=0.40, auto_ylim=False, y_min=-30-110, y_max=10-110,) ax=pl.axes ax.set_yticks(linspace(-30.0-110, 10.0-110, 3)) ax.set_xticks(linspace(0.34, 0.38, 3)) onres=20*log10(absolute(a.MagcomFilt[50, :, :]))+10-bg_A1(a.frequency[50]) colormesh(a.flux_axis, a.pwr-40-60, absolute(10**(onres/20.0)).transpose(), pl=pl, auto_xlim=False, x_min=0.33, x_max=0.40, auto_ylim=False, y_min=-30-100, y_max=10-100, ylabel="Power (dBm) ", xlabel=r"$\Phi/\Phi_0$") #b.save_plots([pl1]) print a.pwr print a.flux_axis.shape #pl1.show() pl.nplot=4 onres=20*log10(absolute(a.MagcomFilt[50, 362, :]))+10-bg_A1(a.frequency[50]) offres=20*log10(absolute(a.MagcomFilt[50, 0, :]))+10-bg_A1(a.frequency[50]) scatter(a.pwr-40-60, absolute(onres-offres)) pl_pwr_sat=scatter(a.pwr-40-60, (absolute(10**(onres/20.0)-10**(offres/20.0))), pl=pl, auto_ylim=False, y_min=0.0, y_max=0.2, marker_size=10.0, auto_xlim=False, x_min=-30-110, x_max=10-90, xlabel="Power (dBm)", ylabel=r"$|\Delta S_{21}|$",)#/0.18) ax=pl.axes