kinetic data now saved
This commit is contained in:
parent
5326444e8d
commit
0f064be5c8
@ -280,7 +280,13 @@ class buildpanel(tk.Frame):
|
||||
kin_repeats.set(kin_repeats.get()-1)
|
||||
self.after(kin_delta.get()*1000,messure)
|
||||
else:
|
||||
kin_time.set(0)
|
||||
print('Kinetics finisched')
|
||||
kin_time.set(0)
|
||||
self.jf.df['baseline']=self.jf.baseData16
|
||||
self.jf.df['darkline']=self.jf.darkData16
|
||||
self.jf.df['nmscale']=self.jf.nmData16
|
||||
self.jf.save_kinetics("kini.dat")
|
||||
print(self.jf.df.head())
|
||||
|
||||
|
||||
|
||||
|
||||
26
JFSphoto.py
26
JFSphoto.py
@ -193,6 +193,7 @@ class Jfsphoto (object):
|
||||
return self.nmData16
|
||||
|
||||
def add_kinetic(self,name):
|
||||
self.df[str(name)]=config.rxData16
|
||||
print(name)
|
||||
|
||||
def save_pandas(self):
|
||||
@ -206,6 +207,18 @@ class Jfsphoto (object):
|
||||
except IOError:
|
||||
messagebox.showerror("By the great otter!","There's a problem saving the file.")
|
||||
|
||||
def save_kinetics(self,name):
|
||||
try:
|
||||
self.df.to_csv(name)
|
||||
except IOError:
|
||||
messagebox.showerror("By the great otter!","There's a problem saving the file.")
|
||||
|
||||
def load_kinetics(self,name):
|
||||
try:
|
||||
self.df = pd.read_csv(name,index_col=0)
|
||||
except IOError:
|
||||
messagebox.showerror("By the great otter!","There's a problem saving the file.")
|
||||
|
||||
def load_pandas(self):
|
||||
filename = filedialog.askopenfilename(defaultextension=".csv", title="Open file ")
|
||||
try:
|
||||
@ -304,15 +317,26 @@ class Jfsphoto (object):
|
||||
self.toolbarFrame.grid(row=1,columnspan=2, sticky="w")
|
||||
toolbar1 = NavigationToolbar2Tk(self.canvas, self.toolbarFrame)
|
||||
|
||||
|
||||
n = 0
|
||||
for txt,val in stati:
|
||||
tk.Radiobutton(master=self.ctr_right,text=txt,variable=self.ok,command=self.look,value=val,padx=5,pady=5).grid(row=n,column=0,sticky="w")
|
||||
n=n+1
|
||||
|
||||
self.kbtn = tk.Button(master=self.ctr_right,text="Load Kini",padx=5,pady=5,command=self.kini)
|
||||
self.kbtn.grid(row=7,column=0,sticky="w")
|
||||
win.focus_set()
|
||||
win.grab_set()
|
||||
win.wait_window()
|
||||
|
||||
def kini(self):
|
||||
self.load_kinetics("kini.dat")
|
||||
self.ax1.clear()
|
||||
self.df.plot(x = 'nmscale',y = 'darkline', color='red',linewidth=0.6,ax=self.ax1)
|
||||
self.df.plot(x = 'nmscale',y = 'baseline', color='blue',linewidth=0.6,ax=self.ax1)
|
||||
self.df.plot(x = 'nmscale',y = '2', color='green',linewidth=0.6,ax=self.ax1)
|
||||
self.canvas.draw()
|
||||
print(self.df.head())
|
||||
|
||||
def look(self):
|
||||
self.ax1.clear()
|
||||
if self.ok.get()==1:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user