def check_sweep(abf,sweep=None,dT=<NUM_LIT>):
if abf.APs is None:<EOL><INDENT>APs=[]<EOL><DEDENT>else:<EOL><INDENT>APs=cm.matrixToDicts(abf.APs)<EOL><DEDENT>if sweep is None or len(sweep)==<NUM_LIT:0>: <EOL><INDENT>for sweepNum in range(abf.sweeps):<EOL><INDENT>foundInThisSweep=<NUM_LIT:0><EOL>for AP in APs:<EOL><INDENT>if AP["<STR_LIT>"]==sweepNum:<EOL><INDENT>foundInThisSweep+=<NUM_LIT:1><EOL><DEDENT>if foundInThisSweep>=<NUM_LIT:5>:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>sweep=sweepNum<EOL><DEDENT>abf.setSweep(sweep)<EOL>Y=abf.dataY<EOL>dI = int(dT/<NUM_LIT:1000>*abf.rate) <EOL>dY = (Y[dI:]-Y[:-dI])*(abf.rate/<NUM_LIT:1000>/dI) <EOL>pylab.figure(figsize=(<NUM_LIT:12>,<NUM_LIT:6>))<EOL>ax=pylab.subplot(<NUM_LIT>)<EOL>pylab.title("<STR_LIT>"%abf.currentSweep)<EOL>pylab.ylabel("<STR_LIT>")<EOL>pylab.plot(Y,'<STR_LIT:->',alpha=<NUM_LIT>)<EOL>for AP in APs:<EOL><INDENT>if not AP["<STR_LIT>"]==sweep:<EOL><INDENT>continue<EOL><DEDENT>pylab.axvline(AP["<STR_LIT>"],alpha=<NUM_LIT>,color='<STR_LIT:r>')<EOL>pylab.plot(AP["<STR_LIT>"],AP["<STR_LIT>"],'<STR_LIT:.>',alpha=<NUM_LIT>,ms=<NUM_LIT:20>,color='<STR_LIT:r>')<EOL>pylab.plot(AP["<STR_LIT>"],AP["<STR_LIT>"],'<STR_LIT:.>',alpha=<NUM_LIT>,ms=<NUM_LIT:20>,color='<STR_LIT:c>')<EOL>pylab.plot([AP["<STR_LIT>"],AP["<STR_LIT>"]],<EOL>[AP["<STR_LIT>"],AP["<STR_LIT>"]],<EOL>'<STR_LIT:->',alpha=<NUM_LIT>,ms=<NUM_LIT:20>,color='<STR_LIT:b>',lw=<NUM_LIT:7>)<EOL>pylab.plot([AP["<STR_LIT>"],AP["<STR_LIT>"]],<EOL>[AP["<STR_LIT>"],AP["<STR_LIT>"]],<EOL>'<STR_LIT:->',lw=<NUM_LIT:5>,alpha=<NUM_LIT>,color='<STR_LIT:g>')<EOL><DEDENT>pylab.subplot(<NUM_LIT>,sharex=ax)<EOL>pylab.ylabel("<STR_LIT>")<EOL>pylab.xlabel("<STR_LIT>"%(abf.rate/<NUM_LIT:1000>))<EOL>pylab.plot(dY,'<STR_LIT:->',alpha=<NUM_LIT>)<EOL>pylab.margins(<NUM_LIT:0>,<NUM_LIT>)<EOL>for AP in APs:<EOL><INDENT>if not AP["<STR_LIT>"]==sweep:<EOL><INDENT>continue<EOL><DEDENT>pylab.axvline(AP["<STR_LIT>"],alpha=<NUM_LIT>,color='<STR_LIT:r>')<EOL>pylab.plot(AP["<STR_LIT>"],AP["<STR_LIT>"],'<STR_LIT:.>',alpha=<NUM_LIT>,ms=<NUM_LIT:20>,color='<STR_LIT:g>')<EOL>pylab.plot(AP["<STR_LIT>"],AP["<STR_LIT>"],'<STR_LIT:.>',alpha=<NUM_LIT>,ms=<NUM_LIT:20>,color='<STR_LIT:g>')<EOL>pylab.axis([APs[<NUM_LIT:0>]["<STR_LIT>"]-<NUM_LIT:1000>,APs[-<NUM_LIT:1>]["<STR_LIT>"]+<NUM_LIT:1000>,None,None])<EOL><DEDENT>
Plotting for an eyeball check of AP detection in the given sweep.