PEATDB/plugins/KineticsAnalysis.py
def loadTempData(self):
        """Import temp data from 2 xls files for each set
         set1.xls contains duplicate data for variants 1-6
         i.e. columns 1-6 and 7-12 are repeats for 6 variants"""

        print 'importing temp data..'

        filename1 = os.path.join('temp', 'set1.xls') #variants 1-6
        filename2 = os.path.join('temp', 'set2.xls') #variants 7-12
        book1 = xlrd.open_workbook(os.path.join(self.path, filename1))
        try:
            book2 = xlrd.open_workbook(os.path.join(self.path, filename2))
        except:
            book2 = None


        rawdata={}
        times=range(0,190,10)
        mins=[]
        for t in times: mins.append(round(t/60.0,3))
        rowoffset=9
        i=0

        for i in range(0,12):
            name = self.variantnames[i]
            rawdata[name] = {}
            for dupname in ('1','2'):
                rawdata[name][dupname] = {}

        coloffset=0
        for book in (book1, book2):
            if book == None: continue
            for sheet in range(4,9):
                i=coloffset
                sh = book.sheet_by_index(sheet)
                temp = self.temps[sheet]
                for dup in (0,6): #7-12 are duplicates
                    i=i-dup
                    if dup == 0: dupname = '1'
                    else: dupname = '2'
                    #get raw data from cols 1-6 in sheet
                    for c in range(2+dup,8+dup):
                        row=10
                        name = self.variantnames[i]
                        #print book, sh, dup, c, name
                        rawdata[name][dupname][temp] = {}
                        for s in range(0,8):
                            ph = self.phlist[s]
                            r=row
                            yvals=[]; yerrs=[]; xerrs=[]
                            for t in times:
                                #print s, t, r, c, sh.col_values(c)[r], temp, ph, name
                                val=sh.col_values(c)[r]
                                yvals.append(val)
                                try:
                                    yerrs.append(val*self.abserr)
                                except:
                                     yerrs.append(0.0)
                                xerrs.append(0.1)
                                r = r + rowoffset
                            row+=1
                            rawdata[name][dupname][temp][ph] = EkinDataset(xy=[mins, yvals],
                                                errorlists=(xerrs, yerrs), labels=('t','A'))
                        i+=1
            coloffset+=6

        '''for n in rawdata.keys():
            for d in rawdata[n].keys():
                print n, d, rawdata[n][d].keys()'''

        return rawdata
Import temp data from 2 xls files for each set
         set1.xls contains duplicate data for variants 1-6
         i.e. columns 1-6 and 7-12 are repeats for 6 variants
Import temp data from 2 xls files for each set
set1.xls contains duplicate data for variants 1-6
i.e. columns 1-6 and 7-12 are repeats for 6 variants
Import temp data from 2 xls files for each set set1 . xls contains duplicate data for variants 1 - 6 i . e . columns 1 - 6 and 7 - 12 are repeats for 6 variants
def loadTempData(self):
        print 'importing temp data..'
        filename1 = os.path.join('temp', 'set1.xls') 
        filename2 = os.path.join('temp', 'set2.xls') 
        book1 = xlrd.open_workbook(os.path.join(self.path, filename1))
        try:
            book2 = xlrd.open_workbook(os.path.join(self.path, filename2))
        except:
            book2 = None
        rawdata={}
        times=range(0,190,10)
        mins=[]
        for t in times: mins.append(round(t/60.0,3))
        rowoffset=9
        i=0
        for i in range(0,12):
            name = self.variantnames[i]
            rawdata[name] = {}
            for dupname in ('1','2'):
                rawdata[name][dupname] = {}
        coloffset=0
        for book in (book1, book2):
            if book == None: continue
            for sheet in range(4,9):
                i=coloffset
                sh = book.sheet_by_index(sheet)
                temp = self.temps[sheet]
                for dup in (0,6): 
                    i=i-dup
                    if dup == 0: dupname = '1'
                    else: dupname = '2'
                    for c in range(2+dup,8+dup):
                        row=10
                        name = self.variantnames[i]
                        rawdata[name][dupname][temp] = {}
                        for s in range(0,8):
                            ph = self.phlist[s]
                            r=row
                            yvals=[]; yerrs=[]; xerrs=[]
                            for t in times:
                                val=sh.col_values(c)[r]
                                yvals.append(val)
                                try:
                                    yerrs.append(val*self.abserr)
                                except:
                                     yerrs.append(0.0)
                                xerrs.append(0.1)
                                r = r + rowoffset
                            row+=1
                            rawdata[name][dupname][temp][ph] = EkinDataset(xy=[mins, yvals],
                                                errorlists=(xerrs, yerrs), labels=('t','A'))
                        i+=1
            coloffset+=6
        return rawdata
def loadTempData ( self ) : print 'importing temp data..' filename1 = os . path . join ( 'temp' , 'set1.xls' ) filename2 = os . path . join ( 'temp' , 'set2.xls' ) book1 = xlrd . open_workbook ( os . path . join ( self . path , filename1 ) ) try : book2 = xlrd . open_workbook ( os . path . join ( self . path , filename2 ) ) except : book2 = None rawdata = { } times = range ( 0 , 190 , 10 ) mins = [ ] for t in times : mins . append ( round ( t / 60.0 , 3 ) ) rowoffset = 9 i = 0 for i in range ( 0 , 12 ) : name = self . variantnames [ i ] rawdata [ name ] = { } for dupname in ( '1' , '2' ) : rawdata [ name ] [ dupname ] = { } coloffset = 0 for book in ( book1 , book2 ) : if book == None : continue for sheet in range ( 4 , 9 ) : i = coloffset sh = book . sheet_by_index ( sheet ) temp = self . temps [ sheet ] for dup in ( 0 , 6 ) : i = i - dup if dup == 0 : dupname = '1' else : dupname = '2' for c in range ( 2 + dup , 8 + dup ) : row = 10 name = self . variantnames [ i ] rawdata [ name ] [ dupname ] [ temp ] = { } for s in range ( 0 , 8 ) : ph = self . phlist [ s ] r = row yvals = [ ] ; yerrs = [ ] ; xerrs = [ ] for t in times : val = sh . col_values ( c ) [ r ] yvals . append ( val ) try : yerrs . append ( val * self . abserr ) except : yerrs . append ( 0.0 ) xerrs . append ( 0.1 ) r = r + rowoffset row += 1 rawdata [ name ] [ dupname ] [ temp ] [ ph ] = EkinDataset ( xy = [ mins , yvals ] , errorlists = ( xerrs , yerrs ) , labels = ( 't' , 'A' ) ) i += 1 coloffset += 6 '''for n in rawdata.keys():
            for d in rawdata[n].keys():
                print n, d, rawdata[n][d].keys()''' return rawdata
Import temp data from 2 xls files for each set
set1.xls contains duplicate data for variants 1-6
i.e.
Import temp data from 2 xls files for each set set1 . xls contains duplicate data for variants 1 - 6 i . e .
"""Import temp data from 2 xls files for each set
         set1.xls contains duplicate data for variants 1-6
         i.e. columns 1-6 and 7-12 are repeats for 6 variants""" #variants 1-6 #variants 7-12 #7-12 are duplicates #get raw data from cols 1-6 in sheet #print book, sh, dup, c, name #print s, t, r, c, sh.col_values(c)[r], temp, ph, name '''for n in rawdata.keys():
            for d in rawdata[n].keys():
                print n, d, rawdata[n][d].keys()'''
self