def processAbf(abfFname,saveAs=False,dpi=<NUM_LIT:100>,show=True):
if not type(abfFname) is str or not len(abfFname)><NUM_LIT:3>:<EOL><INDENT>return<EOL><DEDENT>abf=swhlab.ABF(abfFname)<EOL>plot=swhlab.plotting.ABFplot(abf)<EOL>plot.figure_height=<NUM_LIT:6><EOL>plot.figure_width=<NUM_LIT:10><EOL>plot.subplot=False<EOL>plot.figure(True)<EOL>if abf.get_protocol_sequence(<NUM_LIT:0>)==abf.get_protocol_sequence(<NUM_LIT:1>) or abf.sweeps<<NUM_LIT:2>:<EOL><INDENT>if abf.lengthMinutes<<NUM_LIT:2>:<EOL><INDENT>ax1=plt.subplot(<NUM_LIT>)<EOL>plot.figure_sweeps()<EOL>plt.title("<STR_LIT>".format(abf.ID,abf.sweeps))<EOL>plt.gca().get_xaxis().set_visible(False)<EOL>plt.subplot(<NUM_LIT>,sharex=ax1)<EOL>plot.figure_protocol()<EOL>plt.title("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>plot.figure_chronological()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>plots=[<NUM_LIT>,<NUM_LIT>] <EOL>if abf.units=='<STR_LIT>': <EOL><INDENT>ap=swhlab.AP(abf) <EOL>ap.detect() <EOL>if len(ap.APs): <EOL><INDENT>plots=[<NUM_LIT>,<NUM_LIT>,<NUM_LIT>,<NUM_LIT>] <EOL><DEDENT><DEDENT>ax1=plt.subplot(plots[<NUM_LIT:0>])<EOL>plot.figure_sweeps()<EOL>plt.title("<STR_LIT>".format(abf.ID,abf.sweeps))<EOL>plt.gca().get_xaxis().set_visible(False)<EOL>plt.subplot(plots[<NUM_LIT:1>],sharex=ax1)<EOL>plot.figure_protocols()<EOL>plt.title("<STR_LIT>")<EOL>if len(plots)><NUM_LIT:2>:<EOL><INDENT>ax2=plt.subplot(plots[<NUM_LIT:2>])<EOL>plot.rainbow=False<EOL>plot.kwargs["<STR_LIT>"]='<STR_LIT:b>'<EOL>plot.figure_chronological()<EOL>plt.gca().get_xaxis().set_visible(False)<EOL>plt.title("<STR_LIT>")<EOL>plt.subplot(plots[<NUM_LIT:3>],sharex=ax2)<EOL>plot.abf.derivative=True<EOL>plot.rainbow=False<EOL>plot.traceColor='<STR_LIT:r>'<EOL>plot.figure_chronological()<EOL>plt.axis([ap.APs[<NUM_LIT:0>]["<STR_LIT:T>"]-<NUM_LIT>,ap.APs[<NUM_LIT:0>]["<STR_LIT:T>"]+<NUM_LIT>,None,None])<EOL>plt.title("<STR_LIT>")<EOL><DEDENT><DEDENT>if saveAs:<EOL><INDENT>print("<STR_LIT>",os.path.abspath(saveAs))<EOL>plt.savefig(os.path.abspath(saveAs),dpi=dpi)<EOL>return<EOL><DEDENT>if show:<EOL><INDENT>plot.show()<EOL><DEDENT>
automatically generate a single representative image for an ABF.
If saveAs is given (full path of a jpg of png file), the image will be saved.
Otherwise, the image will pop up in a matplotlib window.