本文整理汇总了Python中taref.plotter.api.colormesh函数的典型用法代码示例。如果您正苦于以下问题:Python colormesh函数的具体用法?Python colormesh怎么用?Python colormesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了colormesh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: magdB_colormesh
def magdB_colormesh(self, **kwargs):
process_kwargs(self, kwargs, pl="magdB_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
if self.filter_type=="Fit":
flux_axis=self.flux_axis[self.flat_flux_indices]
freq_axis=self.freq_axis[self.indices]
start_ind=0
for ind in self.fit_indices:
pl=colormesh(flux_axis, self.freq_axis[ind], self.MagdB[start_ind:start_ind+len(ind), :], **kwargs)
start_ind+=len(ind)
elif self.filter_type=="None":
flux_axis=self.flux_axis
freq_axis=self.freq_axis
pl=colormesh(self.flux_axis, self.freq_axis, self.MagdB, **kwargs)
else:
flux_axis=self.flux_axis[self.flat_flux_indices]
freq_axis=self.freq_axis[self.indices]
pl=colormesh(flux_axis, freq_axis, self.MagdB, **kwargs)
if isinstance(pl, tuple):
pl, pf=pl
else:
pf=None
if pl.auto_ylim:
pl.set_ylim(min(freq_axis), max(freq_axis))
if pl.auto_xlim:
pl.set_xlim(min(flux_axis), max(flux_axis))
pl.xlabel=kwargs.pop("xlabel", self.flux_axis_label)
pl.ylabel=kwargs.pop("ylabel", self.freq_axis_label)
if pf is None:
return pl
return pl, pf
示例2: ifft_plot
def ifft_plot(self, **kwargs):
process_kwargs(self, kwargs, pl="hannifft_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
on_res=absolute(self.filt.window_ifft(self.MagcomData[:,self.on_res_ind, self.pwr2_ind]))
strt=absolute(self.filt.window_ifft(self.MagcomData[:,self.start_ind, self.pwr2_ind]))
stop=absolute(self.filt.window_ifft(self.MagcomData[:,self.stop_ind, self.pwr2_ind]))
pl=line(self.time_axis, self.filt.fftshift(on_res), color="red",
plot_name="onres_{}".format(self.on_res_ind),label="{:.4g}".format(self.on_res_ind), **kwargs)
line(self.time_axis, self.filt.fftshift(strt), pl=pl, linewidth=1.0, color="purple",
plot_name="strt {}".format(self.start_ind), label="{:.4g}".format(self.start_ind))
line(self.time_axis, self.filt.fftshift(stop), pl=pl, linewidth=1.0, color="blue",
plot_name="stop {}".format(self.stop_ind), label="{:.4g}".format(self.stop_ind))
self.filt.N=len(on_res)
filt=self.filt.freqz
#filt=filt_prep(len(on_res), self.filt_start_ind, self.filt_end_ind)
top=max([amax(on_res), amax(strt), amax(stop)])
line(self.time_axis, filt*top, plotter=pl, color="green", label="wdw")
pl.xlabel=kwargs.pop("xlabel", self.time_axis_label)
pl.ylabel=kwargs.pop("ylabel", "Mag abs")
if 1:
double_filt= array([[self.filt.fft_filter(a.MagcomData[:,n, m]) for n in range(len(a.frq2))] for m in range(len(a.pwr2))])#.transpose()
print double_filt.shape
double_filt=swapaxes(double_filt, 0, 2)
print double_filt.shape
print a.pwr2[10]
colormesh(self.freq_axis[a.end_skip:-a.end_skip], self.frq2, absolute(double_filt[a.end_skip:-a.end_skip, :, 10]).transpose()) #-absolute(double_filt[a.end_skip:-a.end_skip, 56, 134]).transpose())#-absolute(double_filt[50, 10:-10, 134]))
pl=colormesh(a.frq2, a.pwr2, absolute(double_filt[493, :, :]).transpose()) #-absolute(double_filt[a.end_skip:-a.end_skip, 56, 134]).transpose())#-absolute(double_filt[50, 10:-10, 134]))
print a.frequency[493]
colormesh(absolute(double_filt[329, :, :]).transpose()) #-absolute(double_filt[a.end_skip:-a.end_skip, 56, 134]).transpose())#-absolute(double_filt[50, 10:-10, 134]))
colormesh(absolute(double_filt[93, :, :]).transpose()) #-absolute(double_filt[a.end_skip:-a.end_skip, 56, 134]).transpose())#-absolute(double_filt[50, 10:-10, 134]))
colormesh(absolute(double_filt[880, :, :]).transpose()) #-absolute(double_filt[a.end_skip:-a.end_skip, 56, 134]).transpose())#-absolute(double_filt[50, 10:-10, 134]))
return pl
示例3: phase_colormesh
def phase_colormesh(self, **kwargs):
process_kwargs(self, kwargs, pl="phase_{0}_{1}_{2}".format(self.filter_type, self.bgsub_type, self.name))
if self.filter_type=="Fit":
start_ind=0
for ind in self.fit_indices:
pl=colormesh(self.flux_axis, self.freq_axis[ind], self.Phase[start_ind:start_ind+len(ind), :], **kwargs)
start_ind+=len(ind)
else:
pl=colormesh(self.flux_axis, self.freq_axis[self.indices], self.Phase, **kwargs)
pl.set_ylim(min(self.freq_axis[self.indices]), max(self.freq_axis[self.indices]))
pl.set_xlim(min(self.flux_axis), max(self.flux_axis))
pl.xlabel=kwargs.pop("xlabel", self.flux_axis_label)
pl.ylabel=kwargs.pop("ylabel", self.freq_axis_label)
return pl
示例4: magabs_colormesh
def magabs_colormesh(self):
pl, pf=colormesh(self.yoko, self.frequency/1e9, self.MagAbs, plotter="magabs_{}".format(self.name))
pl.set_ylim(min(self.frequency/1e9), max(self.frequency/1e9))
pl.set_xlim(min(self.yoko), max(self.yoko))
pl.xlabel="Yoko (V)"
pl.ylabel="Frequency (GHz)"
return pl
示例5: magdB_colormesh
def magdB_colormesh(self):
pl, pf=colormesh(self.yoko, self.frequency/1e9, (self.MagdB.transpose()-self.MagdB[:,0]).transpose(), plotter="magabs_{}".format(self.name))
pl.set_ylim(min(self.frequency/1e9), max(self.frequency/1e9))
pl.set_xlim(min(self.yoko), max(self.yoko))
pl.xlabel="Yoko (V)"
pl.ylabel="Frequency (GHz)"
return pl
示例6: magabs_colormesh
def magabs_colormesh(self, **kwargs):
flux_axis=self.flux_axis[self.flat_flux_indices]
freq_axis=self.freq_axis[self.indices]
start_ind=0
for ind in self.fit_indices:
pl=colormesh(flux_axis, self.freq_axis[ind], self.MagAbs[start_ind:start_ind+len(ind), :], **kwargs)
start_ind+=len(ind)
示例7: magfilt_cmesh
def magfilt_cmesh(self, f0=5.35e9, alpha=0.45):
Magcom=self.Magcom #(self.Magcom.transpose()-self.Magcom[:, 0]).transpose()
fq_vec=self.frequency #array([sqrt(f*(f-2*qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha))) for f in self.frequency])
Magfilt=array([fft_filter(Magcom[:,n], self.filt_start_ind, self.filt_end_ind) for n in range(len(self.yoko))]).transpose()
Magfilt2=array([fft_filter(Magcom[:,n], 0, 34) for n in range(len(self.yoko))]).transpose()
pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
pl, pf=colormesh(self.yoko, fq_vec/1e9, (absolute(Magfilt.transpose()-0.0*Magfilt[:,0])).transpose(), plotter=pl)
示例8: magabsfilt2_colormesh
def magabsfilt2_colormesh(self):
p, pf=colormesh(self.frequency[10:-10]/1e9, self.yoko[10:-10],
self.MagAbsFilt.transpose()[10:-10, 10:-10], plotter="magabsfilt2_{}".format(self.name))
print self.voltage_from_flux_par2[0].shape,self.voltage_from_flux_par2[1].shape
line(self.voltage_from_flux_par2[0]/1e9, self.voltage_from_flux_par2[1], plotter=p)
#print max(self.voltage_from_flux_par), min(self.voltage_from_flux_par)
p.xlabel="Yoko (V)"
p.ylabel="Frequency (GHz)"
return p
示例9: magabs_colormesh
def magabs_colormesh(self):
pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
pl, pf=colormesh(self.frequency/1e9, self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0]), plotter=pl)
pf.set_clim(-0.3, 0.1)
pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
pl.set_ylim(min(self.yoko), max(self.yoko))
pl.ylabel="Yoko (V)"
pl.xlabel="Frequency (GHz)"
return pl
示例10: magabs_colormesh3
def magabs_colormesh3(self, f0=5.35e9, alpha=0.45, pl=None):
fq_vec=array([sqrt(f*(f-2*qdt.call_func("Lamb_shift", f=f, f0=f0, couple_mult=alpha))) for f in self.frequency])
pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
pl, pf=colormesh(self.yoko, self.frequency/1e9, absolute((self.Magcom.transpose()-self.Magcom[:, 0]).transpose()), plotter=pl)
#pf.set_clim(-0.3, 0.1)
#pl.set_ylim(min(fq_vec/1e9), max(fq_vec/1e9))
#pl.set_xlim(min(self.yoko), max(self.yoko))
pl.ylabel="Yoko (V)"
pl.xlabel="Frequency (GHz)"
return pl
示例11: magabs_colormesh2
def magabs_colormesh2(self, offset=-0.08, flux_factor=0.52, Ejmax=h*44.0e9, f0=5.35e9, alpha=0.7, pl=None):
fq_vec=array([sqrt(f*(f+alpha*calc_freq_shift(f, qdt.ft, qdt.Np, f0, qdt.epsinf, qdt.W, qdt.Dvv))) for f in self.frequency])
pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
pl, pf=colormesh(fq_vec, self.yoko, (self.MagdB.transpose()-self.MagdB[:, 0]), plotter=pl)
pf.set_clim(-0.3, 0.1)
#pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
pl.set_ylim(min(self.yoko), max(self.yoko))
pl.ylabel="Yoko (V)"
pl.xlabel="Frequency (GHz)"
return pl
示例12: magphasefilt_colormesh
def magphasefilt_colormesh(self):
phase=angle(self.Magcom[10:-10, 10:-10])
#phasefilt=array([unwrap(phase[:,n], discont=5.5) for n in range(phase.shape[1])])
phase=(phase.transpose()-phase[:,0]).transpose()
phasefilt=unwrap(phase, discont=1.5, axis=1)
#phasefilt=phasefilt-phasefilt[0, :]
pl, pf=colormesh(self.flux_over_flux0[10:-10], self.frequency[10:-10]/1e9,
phasefilt, plotter="magphasefilt_{}".format(self.name))
#print self.voltage_from_flux_par2[0].shape,self.voltage_from_flux_par2[1].shape
#line(self.voltage_from_flux_par2[0]/1e9, self.voltage_from_flux_par2[1], plotter=p)
#print max(self.voltage_from_flux_par), min(self.voltage_from_flux_par)
pl.xlabel="Yoko (V)"
pl.ylabel="Frequency (GHz)"
return pl
示例13: magabs_colormesh
def magabs_colormesh(self, offset=-0.08, flux_factor=0.52, Ejmax=h*44.0e9, f0=5.35e9, alpha=0.7, pl=None):
fq_vec=array([sqrt(f*(f+alpha*calc_freq_shift(f, qdt.ft, qdt.Np, f0, qdt.epsinf, qdt.W, qdt.Dvv))) for f in self.frequency])
freq, frq2=flux_parabola(self.yoko, offset, 0.16, Ejmax, qdt.Ec)
pl=Plotter(fig_width=9.0, fig_height=6.0, name="magabs_{}".format(self.name))
pl, pf=colormesh(freq, fq_vec, (self.MagdB.transpose()-self.MagdB[:, 0]).transpose(), plotter=pl)
pf.set_clim(-0.3, 0.1)
line([min(freq), max(freq)], [min(freq), max(freq)], plotter=pl)
flux_o_flux0=flux_over_flux0(self.yoko, offset, flux_factor)
qEj=Ej(Ejmax, flux_o_flux0)
EjdivEc=qEj/qdt.Ec
ls_fq=qdt.call_func("lamb_shifted_fq", EjdivEc=EjdivEc)
ls_fq2=qdt.call_func("lamb_shifted_fq2", EjdivEc=EjdivEc)
frq2=qdt.call_func("lamb_shifted_anharm", EjdivEc=EjdivEc)/h
line(ls_fq, ls_fq2, plotter=pl)
#pl.set_xlim(min(self.frequency/1e9), max(self.frequency/1e9))
#pl.set_ylim(min(self.yoko), max(self.yoko))
pl.ylabel="Yoko (V)"
pl.xlabel="Frequency (GHz)"
return pl
示例14: range
#dlist.extend([add_data(N) for N in range(87*2+1, 0, -1)])
dlist.extend([add_data(N) for N in range(1,70+1)])
#dlist.extend([add_data(39*2) for N in range(1,37+1)])
dlist.extend([add_data(N) for N in range(70+1, 0, -1)])
dlist.extend([add_data(1) for N in range(1,30+1)])
data=array(dlist)
print data.shape
#vf=3488.0
#lbda0=vf/fc
#lbda0/3488.0
pl1=colormesh(f/1e9, 1/fc*linspace(0, 200, 201)/1e-9, data,
pl="SAW pulse simple theory", xlabel="Frequency (GHz)", ylabel="Time (ns)",
auto_xlim=False, x_min=4.0, x_max=5.0,
auto_ylim=False, y_min=0.0, y_max=44.0)
colormesh(10*log10(absolute(data)))#.show()
def read_data(self):
with File(self.rd_hdf.file_path, 'r') as f:
print f["Traces"].keys()
Magvec=f["Traces"]["test_osc - Ch1 - Data"]
data=f["Data"]["Data"]
self.comment=f.attrs["comment"]
self.yoko=data[:,0,0].astype(float64)
fstart=f["Traces"]['test_osc - Ch1 - Data_t0dt'][0][0]
fstep=f["Traces"]['test_osc - Ch1 - Data_t0dt'][0][1]
示例15: scatter
a.bgsub_type="Complex" #"Abs" #"dB" #"Abs"
a.save_folder.main_dir=a.name
a.frq2_ind=0
a.pwr2_ind=1
a.read_data()
#a.pwr_ind=39
print a.yoko.shape
a.filter_type="None"
#a.magabs_colormesh(fig_width=6.0, fig_height=4.0)#.show()
scatter(absolute(a.MagcomFilt[170, 192, :]))
scatter(absolute(a.MagcomFilt[170, :, 0]))
colormesh(absolute(a.MagcomFilt[260, :, :]))#.show()
a.ifft_plot(fig_width=6.0, fig_height=4.0).show() #, time_axis_type="time",
a.filter_type="FFT"
a.pwr_ind=0
a.magabs_colormesh(pl=str(a.pwr[a.pwr_ind]))#.show()
a.pwr_ind=1
a.magabs_colormesh(pl=str(a.pwr[a.pwr_ind]))
a.pwr_ind=2
a.magabs_colormesh(pl=str(a.pwr[a.pwr_ind]))
#offset=0
a.pwr_ind=3
a.magabs_colormesh(pl=str(a.pwr[a.pwr_ind]))
a.pwr_ind=4
print a.frq2[a.frq_ind]