transformed = CpuGpuArray.zeros_like(src) fname_results = os.path.splitext(data.fname)[0]+'_result.pkl' FilesDirs.raise_if_dir_does_not_exist(os.path.dirname(fname_results)) print 'Loading',fname_results results=Pkl.load(fname_results) theta_est = results.theta tw = TransformWrapper(**results.tw_args) tw.create_grid_lines(step=0.1,factor=0.5) scale_quiver=1000 # The *smaller* this value is, the larger the plotted arrows will be. level=-1 # pick the finest scale cpa_space = tw.ms.L_cpa_space[level] cpa_space.theta2Avees(theta_est) cpa_space.update_pat() tw.calc_T_fwd(src,transformed,level=level) transformed.gpu2cpu() tw.calc_v(level=level) tw.v_dense.gpu2cpu() plt.close('all') disp(tw=tw,theta=theta_est,src=src,dst=dst,transformed=transformed,level=level, use_subplots=1,scale_quiver=scale_quiver) if not inside_spyder(): raw_input("Press Enter to exit")
transformed = CpuGpuArray.zeros_like(src) scale_quiver = 1000 # The *smaller* this value is, the larger the plotted arrows will be. level = -1 # pick the finest scale cpa_space = tw.ms.L_cpa_space[level] cpa_space.theta2Avees(theta_est) cpa_space.update_pat() tw.calc_T_fwd(src, transformed, level=level) transformed.gpu2cpu() tw.calc_v(level=level) tw.v_dense.gpu2cpu() disp(tw=tw, theta=theta_est, src=src, dst=dst, transformed=transformed, level=level, use_subplots=1, scale_quiver=scale_quiver) disp(tw=tw, theta=theta_est, src=src, dst=dst, transformed=transformed, level=level, use_subplots=1, scale_quiver=scale_quiver) if not inside_spyder(): raw_input("Press Enter to exit")
physics = [] electronics = [] active_expt = None # Curently active experiment fd = None # Phoenix hardware handler root = Tk() size = getsize(root) f = Frame(root) # make the widgets f.pack(side=TOP) left = Frame(f, bg = 'white') left.pack(side = LEFT, anchor = NW) right = Frame(f, bg= 'white') right.pack(side = LEFT, fill = X, expand = 1) # Create the plot2d window & message window Objects plot2d = disp.disp(right, size[0], size[1],'ivory') msgwin = textwin.textwin(root, 50, 15) #Create Expt objects. Pass canvas size, plot2d and msgwin objects Primer = primer.explore(left, size, plot2d, msgwin) Primer.label = 'Explore Phoenix' #List of Physics Experiments Cap = capacitor.cap(left, size, plot2d, msgwin) Cap.label = 'Capacitor Charging' Cap.file = 'capacitor.html' physics.append(Cap) Induction = induction.induction(left, size, plot2d, msgwin) Induction.label = 'Electromagnetic Induction' physics.append(Induction) Trans = transformer.tran(left, size, plot2d, msgwin)