def edot(fname="Fluxes.dat"): import bbh_processing.ffile_tools as ff T = ff.t(fname) Edot = ff.de_dt(fname) the_plot = plt.plot(T, Edot) plt.xlabel("Time(M)") plt.ylabel("Edot") plt.title("Flux") return the_plot
def make_edot_vs_omega(path): fluxpath = path + "/Fluxes.dat" ft = ffile.t(fluxpath) edot = ffile.de_dt(fluxpath) omegapath = path + "/Omega.pkl" with open(omegapath) as f: Omega, OmegaMag = pickle.load(f) edotspline = interp.UnivariateSpline(ft, edot, k=3, s=0) edotinterp = edotspline(OmegaMag[:, 0]) return OmegaMag, edotinterp
def p(fname="Fluxes.dat"): import bbh_processing.utilities as bbh import bbh_processing.ffile_tools as ff T = ff.t(fname) P = ff.p(fname) P_mag = la.norm(P, axis=1) lab = ['P_x', 'P_y', 'P_z', '|P|'] the_plot = plt.plot(T, P, T, P_mag) plt.legend(lab, loc='upper left', fontsize=8) plt.xlabel("Time(M)") plt.ylabel("P") plt.title("P in simulation coordinates") return the_plot
def j(fname="Fluxes.dat"): import bbh_processing.utilities as bbh import bbh_processing.ffile_tools as ff T = ff.t(fname) J = ff.j(fname) J_mag = la.norm(J, axis=1) lab = ['J_x', 'J_y', 'J_z', '|J|'] the_plot = plt.plot(T, J, T, J_mag) plt.legend(lab, loc='upper left', fontsize=8) plt.xlabel("Time(M)") plt.ylabel("J") plt.title("J in simulation coordinates") return the_plot
def p_on_s(hname="Horizons.h5", fname="Fluxes.dat", equatorial=False): import bbh_processing.utilities as bbh import bbh_processing.ffile_tools as ff import bbh_processing.hfile_tools as hf t = hf.t(hname) S = hf.chi_inertial(hname) T = ff.t(fname) P = bbh.interp_onto(ff.p(fname), T, t, 'slinear') P_S = bbh.projected_onto(P, S) P_S_mag = la.norm(P_S, axis=1) lab = ['x', 'y', 'z', 'mag'] if equatorial: lab = ['x', 'y', 'mag'] the_plot = plt.plot(t, P_S, t, P_S_mag) plt.legend(lab, loc='upper left', fontsize=8) plt.xlabel("Time(M)") plt.ylabel("P") plt.title("P projected onto S") return the_plot