Z JUPYTET PydataParis tas crecieins 20 mises s v cranges)
Fle Edt View Inen Cel Kemel Hep
B+ > @B 4 v W EC e . CeirTooibar
In [13]: [# Tmport StringIo as we need to manipulate file object at waverile.read
from StringIo import Stringio
# Load the file from erps as string, which is not good here
# we will later try to improve this because this is mot out-of-core
fs, data = read(StringIo(context.data_stream module[*1*].getpata()))
# Get only channel
array = data.T[6] # not out of core
# Save the array to erps to make it out-of-core
out_of_core_array = context.data_array_sodule.newcontent (
array=array,
portal_type="pata Array”
title="pydata-wav")
cmplx = Fft(out of core array.getarray())
Spectrum = abs(empIxl: (len(cmpix)/2)-11) # not out of core
# Save the spectrum array to make it now out of core
out_of_core_spectrum_array = context.data_array_module.newcontent (
array=spectrum,
portal_type="bata Array”
title="pydata-spectrun’)
figure = pit.figure()
ax1 = figure.add_subplot(211)
ax2 = figure.add_subplot (212)
ax1.plot (out_of_core_array.getarray())
‘ax2_plot (out of core_spectrum_array.getArray())
# figure.show() don't present inline rendering.
# So we use instea
context .Base_renderAsHtal(plt)
40000
30000
oo RN TR T TR T Y
®s5 0