In [1]:
%matplotlib inline
In [2]:
import sys
sys.dont_write_bytecode = True
import seaborn as sns
sns.set(style="whitegrid", color_codes=True, font_scale=1.3)
from ggplot import *
from dataMethods import *
from testRuns import *
import pandas as pd
import matplotlib.pyplot as plt
In [3]:
dataColumns = ['lHR', 'rHR', 'wHR', 'lK', 'rK', 'wK', 'lfaR', 'rfaR', 'wfaR', 'lHitRT', 'rHitRT', 'wHitRT', 'lFaRT'
, 'rFaRT', 'wFaRT', 'ldP', 'rdP', 'wdP', 'lCrit', 'rCrit', 'wCrit']
In [4]:
def createDF(testRuns):
data = pd.DataFrame()
i = 0
for (s,r) in testRuns:
stats = extractPerformance(s,r,'behav6')
leftHRs = stats['lHRs']
rightHRs = stats['rHRs']
wholeHRs = stats['wHRs']
leftKs = stats['lKs']
rightKs = stats['rKs']
wholeKs = stats['wKs']
leftfaRates = stats['lfaRates']
rightfaRates = stats['rfaRates']
wholefaRates = stats['wfaRates']
leftHitRTs = stats['lHitRTs']
rightHitRTs = stats['rHitRTs']
wholeHitRTs = stats['wHitRTs']
leftFaRTs = stats['lFaRTs']
rightFaRTs = stats['rFaRTs']
wholeFaRTs = stats['wFaRTs']
leftdPs = stats['ldPs']
rightdPs = stats['rdPs']
wholedPs = stats['wdPs']
leftCrits = stats['lCrits']
rightCrits = stats['rCrits']
wholeCrits = stats['wCrits']
for key in HFconds:
row = pd.Series([leftHRs[key],rightHRs[key], wholeHRs[key], leftKs[key], rightKs[key],
wholeKs[key], leftfaRates[key], rightfaRates[key], wholefaRates[key],
leftHitRTs[key], rightHitRTs[key], wholeHitRTs[key], leftFaRTs[key],
rightFaRTs[key], wholeFaRTs[key], leftdPs[key], rightdPs[key],
wholedPs[key], leftCrits[key], rightCrits[key], wholeCrits[key]],
name = str(i), index=dataColumns)
row['targs'] = str(HFconds[key][0])
row['dists'] = str(HFconds[key][1])
row['subj'] = int(s)
row['run'] = int(r)
data = data.append(row)
i += 1
return data
In [5]:
pilotData = createDF(pilotTestRuns)
In [6]:
pilotData['rK']
Out[6]:
In [7]:
pilotData['lHR']
Out[7]:
In [8]:
pilotData['rHR']
Out[8]:
In [9]:
pilotData['lfaR']
Out[9]:
In [10]:
pilotData['rfaR']
Out[10]:
In [11]:
pilotData
Out[11]:
In [12]:
pilotWKPlot = sns.factorplot(data=pilotData,x='dists',y='wK',hue='targs')
pilotWKPlot.fig.suptitle('whole-K under pilot')
pilotWKPlot.set_axis_labels('dists', 'K')
pilotWKPlot.fig.subplots_adjust(top=.9)
plt.ylim(0, 2)
Out[12]:
In [13]:
pilotLKPlot = sns.factorplot(data=pilotData,x='dists',y='lK',hue='targs')
pilotLKPlot.fig.suptitle('left-K under pilot')
pilotLKPlot.set_axis_labels('dists', 'K')
pilotLKPlot.fig.subplots_adjust(top=.9)
plt.ylim(0, 2)
Out[13]:
In [14]:
pilotRKPlot = sns.factorplot(data=pilotData,x='dists',y='rK',hue='targs')
pilotRKPlot.fig.suptitle('right-K under pilot')
pilotRKPlot.set_axis_labels('dists', 'K')
pilotRKPlot.fig.subplots_adjust(top=.9)
plt.ylim(0, 2)
Out[14]:
In [15]:
pilotWdPPlot = sns.factorplot(data=pilotData,x='dists',y='wdP',hue='targs')
pilotWdPPlot.fig.suptitle('whole-dP under pilot')
pilotWdPPlot.set_axis_labels('dists', 'dP')
pilotWdPPlot.fig.subplots_adjust(top=.9)
plt.ylim(0.5, 3.5)
Out[15]:
In [16]:
pilotLdPPlot = sns.factorplot(data=pilotData,x='dists',y='ldP',hue='targs')
pilotLdPPlot.fig.suptitle('left-dP under pilot')
pilotLdPPlot.set_axis_labels('dists', 'dP')
pilotLdPPlot.fig.subplots_adjust(top=.9)
plt.ylim(0, 3.5)
Out[16]:
In [17]:
pilotRdPPlot = sns.factorplot(data=pilotData,x='dists',y='rdP',hue='targs')
pilotRdPPlot.fig.suptitle('right-dP under pilot')
pilotRdPPlot.set_axis_labels('dists', 'dP')
pilotRdPPlot.fig.subplots_adjust(top=.9)
plt.ylim(0, 3.5)
Out[17]:
In [ ]: