Skip to content

Commit

Permalink
Merge pull request #6 from thomasckng/thomas-edit
Browse files Browse the repository at this point in the history
Sync after Journal Review
  • Loading branch information
thomasckng authored Oct 6, 2023
2 parents a936fff + c838cab commit cd7bba2
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Paper repository for _Constraining gravitational wave amplitude birefringence with GWTC-3_ by Ng, Isi, Wong & Farr (2023).

The paper can be reproduced programmatically from this repo using [_showyourwork_](http://show-your.work). Scripts to produce figures and tables can be found in [src/scripts](src/scripts), and data in [zenodo](https://zenodo.org/record/7935107).
The paper can be reproduced programmatically from this repo using [_showyourwork_](http://show-your.work). Scripts to produce figures and tables can be found in [src/scripts](src/scripts), and data in [Zenodo](https://zenodo.org/record/7935107).

<p align="center">
<a href="https://github.com/showyourwork/showyourwork">
Expand Down
1 change: 1 addition & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rule compute_kappa_constraint_restricted:
"src/tex/output/improvement_Okounkova.txt",
"src/tex/output/restricted_absolute_kappa_90.txt",
"src/tex/output/kappa_Wang.txt",
"src/tex/output/kappa_Zhu.txt",
"src/tex/output/comparison_summary.txt"
script:
"src/scripts/kappa_constraint_restricted.py"
Expand Down
17 changes: 16 additions & 1 deletion showyourwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,26 @@ dependencies:
- src/data/GW191105_143521_GR.json.gz
- src/data/samples_posterior_birefringence.feather

src/scripts/posterior_MPV.py:
- src/data/samples_posterior_birefringence.feather

src/tex/ms.tex:
- src/tex/output/mu_median.txt
- src/tex/output/sigma_median.txt
- src/tex/output/restricted_kappa_median.txt
- src/tex/output/generic_kappa_median.txt
- src/tex/output/M_PV_constraint.txt
- src/tex/output/restricted_kappa_median.txt
- src/tex/output/CL_kappa_0.txt
- src/tex/output/restricted_absolute_kappa_68.txt
- src/tex/output/improvement_Okounkova.txt
- src/tex/output/restricted_absolute_kappa_90.txt
- src/tex/output/kappa_Wang.txt
- src/tex/output/kappa_Zhu.txt
- src/tex/output/comparison_summary.txt
- src/tex/output/best_events_kappa.txt
- src/tex/output/GW170818_constraint.txt
- src/tex/output/GW200129_constraint.txt
- src/tex/output/bimodal_events_mass.txt
- src/tex/bib.bib

datasets:
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/birefringence.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# frequency array parameters
df = 0.125
f_min = 20
f_max = 2048
f_max = 2048*16 # using higher frequency to produce smoother TD waveform
f_ref = 100

# source parameters
Expand Down Expand Up @@ -81,7 +81,7 @@
axs[0].loglog(freq, np.abs(hr_fd), ls=':', c=c2, label=r"R (GR)")
axs[0].loglog(freq, np.abs(hl_bi_fd), c=c1, label=r"L (BR)")
axs[0].loglog(freq, np.abs(hr_bi_fd), c=c2, label=r"R (BR)")
axs[0].set_xlim(f_min+1,f_max-22)
axs[0].set_xlim(f_min+1,2048-22) # force x_max to the max value for IMRPhenomD
axs[0].set_ylim(1e-30,1e-20)
axs[0].legend()
axs[0].set_ylabel(r"$|\tilde{h}|$")
Expand Down
8 changes: 5 additions & 3 deletions src/scripts/kappa_constraint_restricted.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import numpy as np
import pandas as pd
from bilby.gw.cosmology import get_cosmology
import scipy
import paths

# constants
h = 4.135667696e-15 # eV s
c = 299792.458 # km/s
H_0 = 68.3 # km/s/Mpc
H_0 = get_cosmology().H0.value # km/s/Mpc

result_dict = {}
result_DataFrame = pd.read_feather(paths.data/"samples_posterior_birefringence.feather")
Expand Down Expand Up @@ -49,13 +50,12 @@
with open(paths.output/"restricted_absolute_kappa_90.txt", "w") as f:
f.write(f"$|\kappa| < {restricted_absolute_kappa_90:.2f} \\, \\mathrm{{Gpc}}^{{-1}}$")

# Wang's constraint in kappa
# Constraint comparison
M_PV_Wang = 1e-22 # GeV
kappa_Wang = (h*np.pi*H_0/c)*(1e3)*(100)*np.reciprocal(M_PV_Wang*1e9)
with open(paths.output/"kappa_Wang.txt", "w") as f:
f.write(f"$|\kappa| \lesssim {kappa_Wang:.2f} \, \mathrm{{Gpc}}^{{-1}}$")

# Constraint comparison
kappa_Okounkova = 0.74
M_PV_Okounkova = (h*np.pi*H_0/c)*(1e3)*(100)*np.reciprocal(kappa_Okounkova)/1e9

Expand All @@ -64,6 +64,8 @@

M_PV_Zhu = 4.1e-22 # GeV
kappa_Zhu = (h*np.pi*H_0/c)*(1e3)*(100)*np.reciprocal(M_PV_Zhu*1e9)
with open(paths.output/"kappa_Zhu.txt", "w") as f:
f.write(f"$|\kappa| \lesssim {kappa_Zhu:.2f} \, \mathrm{{Gpc}}^{{-1}}$")

with open(paths.output/"M_PV_constraint.txt", "w") as f:
f.write(rf"$M_{{\rm PV}} \gtrsim {M_PV_this_work/1e-21:.1f} \times 10^{{-21}}\, {{\rm GeV}}$")
Expand Down
41 changes: 41 additions & 0 deletions src/scripts/posterior_MPV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import numpy as np
import seaborn as sns
from scipy.stats import gaussian_kde
from bilby.gw.cosmology import get_cosmology
import paths

# constants
h = 4.135667696e-15 # eV s
c = 299792.458 # km/s
H_0 = get_cosmology().H0.value # km/s/Mpc

sns.set_theme(palette='colorblind', font_scale=1.2)

plt.rcParams.update({
"text.usetex": True,
"font.family": "serif",
"font.serif": ["Computer Modern Roman"]
})

result_DataFrame = pd.read_feather(paths.data/"samples_posterior_birefringence.feather")
events = result_DataFrame['event'].unique()

M_PV_inv = np.linspace(0, 1.5e21, 1000)
kappa = (h*np.pi*H_0/c)*(1e3)*(100)*(M_PV_inv)/1e9

chosen_events = ['GW190727_060333', 'GW200112_155838', 'GW190513_205428', 'GW190915_235702', 'GW190803_022701', 'GW200311_115853']

kernel_dict = {}
for event in chosen_events:
kernel_dict[event] = gaussian_kde(result_DataFrame[result_DataFrame.event == event]['kappa'])
plt.plot(M_PV_inv, kernel_dict[event](kappa)+kernel_dict[event](-kappa), label=event)

plt.legend(fontsize=14)
plt.xlim(0, 1.5e21)
plt.ylabel(r'$p\left(M_\mathrm{PV}^{-1}\right)$')
plt.xlabel(r'$M_\mathrm{PV}^{-1}\, \left(\mathrm{GeV^{-1}}\right)$')

plt.savefig(fname=paths.figures/"posterior_MPV.pdf", bbox_inches="tight", dpi=300)
3 changes: 2 additions & 1 deletion src/scripts/reweighed_kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
norm_alpha = matplotlib.colors.Normalize(vmin=-1E-3, vmax=zscores.max()*1.1)
for i, (z,line) in enumerate(zip(zscores, g.get_lines()[::-1])):
line.set_alpha(norm_alpha(z))
if i < 3:
if zscores.index[i]=='GW170818':
line.set_label(zscores.index[i].replace('_', r'\_'))
line.set_linestyle('--')
else:
line.set_label(None)
g.legend(fontsize=14)
Expand Down
88 changes: 88 additions & 0 deletions src/tex/bib.bib
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,22 @@ @dataset{GWTC-2.1_dataset
url = {https://doi.org/10.5281/zenodo.6513631}
}

@article{LIGOScientific:2020tif,
author = "Abbott, R. and others",
collaboration = "LIGO Scientific, Virgo",
title = "{Tests of general relativity with binary black holes from the second LIGO-Virgo gravitational-wave transient catalog}",
eprint = "2010.14529",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
reportNumber = "LIGO-P2000091",
doi = "10.1103/PhysRevD.103.122002",
journal = "Phys. Rev. D",
volume = "103",
number = "12",
pages = "122002",
year = "2021"
}

@dataset{GWTC-3_dataset,
author = {{LIGO Scientific Collaboration} and {Virgo Collaboration} and {KAGRA Collaboration}},
title = {{GWTC-3: Compact Binary Coalescences Observed by
Expand Down Expand Up @@ -809,3 +825,75 @@ @ARTICLE{Yunes2009
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@article{Wang:2021gqm,
author = "Wang, Yi-Fan and Brown, Stephanie M. and Shao, Lijing and Zhao, Wen",
title = "{Tests of gravitational-wave birefringence with the open gravitational-wave catalog}",
eprint = "2109.09718",
archivePrefix = "arXiv",
primaryClass = "astro-ph.HE",
doi = "10.1103/PhysRevD.106.084005",
journal = "Phys. Rev. D",
volume = "106",
number = "8",
pages = "084005",
year = "2022"
}

@article{Haegel:2022ymk,
author = {Haegel, Le\"\i{}la and O'Neal-Ault, Kellie and Bailey, Quentin G. and Tasson, Jay D. and Bloom, Malachy and Shao, Lijing},
title = "{Search for anisotropic, birefringent spacetime-symmetry breaking in gravitational wave propagation from GWTC-3}",
eprint = "2210.04481",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
doi = "10.1103/PhysRevD.107.064031",
journal = "Phys. Rev. D",
volume = "107",
number = "6",
pages = "064031",
year = "2023"
}

@article{Jenks:2023pmk,
author = "Jenks, Leah and Choi, Lyla and Lagos, Macarena and Yunes, Nicol\'as",
title = "{Parameterized Parity Violation in Gravitational Wave Propagation}",
eprint = "2305.10478",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
month = "5",
year = "2023"
}

@article{Chia:2020psj,
author = "Chia, Horng Sheng and Edwards, Thomas D. P.",
title = "{Searching for General Binary Inspirals with Gravitational Waves}",
eprint = "2004.06729",
archivePrefix = "arXiv",
primaryClass = "astro-ph.HE",
doi = "10.1088/1475-7516/2020/11/033",
journal = "JCAP",
volume = "11",
pages = "033",
year = "2020"
}

@unpublished{tgrsel},
author = {Magee, R and Isi, Max and Chatziioannou, Katerina and Vitale, Salvatore and Farr, Will and Pratten, Geraint},
title = {Selection biases in tests of general relativity with gravitational waves},
year = {in prep.}
}

@article{LIGOScientific:2019zcs,
author = "Abbott, B. P. and others",
collaboration = "LIGO Scientific, Virgo, VIRGO",
title = "{A Gravitational-wave Measurement of the Hubble Constant Following the Second Observing Run of Advanced LIGO and Virgo}",
eprint = "1908.06060",
archivePrefix = "arXiv",
primaryClass = "astro-ph.CO",
reportNumber = "LIGO-P1900015",
doi = "10.3847/1538-4357/abdcb7",
journal = "Astrophys. J.",
volume = "909",
number = "2",
pages = "218",
year = "2021"
}
Loading

0 comments on commit cd7bba2

Please sign in to comment.