I've got a simulation involving internal waves and moving particles in the water, using the MITgcm. The output of this looks something like this for each time step:
-9999 0.0000000000000000000 #Time step (0.00000000000000 seconds)
1308.2021183321899 -14.999709364517091 # Particle 1 (X,Z)
1308.2020142528656 -24.999521595698688 # Particle 2 (X,Z)
1308.2018600072618 -34.999345597877536 # .
1308.2016593336587 -44.999185870669805 # .
1308.2014165588744 -54.999046508237896 # .
1308.2011370083103 -64.998931076248894
1308.2008269116873 -74.998842490305705
1308.2004933548124 -84.998782925797485
1308.2001441978532 -94.998753764086956
1308.1997879652938 -104.99875557384759
1308.1994336881464 -114.99878812280582
1308.1990906721119 -124.99885041328211
1308.1987681881285 -134.99894073461562
1308.1984750963150 -144.99905672694641
1308.1982194336249 -154.99919545294702
1308.1980080134056 -164.99935347476733
1308.1978461242272 -174.99952693694112
1308.1977378137256 -184.99971163492469
1308.2000000000000 -195.00000000000000
5232.8000000000002 -15.000038916290352
5232.8000000000002 -25.000064153684303
5232.8000000000002 -35.000089286157163
5232.8000000000002 -45.000114270293523
5232.8000000000002 -55.000139061712051 # Particle 57
Where -9999 #number is the time step (in seconds), left column is X position and right column is Z position (in meters); and every line is a different particle (except the -9999 one). So we'll have an enormous amount of lines with something like this for every time step and every particle.
I would like to plot the time-evolution of the position of my particles. How can I do it? If that's too hard, I would be happy with static plots of different time-steps with all particles position.
Thank you so much.
Edit1: What I tried to do is this, but I didn't show it before because it is far from proper:
from matplotlib import numpy
import matplotlib.pyplot as plot
plot.plot(*np.loadtxt('data.dat',unpack=True), linewidth=2.0)
or this:
plot.plotfile('data.dat', delimiter=' ', cols=(0, 1), names=('col1', 'col2'), marker='o')




numpy.loadtxtto read in all of your data (if it fits in memory), then do the post-processing. Since the number of particles is probably fixed, this shouldn't be too difficult. You should filter out the lines for time points, thenreshapethe rest into 57-element blocks.