I am trying to read large oscilloscope .trc
files and plot them. Plotting one file works but as soon as I put the script into a loop, trying to plot all files (1 fi
It took quite some time but I managed to get the MemoryError
under control. Not only had I to put gc.collect()
at the end of each loop but also plt.close()
. Only then the Errors would stop. Sorry for the confusion. I learned a lot from this.
Oh, wow, I couldn't see the wood for the trees, as they say.
You're attempting to plot way too many data points (i.e. 100000002
, i think that's about 4km length of paper printed at 600dpi), which can be resolved either by sampling:
sampling=100
srx, sry = pd.Series(datX[::sampling] * 1000), pd.Series(datY[::sampling] * 1000)
or by selectively studying specific ranges:
srx, sry = pd.Series(datX[0:50000] * 1000), pd.Series(datY[0:50000] * 1000)
or a combination of both.