MemoryError while plotting large oscilloscope files on Ubuntu

后端 未结 2 1366
广开言路
广开言路 2021-01-25 12:42

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

2条回答
  •  日久生厌
    2021-01-25 13:17

    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.

提交回复
热议问题