3 import matplotlib.pyplot
as plt
10 (1) transverse intergated entropy/density as function of rapidity
11 (2) Projection of entropy/density onto x-y (eta=0) plane
12 (3) ............................. onto y-eta (x=0) plane.
13 (4) ............................. onto x-eta (y=0) plane.
16 {:s} trento3d-hdf5-output [list-of-event-id-to-convert]
18 For example, to view all events:
20 To view only events #2 and #3:
23 print(help.__doc__.format(__file__, __file__, __file__))
26 fig, axes = plt.subplots(
32 Nx, Ny, Neta = field.shape
33 deta = dataset.attrs[
'deta']
34 dxy = dataset.attrs[
'dxy']
35 Lx, Ly, Leta = Nx*dxy/2., Ny*dxy/2., (Neta-1)*deta/2.
36 x = np.linspace(-Lx, Lx, Nx)
37 y = np.linspace(-Ly, Ly, Ny)
38 eta = np.linspace(-Leta, Leta, Neta)
39 ax.plot(eta, np.sum(field, axis=(0,1))*dxy*dxy)
40 ax.set_xlabel(
r'$\eta$')
41 ax.set_ylabel(
r'$dS/d\eta$')
42 ax.set_title(
'Tranverse integrated entropy')
43 Nxmid, Nymid, Netamid = int((Nx-1)/2), int((Ny-1)/2), int((Neta-1)/2)
44 for ax, projection, ranges, xlabel, ylabel, title
in zip(
46 [field[:,:,Netamid], field[Nxmid,:,:], field[:,Nymid,:]],
47 [[-Lx, Lx, -Ly, Ly], [-Ly, Ly, -Leta, Leta], [-Lx, Lx, -Leta, Leta]],
48 [
r'$y$ [fm]',
r'$\eta$',
r'$\eta$'],
49 [
r'$x$ [fm]',
r'$y$ [fm]',
r'$x$ [fm]'],
50 [
r'$x$-$y$ projection, $\eta=0$',
r'$y$-$\eta$ projection, $x=0$',
51 r'$x$-$\eta$ projection, $y=0$']
53 ax.contourf(projection, extent=ranges)
58 plt.subplots_adjust(wspace=0.4, hspace=0.4)
62 if len(sys.argv) <= 1:
65 f = h5py.File(sys.argv[1],
'r')
66 elist = ['event_{}'.
format(index)
for index
in sys.argv[2:]] \
67 if len(sys.argv)>=3
else list(f.keys())
71 if __name__ ==
'__main__':