def proto_avgRange(theABF,m1=None,m2=None):
abf=ABF(theABF)<EOL>abf.log.info("<STR_LIT>")<EOL>if m1 is None:<EOL><INDENT>m1=abf.sweepLength<EOL><DEDENT>if m2 is None:<EOL><INDENT>m2=abf.sweepLength<EOL><DEDENT>I1=int(abf.pointsPerSec*m1)<EOL>I2=int(abf.pointsPerSec*m2)<EOL>Ts=np.arange(abf.sweeps)*abf.sweepInterval<EOL>Yav=np.empty(abf.sweeps)*np.nan <EOL>Ysd=np.empty(abf.sweeps)*np.nan <EOL>for sweep in abf.setsweeps():<EOL><INDENT>Yav[sweep]=np.average(abf.sweepY[I1:I2])<EOL>Ysd[sweep]=np.std(abf.sweepY[I1:I2])<EOL><DEDENT>plot=ABFplot(abf)<EOL>plt.figure(figsize=(SQUARESIZE*<NUM_LIT:2>,SQUARESIZE/<NUM_LIT:2>))<EOL>plt.subplot(<NUM_LIT>)<EOL>plot.title="<STR_LIT>"<EOL>plot.figure_sweep(<NUM_LIT:0>)<EOL>plt.title("<STR_LIT>")<EOL>plt.axvspan(m1,m2,color='<STR_LIT:r>',ec=None,alpha=<NUM_LIT>)<EOL>plt.subplot(<NUM_LIT>)<EOL>plt.grid(alpha=<NUM_LIT>)<EOL>for i,t in enumerate(abf.comment_times):<EOL><INDENT>plt.axvline(t/<NUM_LIT>,color='<STR_LIT:r>',alpha=<NUM_LIT>,lw=<NUM_LIT:2>,ls='<STR_LIT>')<EOL><DEDENT>plt.plot(Ts/<NUM_LIT>,Yav,'<STR_LIT:.>',alpha=<NUM_LIT>)<EOL>plt.title("<STR_LIT>"%("<STR_LIT:U+002CU+0020>".join(abf.comment_tags)))<EOL>plt.ylabel(abf.units2)<EOL>plt.xlabel("<STR_LIT>")<EOL>plt.margins(<NUM_LIT:0>,<NUM_LIT>)<EOL>plt.subplot(<NUM_LIT>)<EOL>plt.grid(alpha=<NUM_LIT>)<EOL>for i,t in enumerate(abf.comment_times):<EOL><INDENT>plt.axvline(t/<NUM_LIT>,color='<STR_LIT:r>',alpha=<NUM_LIT>,lw=<NUM_LIT:2>,ls='<STR_LIT>')<EOL><DEDENT>plt.plot(Ts/<NUM_LIT>,Ysd,'<STR_LIT:.>',alpha=<NUM_LIT>,color='<STR_LIT:g>',ms=<NUM_LIT:15>,mew=<NUM_LIT:0>)<EOL>plt.title("<STR_LIT>"%("<STR_LIT:U+002CU+0020>".join(abf.comment_tags)))<EOL>plt.ylabel(abf.units2)<EOL>plt.xlabel("<STR_LIT>")<EOL>plt.margins(<NUM_LIT:0>,<NUM_LIT>)<EOL>plt.axis([None,None,<NUM_LIT:0>,np.percentile(Ysd,<NUM_LIT>)*<NUM_LIT>])<EOL>plt.tight_layout()<EOL>frameAndSave(abf,"<STR_LIT>","<STR_LIT>")<EOL>plt.close('<STR_LIT:all>')<EOL>
experiment: generic VC time course experiment.