@@ -0,0 +1,1772 @@
+import numpy as np%0Aimport matplotlib.pyplot as plt%0Aimport matplotlib.animation as anim%0Afrom mpl_toolkits.mplot3d import Axes3D%0Aimport sys%0A%0Aimport numpy.ma as ma%0A%0A%0Ai=0%0Afuz = 1;%0AminLength = 500.0%0Aif (len(sys.argv) %3C 2) :%0A%09print(%22Usage: %5Cn dataplot.py path_to_binfile %5Bclamp value%5D%22)%0A%09sys.exit()%0Aelif (len(sys.argv) %3E 2) :%0A%09fuz = float(sys.argv%5B2%5D)%0Abinfile = sys.argv%5B1%5D%0Alengthdata=np.fromfile(binfile+str(i)+'_lengths.bin', dtype=%22float32%22)%0Awinddata=np.fromfile(binfile+str(i)+'_windings.bin', dtype=%22float32%22)%0Adatasize = int(np.sqrt(lengthdata.shape%5B0%5D))%0Alengthdata=lengthdata.reshape(datasize, datasize)%0Awinddata=winddata.reshape(datasize, datasize)%0Amasked= ma.masked_where(lengthdata%3CminLength,winddata)%0AclampVal = np.mean(masked)%0Adev = ma.std(masked)%0Afig = plt.figure()%0Aimg = plt.imshow(masked.filled(0), clim=((1-dev*fuz)*clampVal,(1+dev*fuz)*clampVal), animated=True)%0Aimg.set_cmap('hot')%0Aplt.colorbar()%0Aims = %5B%5D%0Afor i in range(149) :%0A    lengthdata=np.fromfile(binfile+str(i)+'_lengths.bin', dtype=%22float32%22)%0A    winddata=np.fromfile(binfile+str(i)+'_windings.bin', dtype=%22float32%22)%0A    lengthdata=lengthdata.reshape(datasize, datasize)%0A    winddata=winddata.reshape(datasize, datasize)%0A    masked= ma.masked_where(lengthdata%3CminLength,winddata)%0A    clampVal = np.mean(masked)%0A    dev = ma.std(masked)%0A    img = plt.imshow(masked.filled(0), %0A            clim=%5B(1-np.sign(clampVal)*dev*fuz)*clampVal,(1+np.sign(clampVal)*dev*fuz)*clampVal%5D,%0A            animated=True, %0A            cmap='hot')%0A#    img = plt.imshow(masked.filled(0), clim=(-1,0), animated=True, cmap='hot')%0A    ims.append(%5Bimg%5D)%0A%0Aani = anim.ArtistAnimation(fig, ims, interval=100, blit=True, repeat_delay=1000)%0Aani.save('animation.mp4')%0Aplt.show()%0A# plt.savefig(sys.argv%5B1%5D.rsplit(%22.%22,1)%5B0%5D+'_fig.png')%0A

Create a animated figure from a series of data