PEATDB/Ekin/Ekin_CD.py
def insert_CD_temp_datatab(self):
        """Insert datatab for fitting the temperature dependence of CD data"""
        #
        # Get the wavelengths
        #
        thistab = self.nb.index(self.nb.getcurselection())
        wavlens_dps=self.data[thistab][0].keys()
        wavlens=[]
        for dp in wavlens_dps:
            if dp!='label' and dp!='label_widget':
                wavlens.append(self.data[thistab][0][dp]['var'].get())
        wavlens.sort()
        self.wavlen=StringVar()
        #
        # Open window for selecting the wavelength
        #
        # first check if there is any imported data - bad hack
        if self.tabnames[thistab]=='data' or self.tabnames[thistab]=='Temp-dependence':
            import tkMessageBox
            tkMessageBox.showwarning("Import Data First",
                                     "Please import data or choose the first tab.")
            return
        self.wav_win=Toplevel()
        self.wav_win.title('Select wavelength')
        #
        # Set the geometry

        #PEATDB.PEAT_window.set_geometry(self.ekin_win,self.wav_win)
        self.wav_win.protocol("WM_DELETE_WINDOW",self.wav_win_cancel)

        #
        # Entry field for wavelength instead - asked for by Una
        #
        wav_entry=Entry(self.wav_win,textvariable=self.wavlen,width=10,font='Courier 14',justify='center')
        wav_entry.grid(row=1,column=0,sticky='news',padx=3,pady=3,columnspan=2)
        # Label
        lb=Label(self.wav_win,text='Choose Wavelength',font='Arial 16',justify='center')
        lb.grid(row=0,column=0,sticky='news',padx=3,pady=3,columnspan=2)
        #
        increment = float(wavlens[1])-float(wavlens[0])
        self.wavscale=Scale(self.wav_win,resolution=increment,variable=self.wavlen,orient='horizontal',showvalue=0,
                            command=self.insert_wavdata,from_=wavlens[0],to=wavlens[-1])
        self.wavscale.grid(row=2,column=0,sticky='news',padx=3,pady=3,columnspan=2)
        self.wavlen.set(wavlens[0])
        #
        # Manually specify min and max mdeg
        #
        Label(self.wav_win,text='min mdeg').grid(row=3,column=0)
        self.min_mdeg=DoubleVar()
        self.min_entry=Entry(self.wav_win,textvariable=self.min_mdeg,width=10,font='Courier 14',justify='center')
        self.min_entry.grid(row=4,column=0,sticky='news',padx=3,pady=3)
        self.min_entry.bind('<KeyPress>',self.update_CDmin)
        #
        Label(self.wav_win,text='max mdeg').grid(row=3,column=1,padx=3,pady=3)
        self.max_mdeg=DoubleVar()
        self.max_entry=Entry(self.wav_win,textvariable=self.max_mdeg,width=10,font='Courier 14',justify='center')
        self.max_entry.grid(row=4,column=1,sticky='news',padx=3,pady=3)
        self.max_entry.bind('<KeyPress>',self.update_CDmax)
        #
        Button(self.wav_win,text='Cancel',command=self.wav_win_cancel).grid(row=5,column=0,sticky='news',padx=3,pady=4,columnspan=1)
        Button(self.wav_win,text='Done',command=self.wav_win_close).grid(row=5,column=1,sticky='news',padx=3,pady=4,columnspan=1)
        #
        # Add the new datatab
        #
        dps=len(self.data.keys())
        names=self.tabnames.values()
        #if already created temp dep. tab do not do it again
        if not 'Temp-dependence' in names:
            self.temp_dep_tab=self.add_datalist('Temp-dependence',data_points=dps)
        else:
            thistab_num=len(self.datatabs)-1
            self.nb.selectpage(self.tabnames[thistab_num])
        #
        # Plot the data
        #
        self.CD_min='auto'
        self.CD_max='auto'
        self.insert_wavdata()
        #
        # Update the fitting model
        #
        self.FIT.update_model('CD - Thermal denaturation')
        self.reprint_parameters()
        self.redraw_graph()
        return
Insert datatab for fitting the temperature dependence of CD data
Insert datatab for fitting the temperature dependence of CD data
Insert datatab for fitting the temperature dependence of CD data
def insert_CD_temp_datatab(self):
         Get the wavelengths
        thistab = self.nb.index(self.nb.getcurselection())
        wavlens_dps=self.data[thistab][0].keys()
        wavlens=[]
        for dp in wavlens_dps:
            if dp!='label' and dp!='label_widget':
                wavlens.append(self.data[thistab][0][dp]['var'].get())
        wavlens.sort()
        self.wavlen=StringVar()
         Open window for selecting the wavelength
         first check if there is any imported data - bad hack
        if self.tabnames[thistab]=='data' or self.tabnames[thistab]=='Temp-dependence':
            import tkMessageBox
            tkMessageBox.showwarning("Import Data First",
                                     "Please import data or choose the first tab.")
            return
        self.wav_win=Toplevel()
        self.wav_win.title('Select wavelength')
         Set the geometry
        PEATDB.PEAT_window.set_geometry(self.ekin_win,self.wav_win)
        self.wav_win.protocol("WM_DELETE_WINDOW",self.wav_win_cancel)
         Entry field for wavelength instead - asked for by Una
        wav_entry=Entry(self.wav_win,textvariable=self.wavlen,width=10,font='Courier 14',justify='center')
        wav_entry.grid(row=1,column=0,sticky='news',padx=3,pady=3,columnspan=2)
         Label
        lb=Label(self.wav_win,text='Choose Wavelength',font='Arial 16',justify='center')
        lb.grid(row=0,column=0,sticky='news',padx=3,pady=3,columnspan=2)
        increment = float(wavlens[1])-float(wavlens[0])
        self.wavscale=Scale(self.wav_win,resolution=increment,variable=self.wavlen,orient='horizontal',showvalue=0,
                            command=self.insert_wavdata,from_=wavlens[0],to=wavlens[-1])
        self.wavscale.grid(row=2,column=0,sticky='news',padx=3,pady=3,columnspan=2)
        self.wavlen.set(wavlens[0])
         Manually specify min and max mdeg
        Label(self.wav_win,text='min mdeg').grid(row=3,column=0)
        self.min_mdeg=DoubleVar()
        self.min_entry=Entry(self.wav_win,textvariable=self.min_mdeg,width=10,font='Courier 14',justify='center')
        self.min_entry.grid(row=4,column=0,sticky='news',padx=3,pady=3)
        self.min_entry.bind('<KeyPress>',self.update_CDmin)
        Label(self.wav_win,text='max mdeg').grid(row=3,column=1,padx=3,pady=3)
        self.max_mdeg=DoubleVar()
        self.max_entry=Entry(self.wav_win,textvariable=self.max_mdeg,width=10,font='Courier 14',justify='center')
        self.max_entry.grid(row=4,column=1,sticky='news',padx=3,pady=3)
        self.max_entry.bind('<KeyPress>',self.update_CDmax)
        Button(self.wav_win,text='Cancel',command=self.wav_win_cancel).grid(row=5,column=0,sticky='news',padx=3,pady=4,columnspan=1)
        Button(self.wav_win,text='Done',command=self.wav_win_close).grid(row=5,column=1,sticky='news',padx=3,pady=4,columnspan=1)
         Add the new datatab
        dps=len(self.data.keys())
        names=self.tabnames.values()
        if already created temp dep. tab do not do it again
        if not 'Temp-dependence' in names:
            self.temp_dep_tab=self.add_datalist('Temp-dependence',data_points=dps)
        else:
            thistab_num=len(self.datatabs)-1
            self.nb.selectpage(self.tabnames[thistab_num])
         Plot the data
        self.CD_min='auto'
        self.CD_max='auto'
        self.insert_wavdata()
         Update the fitting model
        self.FIT.update_model('CD - Thermal denaturation')
        self.reprint_parameters()
        self.redraw_graph()
        return
def insert_CD_temp_datatab ( self ) : thistab = self . nb . index ( self . nb . getcurselection ( ) ) wavlens_dps = self . data [ thistab ] [ 0 ] . keys ( ) wavlens = [ ] for dp in wavlens_dps : if dp != 'label' and dp != 'label_widget' : wavlens . append ( self . data [ thistab ] [ 0 ] [ dp ] [ 'var' ] . get ( ) ) wavlens . sort ( ) self . wavlen = StringVar ( ) if self . tabnames [ thistab ] == 'data' or self . tabnames [ thistab ] == 'Temp-dependence' : import tkMessageBox tkMessageBox . showwarning ( "Import Data First" , "Please import data or choose the first tab." ) return self . wav_win = Toplevel ( ) self . wav_win . title ( 'Select wavelength' ) self . wav_win . protocol ( "WM_DELETE_WINDOW" , self . wav_win_cancel ) wav_entry = Entry ( self . wav_win , textvariable = self . wavlen , width = 10 , font = 'Courier 14' , justify = 'center' ) wav_entry . grid ( row = 1 , column = 0 , sticky = 'news' , padx = 3 , pady = 3 , columnspan = 2 ) lb = Label ( self . wav_win , text = 'Choose Wavelength' , font = 'Arial 16' , justify = 'center' ) lb . grid ( row = 0 , column = 0 , sticky = 'news' , padx = 3 , pady = 3 , columnspan = 2 ) increment = float ( wavlens [ 1 ] ) - float ( wavlens [ 0 ] ) self . wavscale = Scale ( self . wav_win , resolution = increment , variable = self . wavlen , orient = 'horizontal' , showvalue = 0 , command = self . insert_wavdata , from_ = wavlens [ 0 ] , to = wavlens [ - 1 ] ) self . wavscale . grid ( row = 2 , column = 0 , sticky = 'news' , padx = 3 , pady = 3 , columnspan = 2 ) self . wavlen . set ( wavlens [ 0 ] ) Label ( self . wav_win , text = 'min mdeg' ) . grid ( row = 3 , column = 0 ) self . min_mdeg = DoubleVar ( ) self . min_entry = Entry ( self . wav_win , textvariable = self . min_mdeg , width = 10 , font = 'Courier 14' , justify = 'center' ) self . min_entry . grid ( row = 4 , column = 0 , sticky = 'news' , padx = 3 , pady = 3 ) self . min_entry . bind ( '<KeyPress>' , self . update_CDmin ) Label ( self . wav_win , text = 'max mdeg' ) . grid ( row = 3 , column = 1 , padx = 3 , pady = 3 ) self . max_mdeg = DoubleVar ( ) self . max_entry = Entry ( self . wav_win , textvariable = self . max_mdeg , width = 10 , font = 'Courier 14' , justify = 'center' ) self . max_entry . grid ( row = 4 , column = 1 , sticky = 'news' , padx = 3 , pady = 3 ) self . max_entry . bind ( '<KeyPress>' , self . update_CDmax ) Button ( self . wav_win , text = 'Cancel' , command = self . wav_win_cancel ) . grid ( row = 5 , column = 0 , sticky = 'news' , padx = 3 , pady = 4 , columnspan = 1 ) Button ( self . wav_win , text = 'Done' , command = self . wav_win_close ) . grid ( row = 5 , column = 1 , sticky = 'news' , padx = 3 , pady = 4 , columnspan = 1 ) dps = len ( self . data . keys ( ) ) names = self . tabnames . values ( ) if not 'Temp-dependence' in names : self . temp_dep_tab = self . add_datalist ( 'Temp-dependence' , data_points = dps ) else : thistab_num = len ( self . datatabs ) - 1 self . nb . selectpage ( self . tabnames [ thistab_num ] ) self . CD_min = 'auto' self . CD_max = 'auto' self . insert_wavdata ( ) self . FIT . update_model ( 'CD - Thermal denaturation' ) self . reprint_parameters ( ) self . redraw_graph ( ) return
Insert datatab for fitting the temperature dependence of CD data
Insert datatab for fitting the temperature dependence of CD data
"""Insert datatab for fitting the temperature dependence of CD data""" # # Get the wavelengths # # # Open window for selecting the wavelength # # first check if there is any imported data - bad hack # # Set the geometry #PEATDB.PEAT_window.set_geometry(self.ekin_win,self.wav_win) # # Entry field for wavelength instead - asked for by Una # # Label # # # Manually specify min and max mdeg # # # # # Add the new datatab # #if already created temp dep. tab do not do it again # # Plot the data # # # Update the fitting model #
self