kinetics ok

This commit is contained in:
jens 2020-12-26 17:44:30 +01:00
parent 1b2a03b7f6
commit acc728eab8
3 changed files with 3725 additions and 27 deletions

View File

@ -291,7 +291,7 @@ class buildpanel(tk.Frame):
self.jf.df['baseline']=self.jf.baseData16
self.jf.df['darkline']=self.jf.darkData16
self.jf.df['nmscale']=self.jf.nmData16
self.jf.do_math()
self.jf.do_math(self)

View File

@ -123,9 +123,12 @@ class Jfsphoto (object):
######### jfs math
self.ok = tk.IntVar()
self.ok.set(0)
self.akt_point=0
self.akt_nm = 0
######### jfs methods
self.methods = []
def do_calibrate(self):
win = tk.Toplevel()
win.geometry("450x200+100+100")
@ -397,35 +400,43 @@ class Jfsphoto (object):
except IOError:
print("By the great otter!","No config.ini file")
def do_math(self,panel):
def onclick(event):
def draw_slice(self):
self.ax2.clear()
print('%s click: button=%d, xdata=%f, ydata=%f' %('double' if event.dblclick else 'single', event.button,
event.xdata, event.ydata))
if self.akt_point > 0:
x=[]
y=[]
for xx in self.col_list:
x.append(int(xx))
yy = event.xdata
p = int((yy - self.nm_left)*(1/self.nm_step))
if self.ok.get() < 3:
yy = self.df.iloc[p][xx]
yy = self.df.iloc[self.akt_point][xx]
elif self.ok.get()==3:
yy = self.df.iloc[p][xx+'_abs']
yy = self.df.iloc[self.akt_point][xx+'_abs']
elif self.ok.get()==4:
yy = self.df.iloc[p][xx+'_trans']
yy = self.df.iloc[self.akt_point][xx+'_trans']
y.append(yy)
self.ax2.plot(x, y, linewidth=0.6)
self.ax2.set_title(f'{round(self.akt_nm,2)} [nm]')
self.canvas.draw()
def do_math(self,panel):
def onclick(event):
#print('%s click: button=%d, xdata=%f, ydata=%f' %('double' if event.dblclick else 'single', event.button,
# event.xdata, event.ydata))
if event.button == 3:
self.akt_nm=0
self.akt_point=0
else:
self.akt_nm = event.xdata
self.akt_point = int((self.akt_nm - self.nm_left)*(1/self.nm_step))
self.draw_slice()
def on_key_press(event):
print("you pressed {}".format(event.key))
key_press_handler(event, self.canvas, self.toolbar1)
#print(panel.SHvalue.get())
#panel.bcollect.invoke()
stati = [("Raw",1),("Raw + Baseline",2),("Transmission",4),("Absorbanz",3)]
self.proji3d = False
@ -494,16 +505,6 @@ class Jfsphoto (object):
win.grab_set()
win.wait_window()
# def do_2dprint(self):
# self.ax1 = self.fig.add_subplot(111)
# self.look()
# def do_3dprint(self):
# self.ax1 = self.fig.gca(projection='3d')
# for xx in self.col_list:
# self.df.plot(y = 'nmscale',x = xx, zs= int(xx), linewidth=0.6,ax=self.ax1)
# self.canvas.draw()
def show_selected(self):
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
self.look()
@ -585,6 +586,7 @@ class Jfsphoto (object):
def look(self):
self.draw_slice()
self.ax1.clear()
if self.proji3d==True:
self.ax1 = self.fig.add_subplot(2,3,(1,5),projection='3d')
@ -891,6 +893,7 @@ class Jfsphoto (object):
lb3.grid(column=0,row=7,sticky='w')
#### canvas
fig = plt.Figure(figsize=(4,2),dpi=100)
plt.rcParams.update({'font.size': 5})
ax1 = fig.add_subplot(111)
canvas = FigureCanvasTkAgg(fig, master = win )
canvas.get_tk_widget().grid(column=1,row=0,sticky='nesw')

3695
KV_3_50_20_40.csv Normal file

File diff suppressed because it is too large Load Diff