Skip to content

Commit

Permalink
waveform_residuals_px
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Jun 20, 2024
1 parent 7cd616b commit a841efd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
julia residuals_terms.jl
julia residuals_terms_px.jl
julia tau_vs_e.jl
#julia waveform_residuals_px.jl
julia waveform_residuals_px.jl
#python simulation_example.py
#python enterprise_example.py
cd ..
Expand Down
2 changes: 1 addition & 1 deletion examples/tau_vs_e.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ es = Eccentricity.(LinRange(0.01, 0.99, 1000))
τs = τ_from_e.(es)

fig = Figure()
ax = Axis(fig[1,1])
ax = Axis(fig[1, 1])
CairoMakie.lines!([τ.τ for τ in τs], [e.e for e in es])
ax.xlabel = "τ"
ax.ylabel = "e"
Expand Down
26 changes: 14 additions & 12 deletions examples/waveform_residuals_px.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Comparison of eccentric waveforms and residuals (+/x polarizations) for different eccentricities."""

using GWecc
using PyPlot
using CairoMakie

println("Running ", PROGRAM_FILE)

Expand All @@ -17,28 +17,30 @@ proj = ProjectionParams(1e-9, 0.0, 1.0, 0.0, 0.0)

ts = Time.(LinRange(0, 10 * year, 5000))

fig = CairoMakie.Figure()

for (idx, e_init) in enumerate(Eccentricity.([0.1, 0.4, 0.8]))
coeffs = EvolvCoeffs(mass, n_init, e_init)

hpxs = [waveform_px(mass, coeffs, l0p, proj, false, dt) for dt in ts]
hps = [hpx[1] for hpx in hpxs]
hxs = [hpx[2] for hpx in hpxs]

subplot(320 + 2 * idx - 1)
plot([t.t for t in ts] / year, hps)
plot([t.t for t in ts] / year, hxs)
ylabel("\$h_{+,\\times}\$")
xlabel("t (year)")
ax1 = CairoMakie.Axis(fig[idx, 1])
CairoMakie.lines!(ax1, [t.t for t in ts] / year, hps)
CairoMakie.lines!(ax1, [t.t for t in ts] / year, hxs)
ax1.ylabel = "h+, hx"
ax1.xlabel = "t (year)"

spxs = [residual_px(mass, coeffs, l0p, proj, false, dt) for dt in ts]
sps = [spx[1] for spx in spxs]
sxs = [spx[2] for spx in spxs]

subplot(320 + 2 * idx)
plot([t.t for t in ts] / year, sps)
plot([t.t for t in ts] / year, sxs)
ylabel("\$s_{+,\\times}\$")
xlabel("t (year)")
ax2 = CairoMakie.Axis(fig[idx, 2])
CairoMakie.lines!(ax2, [t.t for t in ts] / year, sps)
CairoMakie.lines!(ax2, [t.t for t in ts] / year, sxs)
ax2.ylabel = "s+, sx"
ax2.xlabel = "t (year)"
end

show()
save("waveform_residuals_px.pdf", fig)

0 comments on commit a841efd

Please sign in to comment.