This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class RingBuffer(np.ndarray): | |
'A multidimensional ring buffer.' | |
def __new__(cls, input_array): | |
obj = np.asarray(input_array).view(cls) | |
return obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylab import * | |
from scipy.ndimage import measurements | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import time | |
import sys | |
import signal | |
def signal_handler(signal, frame): | |
sys.exit(0) |