ripy Basic ExampleΒΆ

Download this example

This example collects and plots data from the DPD80.

In [2]:
%pylab inline
from ripy import Device
Populating the interactive namespace from numpy and matplotlib
In [3]:
# Opens a ripy device that is connected to your computer
d = Device()
# To open a specific device, with your device's serial number.
#d = Device(serial="XXXX-XXXX-XX")
In [4]:
# Turn on high gain mode and the antialiasing filter
d.highgain = True
d.antialias = True
In [8]:
nsamples = int(1e5)
# use the built-in calibration to calibrate the samples to uW
# at the device's peak responsivity
data_uW = d.get_calibrated_data(nsamples)
In [9]:
time_ms = arange(nsamples) / d.samplerate

figure(figsize = (6,4))
plot(time_ms, data_uW, linewidth = 0.1)
xlabel("Time (mS)")
ylabel("Power ($\mu$W)")
xlim(time_ms[0], time_ms[-1])
tight_layout()
_images/ripy-basic-example_5_0.png

Download this example