def sub_zero_frame(self,t,s,i): tt=[] ss=[] z=[] #print self.zero_frame_enable if self.zero_frame_enable==True: if read_xyz_data(tt,ss,z,self.zero_frame_list[i])==True: for ii in range(0,len(t)): s[ii]=s[ii]-ss[ii]
def draw_mode(self,x_start,y_start,z_size): t=[] s=[] z=[] x=x_start y=y_start self.cr.set_source_rgb(0.2,0.2,0.2) if read_xyz_data(t,s,z,os.path.join(os.getcwd(),"light_dump","light_1d_photons_tot_norm.dat"))==True: self.cr.move_to(x-s[0]*40, y) self.cr.set_line_width(5) array_len=len(t) for i in range(0,array_len): self.cr.line_to(x-s[i]*40, y_start+(z_size*i/array_len)) self.cr.stroke()
def draw_graph(self): x=[] y=[] z=[] if read_xyz_data(x,y,z,os.path.join(get_sim_path(),"fit_data"+str(self.index)+".inp"))==True: self.fig.clf() self.fig.subplots_adjust(bottom=0.2) self.fig.subplots_adjust(left=0.1) self.ax1 = self.fig.add_subplot(111) self.ax1.ticklabel_format(useOffset=False) self.ax1.set_xlabel(_("x")) self.ax1.set_ylabel(_("y")) voltage, = self.ax1.plot(x,y, 'ro-', linewidth=3 ,alpha=1.0)
def draw_graph(self): x=[] y=[] z=[] if read_xyz_data(x,y,z,"fit_data"+str(self.index)+".inp")==True: self.fig.clf() self.fig.subplots_adjust(bottom=0.2) self.fig.subplots_adjust(left=0.1) self.ax1 = self.fig.add_subplot(111) self.ax1.ticklabel_format(useOffset=False) self.ax1.set_xlabel(_("x")) self.ax1.set_ylabel(_("y")) voltage, = self.ax1.plot(x,y, 'ro-', linewidth=3 ,alpha=1.0)
def read_data_file(self,t,s,z,index): if read_xyz_data(t,s,z,self.input_files[index])==True: self.sub_zero_frame(t,s,index) my_min=0.0; for ii in range(0,len(t)): t[ii]=t[ii]*self.plot_token.x_mul s[ii]=s[ii]*self.plot_token.y_mul if self.plot_token.invert_y==True: s[ii]=-s[ii] if self.plot_token.subtract_first_point==True: if ii==0: val=s[0] s[ii]=s[ii]-val if self.plot_token.add_min==True: my_min=min(s) for ii in range(0,len(t)): s[ii]=s[ii]-my_min if self.plot_token.normalize==True: local_max=max(s) for ii in range(0,len(t)): if s[ii]!=0: s[ii]=s[ii]/local_max else: s[ii]=0.0 if index<len(self.plot_id): plot_number=self.plot_id[index] else: plot_number=index print "YMIN=",self.plot_token.ymin if self.plot_token.ymax!=-1: self.ax[plot_number].set_ylim((self.plot_token.ymin,self.plot_token.ymax)) return True else: return False