In [36]:
import mpld3
mpld3.enable_notebook()
import odmanalysis as odm
from IPython.html.widgets import interact, interactive, fixed
from IPython.html import widgets
from IPython.display import clear_output, display, HTML

In [2]:
df = odm.readAnalysisData('./2014-08-21 14.07.05 Scripted Optical Displacement Measurement/odmanalysis.csv')

In [19]:
df['displacement_nm'] = df.displacement * 165.0

In [50]:
def plotSingleCycle(df,cycleNumber):
    fwd = df[(df.direction == 'forward') & (df.cycleNumber == cycleNumber)]
    bwd = df[(df.direction == 'backward') & (df.cycleNumber == cycleNumber)]
    
    ax = plt.subplot()
    
    ax.plot(fwd.actuatorVoltage,fwd.displacement_nm)
    ax.plot(bwd.actuatorVoltage,bwd.displacement_nm)
    
    ax.set_xlim(71,71.6)
    ax.set_ylim(-400,-350)
    
    ax.set_xlabel('Actuator Voltage (V)')
    ax.set_ylabel('Displacement (nm)')
    ax.set_title('cycle %i' % cycleNumber)

In [51]:
interact(lambda cycleNumber: plotSingleCycle(df,cycleNumber), cycleNumber=[1,30])



In [ ]: