Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
gwsample-generation [2022/05/19 09:42] theoastro created |
gwsample-generation [2022/05/19 09:53] (current) theoastro |
||
---|---|---|---|
Line 1: | Line 1: | ||
==== GW sample generation ==== | ==== GW sample generation ==== | ||
+ | In order to generate EOS samples, we need a posterior probability file computed for a certain EOS set. Here, we use the '' | ||
import numpy as np | import numpy as np | ||
import pandas as pd | import pandas as pd | ||
import bilby | import bilby | ||
- | + | | |
- | # load posterior file | + | eos_post = np.loadtxt(' |
- | eos_post = np.loadtxt(' | + | |
- | | + | |
npts = 150000 | npts = 150000 | ||
Neos = 5000 | Neos = 5000 | ||
Line 15: | Line 13: | ||
params_low = [1.001398, 1.001398, 1] | params_low = [1.001398, 1.001398, 1] | ||
params_high = [2.2, 2.2, 75] | params_high = [2.2, 2.2, 75] | ||
- | |||
# 1) create dummy EOS samples with eos_post from nature paper | # 1) create dummy EOS samples with eos_post from nature paper | ||
EOS_raw = np.arange(0, | EOS_raw = np.arange(0, | ||
EOS_samples = np.random.choice(EOS_raw, | EOS_samples = np.random.choice(EOS_raw, | ||
- | |||
# 2) generate samples for masses and distance | # 2) generate samples for masses and distance | ||
mass_1 = np.random.uniform(params_low[0], | mass_1 = np.random.uniform(params_low[0], | ||
Line 27: | Line 23: | ||
chirp_mass = bilby.gw.conversion.component_masses_to_chirp_mass(mass_1, | chirp_mass = bilby.gw.conversion.component_masses_to_chirp_mass(mass_1, | ||
lum_distance = np.random.uniform(params_low[2], | lum_distance = np.random.uniform(params_low[2], | ||
- | |||
# 3) create pandas dataframe | # 3) create pandas dataframe | ||
dataset = pd.DataFrame({' | dataset = pd.DataFrame({' | ||
- | |||
# 4) save GWsamples.dat file | # 4) save GWsamples.dat file | ||
- | dataset.to_csv(' | + | dataset.to_csv(' |
- | import pandas as pd | + | |
- | import bilby | + | |
- | + | ||
- | # load posterior file | + | |
- | eos_post = np.loadtxt('/ | + | |
- | + | ||
- | npts = 150000 | + | |
- | Neos = 5000 | + | |
- | nparams = 3 | + | |
- | ############# | + | |
- | params_low = [1.001398, 1.001398, 1] | + | |
- | params_high = [2.2, 2.2, 75] | + | |
- | + | ||
- | # 1) create dummy EOS samples with eos_post from nature paper | + | |
- | EOS_raw = np.arange(0, | + | |
- | EOS_samples = np.random.choice(EOS_raw, | + | |
- | + | ||
- | # 2) generate samples for masses and distance | + | |
- | mass_1 = np.random.uniform(params_low[0], | + | |
- | mass_2 = np.random.uniform(params_low[1], | + | |
- | + | ||
- | mass_1, mass_2 = np.maximum(mass_1, | + | |
- | mass_ratio = mass_2 / mass_1 | + | |
- | chirp_mass = bilby.gw.conversion.component_masses_to_chirp_mass(mass_1, | + | |
- | + | ||
- | lum_distance = np.random.uniform(params_low[2], | + | |
- | + | ||
- | # 3) create pandas dataframe | + | |
- | dataset = pd.DataFrame({' | + | |
- | + | ||
- | # 4) save GWsamples.dat file | + | |
- | dataset.to_csv(' | + |
Last modified: le 2022/05/19 09:42