#filenames = ['/Volumes/backup/2017/Michael/Axopatch/20170512/10mMKClInFlowCellORingPore1mm.dat'] #filenames = ['/Volumes/backup/2017/Michael/Axopatch/20170512/bmimpf6lInFlowCellORingPore1mm.dat'] expname = 'Gradient' filenames = askopenfilenames( ) # show an "Open" dialog box and return the path to the selected file for filename in filenames: print(filename) #Make Dir to save images output = uf.OpenFile(filename) directory = (str(os.path.split(filename)[0]) + os.sep + expname + '_SavedImages') if not os.path.exists(directory): os.makedirs(directory) AllData = uf.MakeIVData(output, delay=2) if AllData == 0: print('!!!! No Sweep in: ' + filename) continue #Plot Considered Part #figExtracteParts = plt.figure(1) #ax1 = figExtracteParts.add_subplot(211) #ax2 = figExtracteParts.add_subplot(212, sharex=ax1) #(ax1, ax2) = uf.PlotExtractedPart(output, AllData, current = 'i1', unit=1e9, axis = ax1, axis2=ax2) #figExtracteParts.savefig(directory + os.sep + 'PlotExtracted_' + str(os.path.split(filename)[1])[:-4] + '.eps') #figExtracteParts.savefig(directory + os.sep + 'PlotExtracted_' + str(os.path.split(filename)[1])[:-4] + '.png', dpi=150) # Plot IV if output['graphene']: figIV2 = plt.figure(3)
from tkinter.filedialog import askopenfilenames from matplotlib.font_manager import FontProperties fontP = FontProperties() fontP.set_size('small') Tk().withdraw() os.system( '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "python" to true' ''' ) expname = 'Gradient' filename = '/Users/migraf/Desktop/Roche meetings/30B_1MKCl_AxoIV_FemtoOff_1.dat' output = uf.OpenFile(filename) directory = (str(os.path.split(filename)[0]) + os.sep + expname + '_SavedImages') AllData = uf.MakeIVData(output, delay=0.642) # Plot all the Fits time = np.arange(len(output['i1'])) / output['samplerate'] fig1, ax = plt.subplots(1) ax.plot(time, output['i1']) ax2 = ax.twinx() ax2.plot(time, output['v1'], 'y') ch = 'i1' #Loop through the parts for idx, val in enumerate(AllData[ch]['StartPoint']): timepart = np.arange(AllData[ch]['EndPoint'][idx] - val) / output['samplerate'] ax.plot( val / output['samplerate'] + timepart, uf.ExpFunc(timepart, AllData[ch]['ExponentialFitValues'][0][idx],