#!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.animation as animation import scipy as sp sp.seterr(divide='ignore', invalid='ignore') def mean(old, new, alpha): return new if sp.isnan(old) else ( 1.0 - alpha ) * old + alpha * new W = 0.1 def weight(d): return ( 1 - (d/W) ** 2 ) ** 2 if abs(d/W) < 1 else 0 def plot(fig): a = sp.array([sp.nan]) b = sp