python - Gravitational Waveform Plot From h5 File -
i want plot waveform 2 black-hole mergersi have .h5 file got public waveform catalog. i kind of beginner using python don't know in situation. have .h5 file has .dat file inside want use make plot. got file public waveform catalog at:
http://www.black-holes.org/waveforms/data/displaydownloadpage.php/?id=sxs:bbh:0001#
the name of file :
rhoverm_asymptotic_geometricunits.h5
it in lev5 directory. contents of .h5 file described in:
https://www.black-holes.org/waveforms/docs.html
there dataset in file think describes waveform want plot. problem don't know how data set. have gotten far doing:
import numpy np import h5py pylab import plot,show f = h5.py.file("rhoverm_asymptotic_geometricunits.h5","r") ks = f.keys()
from here don't know how create x , y axis go plot function. assuming need attribute belongs h5py module, not sure if using right terminology. appreciated.
try this:
import matplotlib.pyplot plt import h5py f = h5py.file("rhoverm_asymptotic_geometricunits.h5", "r") data = f['extrapolated_n2.dir/y_l2_m-1.dat'] plt.plot(data[:, 0], data[:, 1], label='column1') plt.plot(data[:, 0], data[:, 2], label='column2') plt.legend() plt.show()
Comments
Post a Comment