def show(self): if self.jdf.input_jdf == "": self.jdf.gen_jdf([ agent for agent in self.agent_dict.values() if isinstance(agent, EBL_Polygons) ]) self.plot_JDF() shower(self, self.plot)
def show(cls, *args, **kwargs): from taref.core.shower import shower from enaml import imports with imports(): from taref.instruments.instrument_e import ControlView kwargs.update(dict(chief_view=ControlView, chief_cls=cls, name="instr_control", title="Instrument Control")) try: shower(*args, **kwargs) finally: Instrument.close_all() if Instrument.saving: Instrument.save_file.flush_buffers()
def show(cls, *args, **kwargs): from taref.core.shower import shower from enaml import imports with imports(): from taref.instruments.instrument_e import ControlView kwargs.update( dict(chief_view=ControlView, chief_cls=cls, name="instr_control", title="Instrument Control")) try: shower(*args, **kwargs) finally: Instrument.close_all() if Instrument.saving: Instrument.save_file.flush_buffers()
[r"Overlap length, $W$" , r"25 $\mu$m" ], [r"finger width, $a_q$" , r"80 nm" ], [r"DC Junction Resistances" , r"8.93 k$\Omega$, 9.35k$\Omega$" ], [r"Metallization ratio" , r"50\%" ]] tx.add(r"\subsection{Qubit values}") tx.make_table(qubit_values, r"|p{5 cm}|p{3 cm}|") tx.mult_fig_start() tx.add_mult_fig(tx.add_mult_fig, "test_colormap_plot.png") tx.mult_fig_end() tx.end()""" tx.process_source() #tx.make_input_tex() print tx.source_dict if 0: qubit_values=[[r"Qubit" , r"{}" ], [r"Finger type" , r"double finger" ], [r"Number of finger pairs, $N_{pq}$" , r"9" ], [r"Overlap length, $W$" , r"25 $\mu$m" ], [r"finger width, $a_q$" , r"80 nm" ], [r"DC Junction Resistances" , r"8.93 k$\Omega$, 9.35k$\Omega$" ], [r"Metallization ratio" , r"50\%" ]] tx.add(r"\subsection{Qubit values}") tx.make_table(qubit_values, r"|p{5 cm}|p{3 cm}|") shower(tx)
# return data[0,1,:].astype(float64) # #print pwr # # @tagged_property(unit="GHz", label="Start frequency") # def fstart(self): # return self.rd_hdf.data["Traces"]['Rohde&Schwarz Network Analyzer - S12_t0dt'][0][0] # # @tagged_property(unit="GHz", label="Step frequency") # def fstep(self): # return self.rd_hdf.data["Traces"]['Rohde&Schwarz Network Analyzer - S12_t0dt'][0][1] # # @tagged_property(unit="GHz", label="Frequency") # def freq(self, fstart, fstep, sm): # return linspace(fstart, fstart+fstep*(sm-1), sm) from taref.plotter.fig_format import Plotter a = Lyzer() #a.rd_hdf.read() a.read_data() b = Plotter() #print b.colormap b.colormesh("magabs", a.yoko, a.freq, a.MagAbs) #print b.xyfs, b.clts #print a.Magcom print a.probe_frq, a.probe_pwr print a.yoko.dtype print get_display(a, "probe_pwr") #print locals() #print globals() #print a.sm shower(a, b) #locals_dict=locals()) #read_hdf.show()
def show(self): from taref.core.shower import shower shower(self, self.plot)
#print t.run_loop() #t.add_thread('a', t.run_loop) #t.add_thread('b', t.run_loop) #print t.a #print t.b #while t.busy: # pass #print t.a #print t.b #print t.thread_list #t.add_thread('b') #print t.thread_list #t.thread_list.pop(0) if 0: t.do_it_now() while True: result = t.watch_thread() #print result if result is not None: break #sleep(0.01) print result #safe_setattr(t, "a", "3") #print t.a from taref.core.shower import shower shower(t) #def cocall(code, *args, **kwargs): # if Application.instance is None: # return code(*args, **kwargs) # else:
def ramp(self, ramp_end, ramp_steps, sleep_time): self.receive("voltage") for v in linspace(self.voltage, ramp_end, ramp_steps): self.send("voltage", v) #float("{0:.4f}".format(v)) sleep(sleep_time) ramp_end=Float(0).tag(sub=True, unit2="V", label="Ramp End") sleep_time=Float(0.5).tag(sub=True, unit2="s", label="Step Time") ramp_steps=Int(3).tag(sub=True, label="Ramp Steps") if __name__=="__main__": a=Yoko(address="GPIB0::10::INSTR") print get_tag(a, "voltage", "set_cmd") from taref.core.shower import shower shower(a) #a.ramp_steps=3 #a.ramp() #a.voltage.send(0.0) #a.send("voltage=0.2") #time.sleep(0.05) #Simple ramp example #a.receive("voltage") #time.sleep(0.05) #for v in np.linspace(a.voltage.value, 1, 10): # a.voltage.send(v) #float("{0:.4f}".format(v)) # time.sleep(0.5) #a.ramp=True #a.session.write("O1;E")
S11 = Array().tag(sub=True) S12 = Array().tag(sub=True) S21 = Array().tag(sub=True) S22 = Array().tag(sub=True) trigger_mode=Enum('Continuous', 'Hold').tag(mapping=TriggerModeDict, aka="self.ch1.TriggerMode") if __name__ == '__main__': # print get_ptr(1, "self.ch1.StimulusRange.Start") if 1: VNA = AgilentNetworkAnalyzer(simulate=True) VNA.trace_plot print get_tag(VNA, "response", "get_cmd") #b=Plotter() #b.line_plot('data', VNA.freq, 20.0*log10(absolute(VNA.S21))) shower(VNA) try: if 0: VNA.boot() print VNA.ch1.StimulusRange.Start print VNA.get_ptr("self.ch1.SourcePower.Level[1]") print VNA.receive("power") VNA.power=-27.0 print VNA.receive("power") print VNA.power VNA.start_freq=4.0e9 VNA.stop_freq=5.0e9 VNA.points=1001 VNA.averages=101 #VNA.send("start_freq") print VNA.ch1.StimulusRange.Start
s=(self.numsteps, self.shaper[0], self.shaper[2]) Magvec=f["Traces"][trace_name] Magcom=Magvec[:,0,:]+1j*Magvec[:,1,:] self.magcom=reshape(Magcom, s, order="F") @private_property def view_window(self): from enaml import imports with imports(): from SS_FileParser_enaml import Main return Main(ss=self) # def show(self): # app=QtApplication() # with imports(): # from SS_FileParser_enaml import Main # view=Main(ss=self) # view.show() # app.start() dp=DataParser() with File(file_path, "r") as f: dp.read_ssfile(f) #dp.trace_extract(f) #dp.print_self() #print dp.magcom.dtype from taref.core.shower import shower shower(dp) #dp.show()
def show(self): shower(self, self.wafer_coords)
def show(self): if self.jdf.input_jdf=="": self.jdf.gen_jdf([agent for agent in self.agent_dict.values() if isinstance(agent, EBL_Polygons)]) self.plot_JDF() shower(self, self.plot)
S12 = Array().tag(sub=True) S21 = Array().tag(sub=True) S22 = Array().tag(sub=True) trigger_mode = Enum('Continuous', 'Hold').tag(mapping=TriggerModeDict, aka="self.ch1.TriggerMode") if __name__ == '__main__': # print get_ptr(1, "self.ch1.StimulusRange.Start") if 1: VNA = AgilentNetworkAnalyzer(simulate=True) VNA.trace_plot print get_tag(VNA, "response", "get_cmd") #b=Plotter() #b.line_plot('data', VNA.freq, 20.0*log10(absolute(VNA.S21))) shower(VNA) try: if 0: VNA.boot() print VNA.ch1.StimulusRange.Start print VNA.get_ptr("self.ch1.SourcePower.Level[1]") print VNA.receive("power") VNA.power = -27.0 print VNA.receive("power") print VNA.power VNA.start_freq = 4.0e9 VNA.stop_freq = 5.0e9 VNA.points = 1001 VNA.averages = 101 #VNA.send("start_freq") print VNA.ch1.StimulusRange.Start
self.obj=obj def __call__(self, func): #if get_tag(self.obj, func.func_name, "log", True): func=log_func(func) make_instancemethod(self.obj, func) return func t=Test() t2=Test() t.get_member("a").tag(log=True) print t.get_member("a").metadata print t2.get_member("a").metadata from types import MethodType @instancemethod(t) def new_func(obj): print obj print globals() new_func(t2) t2.new_func() t.new_func() print isinstance(new_func, MethodType) print isinstance(t.new_func, MethodType) #make_instancemethod(t, new_func) from taref.core.shower import shower shower(t, t2)
# return data[0,1,:].astype(float64) # #print pwr # # @tagged_property(unit="GHz", label="Start frequency") # def fstart(self): # return self.rd_hdf.data["Traces"]['Rohde&Schwarz Network Analyzer - S12_t0dt'][0][0] # # @tagged_property(unit="GHz", label="Step frequency") # def fstep(self): # return self.rd_hdf.data["Traces"]['Rohde&Schwarz Network Analyzer - S12_t0dt'][0][1] # # @tagged_property(unit="GHz", label="Frequency") # def freq(self, fstart, fstep, sm): # return linspace(fstart, fstart+fstep*(sm-1), sm) from taref.plotter.fig_format import Plotter a=Lyzer() #a.rd_hdf.read() a.read_data() b=Plotter() #print b.colormap b.colormesh("magabs", a.yoko, a.freq, a.MagAbs) #print b.xyfs, b.clts #print a.Magcom print a.probe_frq, a.probe_pwr print a.yoko.dtype print get_display(a, "probe_pwr") #print locals() #print globals() #print a.sm shower( a, b)#locals_dict=locals()) #read_hdf.show()
[r"Overlap length, $W$" , r"25 $\mu$m" ], [r"finger width, $a_q$" , r"80 nm" ], [r"DC Junction Resistances" , r"8.93 k$\Omega$, 9.35k$\Omega$" ], [r"Metallization ratio" , r"50\%" ]] tx.add(r"\subsection{Qubit values}") tx.make_table(qubit_values, r"|p{5 cm}|p{3 cm}|") tx.mult_fig_start() tx.add_mult_fig(tx.add_mult_fig, "test_colormap_plot.png") tx.mult_fig_end() tx.end()""" tx.process_source() #tx.make_input_tex() print tx.source_dict if 0: qubit_values = [[r"Qubit", r"{}"], [r"Finger type", r"double finger"], [r"Number of finger pairs, $N_{pq}$", r"9"], [r"Overlap length, $W$", r"25 $\mu$m"], [r"finger width, $a_q$", r"80 nm"], [ r"DC Junction Resistances", r"8.93 k$\Omega$, 9.35k$\Omega$" ], [r"Metallization ratio", r"50\%"]] tx.add(r"\subsection{Qubit values}") tx.make_table(qubit_values, r"|p{5 cm}|p{3 cm}|") shower(tx)
def show(self, *args, **kwargs): """shortcut to shower which defaults to shower(self)""" shower(*((self,)+args), **kwargs)
def ramp(self, ramp_end, ramp_steps, sleep_time): self.receive("voltage") for v in linspace(self.voltage, ramp_end, ramp_steps): self.send("voltage", v) #float("{0:.4f}".format(v)) sleep(sleep_time) ramp_end = Float(0).tag(sub=True, unit2="V", label="Ramp End") sleep_time = Float(0.5).tag(sub=True, unit2="s", label="Step Time") ramp_steps = Int(3).tag(sub=True, label="Ramp Steps") if __name__ == "__main__": a = Yoko(address="GPIB0::10::INSTR") print get_tag(a, "voltage", "set_cmd") from taref.core.shower import shower shower(a) #a.ramp_steps=3 #a.ramp() #a.voltage.send(0.0) #a.send("voltage=0.2") #time.sleep(0.05) #Simple ramp example #a.receive("voltage") #time.sleep(0.05) #for v in np.linspace(a.voltage.value, 1, 10): # a.voltage.send(v) #float("{0:.4f}".format(v)) # time.sleep(0.5) #a.ramp=True #a.session.write("O1;E")
make_instancemethod(self.obj, func) return func t = Test() t2 = Test() t.get_member("a").tag(log=True) print t.get_member("a").metadata print t2.get_member("a").metadata from types import MethodType @instancemethod(t) def new_func(obj): print obj print globals() new_func(t2) t2.new_func() t.new_func() print isinstance(new_func, MethodType) print isinstance(t.new_func, MethodType) #make_instancemethod(t, new_func) from taref.core.shower import shower shower(t, t2)
def show(self, *args, **kwargs): """shortcut to shower which defaults to shower(self)""" shower(*((self, ) + args), **kwargs)
S11=Ga/(Ga+1.0j*Ba+1.0j*w*Ct+1.0/ZL+1.0/(1.0j*w*Lk))#+1.0j*(VcdivV)*w*Cc) S33= S33Full#(1/ZL-Y)/(1/ZL+Y) S13=1.0j*sqrt(2*Ga*GL)/(Ga+1.0j*Ba+ 1.0j*w*Ct+1.0/ZL+1.0/(1.0j*w*Lk))#+1.0j*(VcdivV)*w*Cc) S11q=Ga/(Ga+1.0j*Ba+1.0j*w*Ct+1.0/ZL+1.0/(1.0j*w*Lk))#+1.0j*(VcdivV)*w*Cc) S13q=1.0j*sqrt(2*Ga*GL)/(Ga+1.0j*Ba+ 1.0j*w*Ct+1.0/ZL+1.0/(1.0j*w*Lk)) #S21C=2.0/(2.0+1.0/(1.0j*w*Cc*ZL)) S21C=2.0*Y3/(2.0*Y3+Y2+Y1+1/ZL+ZL*(Y1*Y3+Y2*Y3+Y1*Y2)) crosstalk=S21C*S13q*S13/(exp(-1.0j*tL)-S11*exp(1.0j*tL)*S11q) return S33 + S13**2/(exp(-2.0j*tL)/S11q-S11)+crosstalk plotter=Typed(Plotter).tag(private=True) @observe("vf", "tD", "ZS", "epsinf", "K2", "f0", "Cc", "apwr", "avalue", "bg_off", "Lk", "bg_slope") def update_plot(self, change): if change["type"]=="update": self.get_member("R").reset(self) self.plotter.plot_dict["R_theory"].clt.set_ydata(20.0*log10(absolute(self.R))+self.bg_off+self.bg_slope*f*1e-9) self.plotter.draw() d=Fitter2() b.line_plot("R_theory", f, 20.0*log10(absolute(d.R))+d.bg_off, linewidth=0.5) d.plotter=b shower(b)
class Read_Extension_Test(Read_File): """a test class for extending Read_File""" data=Dict() def read(self): self.data={"file_path": self.file_path} return super(Read_Extension_Test, self).read() class Read_Test(Atom): """a test class for having Read file as a child""" read_file=Typed(Read_Extension_Test).tag(label="").tag(no_spacer=True) data=Unicode().tag(discard=True, log=False, no_spacer=True, label="", spec="multiline") def _default_read_file(self): return Read_File(show_details=False, show_simple=True) @observe("read_file.read_event") def change_data(self, change): print change self.data=self.read_file.data_str a=Read_Extension_Test() b=Read_Test(read_file=a) print a.read() #print a.data #print a.data_str #a=Read_TXT(file_path="/Users/thomasaref/Dropbox/Current stuff/TA_software/idt2.jdf") #a=Read_HDF5() from taref.core.shower import shower shower(a, b)
def show(self): try: shower(*self.agents) finally: pass
#S21C=2.0/(2.0+1.0/(1.0j*w*Cc*ZL)) S21C = 2.0 * Y3 / (2.0 * Y3 + Y2 + Y1 + 1 / ZL + ZL * (Y1 * Y3 + Y2 * Y3 + Y1 * Y2)) crosstalk = S21C * S13q * S13 / (exp(-1.0j * tL) - S11 * exp(1.0j * tL) * S11q) return S33 + S13**2 / (exp(-2.0j * tL) / S11q - S11) + crosstalk plotter = Typed(Plotter).tag(private=True) @observe("vf", "tD", "ZS", "epsinf", "K2", "f0", "Cc", "apwr", "avalue", "bg_off", "Lk", "bg_slope") def update_plot(self, change): if change["type"] == "update": self.get_member("R").reset(self) self.plotter.plot_dict["R_theory"].clt.set_ydata( 20.0 * log10(absolute(self.R)) + self.bg_off + self.bg_slope * f * 1e-9) self.plotter.draw() d = Fitter2() b.line_plot("R_theory", f, 20.0 * log10(absolute(d.R)) + d.bg_off, linewidth=0.5) d.plotter = b shower(b)
@observe("file_name", "file_suffix", "folder.dir_path")#, "log_name", "log_suffix") def update_properties(self, change): for name in ("main_file", "file_path", "nosuffix_file_path"): self.get_member(name).reset(self) def browse_clicked(self): path = FileDialogEx.get_open_file_name(current_path=self.file_path) if path: self.file_path = path @cached_property def view(self): return FilerExt @cached_property def view_window(self): return FilerMain(filer=self) if __name__=="__main__": from taref.core.shower import shower a=Folder() f=Filer() from atom.api import Typed class Test(Atom): f=Typed(Filer).tag(no_spacer=True) a=Typed(Folder).tag(no_spacer=True) t=Test(f=f, a=a) t.f.folder.show_simple=False t.f.folder.show_details=False shower(a, f, t)
s = (self.numsteps, self.shaper[0], self.shaper[2]) Magvec = f["Traces"][trace_name] Magcom = Magvec[:, 0, :] + 1j * Magvec[:, 1, :] self.magcom = reshape(Magcom, s, order="F") @private_property def view_window(self): from enaml import imports with imports(): from SS_FileParser_enaml import Main return Main(ss=self) # def show(self): # app=QtApplication() # with imports(): # from SS_FileParser_enaml import Main # view=Main(ss=self) # view.show() # app.start() dp = DataParser() with File(file_path, "r") as f: dp.read_ssfile(f) #dp.trace_extract(f) #dp.print_self() #print dp.magcom.dtype from taref.core.shower import shower shower(dp) #dp.show()