kinetic logA vs 1/A working
This commit is contained in:
parent
acc728eab8
commit
79c96824bd
25
JFSphoto.py
25
JFSphoto.py
@ -125,6 +125,7 @@ class Jfsphoto (object):
|
||||
self.ok.set(0)
|
||||
self.akt_point=0
|
||||
self.akt_nm = 0
|
||||
self.log = True
|
||||
######### jfs methods
|
||||
self.methods = []
|
||||
|
||||
@ -402,6 +403,7 @@ class Jfsphoto (object):
|
||||
|
||||
def draw_slice(self):
|
||||
self.ax2.clear()
|
||||
self.ax3.clear()
|
||||
if self.akt_point > 0:
|
||||
x=[]
|
||||
y=[]
|
||||
@ -417,6 +419,15 @@ class Jfsphoto (object):
|
||||
y.append(yy)
|
||||
self.ax2.plot(x, y, linewidth=0.6)
|
||||
self.ax2.set_title(f'{round(self.akt_nm,2)} [nm]')
|
||||
if self.log == True:
|
||||
self.ax3.set_title(f'{round(self.akt_nm,2)} [nm] log')
|
||||
self.ax3.set_yscale('log')
|
||||
else:
|
||||
y1 = np.array(y)
|
||||
y = 1 / y1
|
||||
self.ax3.set_title(f'{round(self.akt_nm,2)} [nm] 1/A')
|
||||
self.ax3.plot(x, y, linewidth=0.6)
|
||||
|
||||
self.canvas.draw()
|
||||
|
||||
def do_math(self,panel):
|
||||
@ -451,6 +462,17 @@ class Jfsphoto (object):
|
||||
self.proji3d=True
|
||||
self.look()
|
||||
|
||||
def togglelog():
|
||||
if self.kbtm.config('relief')[-1] == 'sunken':
|
||||
self.kbtm.config(relief='raised')
|
||||
#self.do_2dprint()
|
||||
self.log=True
|
||||
else:
|
||||
self.kbtm.config(relief='sunken')
|
||||
#self.do_3dprint()
|
||||
self.log=False
|
||||
self.look()
|
||||
|
||||
win = tk.Toplevel()
|
||||
self.center = tk.Frame(win, bg='gray2', width=800, height=400, padx=3, pady=3)
|
||||
self.center.grid_rowconfigure(0, weight=1)
|
||||
@ -466,6 +488,7 @@ class Jfsphoto (object):
|
||||
|
||||
self.ax1 = self.fig.add_subplot(2,3,(1,5))
|
||||
self.ax2 = self.fig.add_subplot(2,3,3)
|
||||
self.ax3 = self.fig.add_subplot(2,3,6)
|
||||
self.canvas = FigureCanvasTkAgg(self.fig, master = self.ctr_mid)
|
||||
self.canvas._tkcanvas.pack(side = tk.TOP, fill = tk.BOTH, expand = 1)
|
||||
self.toolbarFrame = tk.Frame(master=self.center,padx=5,pady=5)
|
||||
@ -491,7 +514,7 @@ class Jfsphoto (object):
|
||||
self.kbtn.grid(row=16,column=0,sticky="w")
|
||||
self.kbtn = tk.Button(master=self.ctr_right,text="3 D Print",command=toggle,width=15,relief='raised')
|
||||
self.kbtn.grid(row=17,column=0,sticky="w")
|
||||
self.kbtm = tk.Button(master=self.ctr_right,text="Methods",command=lambda JFSphoto=Jfsphoto: self.do_methods(panel),width=15)
|
||||
self.kbtm = tk.Button(master=self.ctr_right,text="ln[A] 1/[A]",command=togglelog,width=15)
|
||||
self.kbtm.grid(row=18,column=0,sticky="w")
|
||||
if self.calculate() :
|
||||
self.show_first_look()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user