Exemplo n.º 1
0
    def Report():
        imgname = 'polymethodsgrowth.png'
        slopename = 'slopes.txt'
        slopes = sp.zeros([len(Experiment.runs), len(Experiment.conc)])
        i = 0
        j = 0
        pyplot.figure(1)
        for sim, fname in Experiment.runs:
            for conc in Experiment.conc:
                fname_conc = fname + '_c=' + str(conc)
                pth = os.path.join(Experiment.datafolder, fname_conc)
                record = SimulationRecord(pth, sim, 'r')
                recon = TimeReconstruction(record)
                data = recon.density_vs_time(len(record))
                pyplot.plot(data[0], data[1])
                # (ar,br)=polyfit(data[0],data[1],1)
                # slopes[i, j] = ar
                j += 1
            j = 0
            i += 1

        
        # length versus time
        pyplot.legend(('Processive', 'Non-processive', 'Detach'),
                      'upper left', shadow=True, fancybox=False)
        pyplot.xlabel('Time (s)')
        pyplot.ylabel('Filament length')
        pyplot.savefig(os.path.join(Experiment.datafolder, imgname))
        slope_fname = os.path.join(Experiment.datafolder, slopename)
        sp.savetxt(slopename, slopes)

        ''' slope vs concentration
        pyplot.figure(2)
        pyplot.plot(Experiment.conc, slopes[0])
        pyplot.plot(Experiment.conc, slopes[1])
        pyplot.plot(Experiment.conc, slopes[2])
        pyplot.legend(('Processive', 'Non-processive', 'Detach'),
                      'upper left', shadow=True, fancybox=False)
        pyplot.xscale('log')
        pyplot.xlabel('Concentration')
        pyplot.ylabel('Average Growth Rate')
        '''
        pyplot.show()