def analyzeAPgroup(abf=exampleABF,T1=None,T2=None,plotToo=False):
if T1 is None or T2 is None:<EOL><INDENT>if len(abf.protoSeqX)><NUM_LIT:2>:<EOL><INDENT>T1=abf.protoSeqX[<NUM_LIT:1>]/abf.rate<EOL>T2=abf.protoSeqX[<NUM_LIT:2>]/abf.rate<EOL><DEDENT>else:<EOL><INDENT>T1=<NUM_LIT:0><EOL>T2=abf.sweepLength<EOL><DEDENT><DEDENT>s={} <EOL>s["<STR_LIT>"]=abf.currentSweep<EOL>s["<STR_LIT>"]=abf.protoSeqY[<NUM_LIT:1>]<EOL>APs=[]<EOL>for key in ['<STR_LIT>','<STR_LIT>']:<EOL><INDENT>s[key]=<NUM_LIT:0><EOL><DEDENT>for AP in abf.APs[abf.currentSweep]:<EOL><INDENT>if T1<AP["<STR_LIT>"]<T2:<EOL><INDENT>APs.append(AP)<EOL><DEDENT><DEDENT>s["<STR_LIT>"]=len(APs) <EOL>apTimes=cm.dictVals(APs,'<STR_LIT>')<EOL>if len(APs)><NUM_LIT:1>: <EOL><INDENT>s["<STR_LIT>"]=np.average(apTimes)-T1 <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/(T2-T1)*<NUM_LIT:100> <EOL>s["<STR_LIT>"]=np.average(apTimes)-APs[<NUM_LIT:0>]["<STR_LIT>"] <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/(APs[-<NUM_LIT:1>]["<STR_LIT>"]-APs[<NUM_LIT:0>]["<STR_LIT>"])*<NUM_LIT:100> <EOL>s["<STR_LIT>"]=(APs[<NUM_LIT:0>]["<STR_LIT>"]-T1)*<NUM_LIT:1000> <EOL>s["<STR_LIT>"]=APs[<NUM_LIT:1>]['<STR_LIT>'] <EOL>s["<STR_LIT>"]=cm.dictAvg(APs[<NUM_LIT:1>:<NUM_LIT:6>],'<STR_LIT>')[<NUM_LIT:0>] <EOL>s["<STR_LIT>"]=APs[-<NUM_LIT:1>]['<STR_LIT>'] <EOL>s["<STR_LIT>"]=cm.dictAvg(APs,'<STR_LIT>')[<NUM_LIT:0>] <EOL>s["<STR_LIT>"]=len(APs)/(T2-T1) <EOL>s["<STR_LIT>"]=cm.dictAvg(APs[-int(len(APs)*<NUM_LIT>):],'<STR_LIT>')[<NUM_LIT:0>] <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/s["<STR_LIT>"] <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/s["<STR_LIT>"] <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/s["<STR_LIT>"] <EOL>s["<STR_LIT>"]=s["<STR_LIT>"]/s["<STR_LIT>"] <EOL>s["<STR_LIT>"]=cm.dictAvg(APs,'<STR_LIT>')[<NUM_LIT:1>]/cm.dictAvg(APs,'<STR_LIT>')[<NUM_LIT:0>] <EOL>s["<STR_LIT>"]=T1<EOL>s["<STR_LIT>"]=T2<EOL><DEDENT>abf.SAP[abf.currentSweep]=s<EOL>
On the current (setSweep()) sweep, calculate things like accomodation.
Only call directly just for demonstrating how it works by making a graph.
Or call this if you want really custom T1 and T2 (multiple per sweep)
  This is called by default with default T1 and T2.
  Manually call it again for custom.