Skip to content
Open
12 changes: 6 additions & 6 deletions test/gw/likelihood/marginalization_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def setUp(self):
waveform_arguments=dict(
reference_frequency=20.0,
minimum_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
)
)
self.interferometers.inject_signal(
Expand All @@ -231,8 +231,8 @@ def setUp(self):

trial_roq_paths = [
"/roq_basis",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I don't think we have ROQ data for XPHM yet, so this will need to be reverted (and may be why the CI is failing).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mj-will I assume #897 was a "move towards" modern waveforms and it is okay to use the older waveforms for the ROQs to avoid having to figure out how to package them?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that's fine.

I'll note there is definitely ROQ data for XPHM on CIT but I don't think it's public (and is also huge).

"/home/cbc/ROQ_data/IMRPhenomPv2/4s",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomXPHM/4s"),
"/home/cbc/ROQ_data/IMRPhenomXPHM/4s",
]
roq_dir = None
for path in trial_roq_paths:
Expand All @@ -249,7 +249,7 @@ def setUp(self):
start_time=1126259640,
waveform_arguments=dict(
reference_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
frequency_nodes_linear=np.load(f"{roq_dir}/fnodes_linear.npy"),
frequency_nodes_quadratic=np.load(f"{roq_dir}/fnodes_quadratic.npy"),
)
Expand All @@ -265,7 +265,7 @@ def setUp(self):
waveform_arguments=dict(
reference_frequency=20.0,
minimum_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
)
)

Expand All @@ -276,7 +276,7 @@ def setUp(self):
start_time=1126259640,
waveform_arguments=dict(
reference_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
)
)

Expand Down
60 changes: 30 additions & 30 deletions test/gw/likelihood_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def setUp(self):
# Possible locations for the ROQ: in the docker image, local, or on CIT
trial_roq_paths = [
"/roq_basis",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the case above

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And applied to the comments as well

"/home/cbc/ROQ_data/IMRPhenomPv2/4s",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomXPHM/4s"),
"/home/cbc/ROQ_data/IMRPhenomXPHM/4s",
]
roq_dir = None
for path in trial_roq_paths:
Expand Down Expand Up @@ -331,7 +331,7 @@ def setUp(self):
self.priors = bilby.gw.prior.BBHPriorDict()
self.priors.pop("mass_1")
self.priors.pop("mass_2")
# Testing is done with the 4s IMRPhenomPV2 ROQ basis
# Testing is done with the 4s IMRPhenomXPHM ROQ basis
self.priors["chirp_mass"] = bilby.core.prior.Uniform(12.299703, 45)
self.priors["mass_ratio"] = bilby.core.prior.Uniform(0.125, 1)
self.priors["geocent_time"] = bilby.core.prior.Uniform(1.19, 1.21)
Expand All @@ -343,7 +343,7 @@ def setUp(self):
waveform_arguments=dict(
reference_frequency=20.0,
minimum_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
),
)

Expand All @@ -361,7 +361,7 @@ def setUp(self):
frequency_nodes_linear=fnodes_linear,
frequency_nodes_quadratic=fnodes_quadratic,
reference_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
),
)

Expand Down Expand Up @@ -546,8 +546,8 @@ def test_rescaling(self):
# Possible locations for the ROQ: in the docker image, local, or on CIT
trial_roq_paths = [
"/roq_basis",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again.

"/home/cbc/ROQ_data/IMRPhenomPv2/4s",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomXPHM/4s"),
"/home/cbc/ROQ_data/IMRPhenomXPHM/4s",
]
roq_dir = None
for path in trial_roq_paths:
Expand Down Expand Up @@ -583,7 +583,7 @@ def test_rescaling(self):
self.priors = bilby.gw.prior.BBHPriorDict()
self.priors.pop("mass_1")
self.priors.pop("mass_2")
# Testing is done with the 4s IMRPhenomPV2 ROQ basis
# Testing is done with the 4s IMRPhenomXPHM ROQ basis
self.priors["chirp_mass"] = bilby.core.prior.Uniform(
12.299703 / scale_factor, 45 / scale_factor
)
Expand All @@ -598,7 +598,7 @@ def test_rescaling(self):
frequency_nodes_linear=fnodes_linear,
frequency_nodes_quadratic=fnodes_quadratic,
reference_frequency=20.0,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
),
)

Expand Down Expand Up @@ -631,7 +631,7 @@ def setUp(self):
self.sampling_frequency = 2048
self.duration = 16
self.reference_frequency = 20.0
self.waveform_approximant = "IMRPhenomD"
self.waveform_approximant = "IMRPhenomXAS"
# The SNRs of injections are 130-160 for roq_scale_factor=1 and 70-80 for roq_scale_factor=2
self.injection_parameters = dict(
mass_ratio=0.8,
Expand Down Expand Up @@ -942,7 +942,7 @@ def test_from_hdf5(self, basis_linear, basis_quadratic):
duration = 16
geocent_time = 1.2
reference_frequency = 20.0
waveform_approximant = "IMRPhenomD"
waveform_approximant = "IMRPhenomXAS"
mc_range = [8, 14]

priors = bilby.gw.prior.BBHPriorDict()
Expand Down Expand Up @@ -980,8 +980,8 @@ def test_from_npy(self, from_array):
# Possible locations for the ROQ: in the docker image, local, or on CIT
trial_roq_paths = [
"/roq_basis",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"),
"/home/cbc/ROQ_data/IMRPhenomPv2/4s",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomXPHM/4s"),
"/home/cbc/ROQ_data/IMRPhenomXPHM/4s",
]
roq_dir = None
for path in trial_roq_paths:
Expand All @@ -1006,7 +1006,7 @@ def test_from_npy(self, from_array):
duration = 4
geocent_time = 1.2
reference_frequency = 20.0
waveform_approximant = "IMRPhenomPv2"
waveform_approximant = "IMRPhenomXPHM"
mc_range = [12.299703, 45]

priors = bilby.gw.prior.BBHPriorDict()
Expand Down Expand Up @@ -1132,8 +1132,8 @@ def create_likelihood_single_basis(self):
# Possible locations for the ROQ: in the docker image, local, or on CIT
trial_roq_paths = [
"/roq_basis",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomPv2/4s"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

"/home/cbc/ROQ_data/IMRPhenomPv2/4s",
os.path.join(os.path.expanduser("~"), "ROQ_data/IMRPhenomXPHM/4s"),
"/home/cbc/ROQ_data/IMRPhenomXPHM/4s",
]
roq_dir = None
for path in trial_roq_paths:
Expand All @@ -1153,7 +1153,7 @@ def create_likelihood_single_basis(self):
duration = 4
geocent_time = 1.2
reference_frequency = 20.0
waveform_approximant = "IMRPhenomPv2"
waveform_approximant = "IMRPhenomXPHM"
mc_range = [12.299703, 45]

priors = bilby.gw.prior.BBHPriorDict()
Expand Down Expand Up @@ -1194,7 +1194,7 @@ def create_likelihood_multiple_bases(self, multiband):
duration = 16
geocent_time = 1.2
reference_frequency = 20.0
waveform_approximant = "IMRPhenomD"
waveform_approximant = "IMRPhenomXAS"
mc_range = [8, 14]

priors = bilby.gw.prior.BBHPriorDict()
Expand Down Expand Up @@ -1310,10 +1310,10 @@ def tearDown(self):
)

@parameterized.expand([
("IMRPhenomD", True, 2, False, 1.5e-2),
("IMRPhenomD", True, 2, True, 1.5e-2),
("IMRPhenomD", False, 2, False, 5e-3),
("IMRPhenomD", False, 2, True, 6e-3),
("IMRPhenomXAS", True, 2, False, 1.5e-2),
("IMRPhenomXAS", True, 2, True, 1.5e-2),
("IMRPhenomXAS", False, 2, False, 5e-3),
("IMRPhenomXAS", False, 2, True, 6e-3),
("IMRPhenomHM", False, 4, False, 8e-4),
("IMRPhenomHM", False, 4, True, 1e-3)
])
Expand Down Expand Up @@ -1362,7 +1362,7 @@ def test_large_accuracy_factor(self):
"""
Check if larger accuracy factor increases the accuracy.
"""
waveform_approximant = "IMRPhenomD"
waveform_approximant = "IMRPhenomXAS"
wfg = bilby.gw.WaveformGenerator(
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
Expand Down Expand Up @@ -1408,7 +1408,7 @@ def test_reference_chirp_mass_from_prior(self):
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.binary_black_hole_frequency_sequence,
waveform_arguments=dict(
reference_frequency=self.fmin, waveform_approximant="IMRPhenomD"
reference_frequency=self.fmin, waveform_approximant="IMRPhenomXAS"
)
)
likelihood1 = bilby.gw.likelihood.MBGravitationalWaveTransient(
Expand All @@ -1430,7 +1430,7 @@ def test_no_reference_chirp_mass(self):
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.binary_black_hole_frequency_sequence,
waveform_arguments=dict(
reference_frequency=self.fmin, waveform_approximant="IMRPhenomD"
reference_frequency=self.fmin, waveform_approximant="IMRPhenomXAS"
)
)
with self.assertRaises(TypeError):
Expand All @@ -1446,7 +1446,7 @@ def test_cannot_determine_reference_chirp_mass(self):
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.binary_black_hole_frequency_sequence,
waveform_arguments=dict(
reference_frequency=self.fmin, waveform_approximant="IMRPhenomD"
reference_frequency=self.fmin, waveform_approximant="IMRPhenomXAS"
)
)
for key in ["chirp_mass", "mass_1", "mass_2"]:
Expand All @@ -1463,7 +1463,7 @@ def test_inout_weights(self, linear_interpolation):
Check if multiband weights can be saved as a file, and a likelihood object constructed from the weights file
produces the same likelihood value.
"""
waveform_approximant = "IMRPhenomD"
waveform_approximant = "IMRPhenomXAS"
wfg = bilby.gw.WaveformGenerator(
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
Expand Down Expand Up @@ -1519,7 +1519,7 @@ def test_from_dict_weights(self, linear_interpolation):
"""
Check if a likelihood object constructed from dictionary-like weights produce the same likelihood value
"""
waveform_approximant = "IMRPhenomD"
waveform_approximant = "IMRPhenomXAS"
wfg = bilby.gw.WaveformGenerator(
duration=self.duration, sampling_frequency=self.sampling_frequency,
frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
Expand Down Expand Up @@ -1565,8 +1565,8 @@ def test_from_dict_weights(self, linear_interpolation):
self.assertAlmostEqual(llr, llr_from_weights)

@parameterized.expand([
("IMRPhenomD", True, 2, False, 1e-2),
("IMRPhenomD", True, 2, True, 1e-2),
("IMRPhenomXAS", True, 2, False, 1e-2),
("IMRPhenomXAS", True, 2, True, 1e-2),
("IMRPhenomHM", False, 4, False, 5e-3),
])
def test_matches_original_likelihood_low_maximum_frequency(
Expand Down
2 changes: 1 addition & 1 deletion test/gw/plot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setUp(self):
frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
time_domain_source_model=None,
waveform_arguments=dict(
reference_frequency=20.0, waveform_approximant="IMRPhenomPv2"
reference_frequency=20.0, waveform_approximant="IMRPhenomXPHM"
),
interferometers=dict(
H1=dict(optimal_SNR=1, parameters=injection_parameters),
Expand Down
2 changes: 1 addition & 1 deletion test/gw/result_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
time_marginalization=True,
frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
waveform_arguments=dict(
reference_frequency=20.0, waveform_approximant="IMRPhenomPv2"
reference_frequency=20.0, waveform_approximant="IMRPhenomXPHM"
),
interferometers=dict(
H1=dict(optimal_SNR=1, parameters=injection_parameters),
Expand Down
16 changes: 8 additions & 8 deletions test/gw/source_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUp(self):
phase=0.0,
)
self.waveform_kwargs = dict(
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
reference_frequency=50.0,
minimum_frequency=20.0,
catch_waveform_errors=True,
Expand Down Expand Up @@ -212,7 +212,7 @@ def setUp(self):
lambda_2=100.0,
)
self.waveform_kwargs = dict(
waveform_approximant="IMRPhenomPv2_NRTidal",
waveform_approximant="IMRPhenomPv2_NRTidalv2",
reference_frequency=50.0,
minimum_frequency=20.0,
)
Expand Down Expand Up @@ -325,7 +325,7 @@ def setUp(self):
frequency_nodes_linear=fnodes_linear,
frequency_nodes_quadratic=fnodes_quadratic,
reference_frequency=50.0,
waveform_approximant="IMRPhenomPv2",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should be using IMRPhenomPv2 since we are passing in the ROQ terms just above

waveform_approximant="IMRPhenomXPHM",
)
self.frequency_array = bilby.core.utils.create_frequency_series(2048, 4)

Expand Down Expand Up @@ -479,7 +479,7 @@ def setUp(self):
self.full_frequencies_to_sequence = self.frequency_array >= self.minimum_frequency
self.frequencies = self.frequency_array[self.full_frequencies_to_sequence]
self.waveform_kwargs = dict(
waveform_approximant="IMRPhenomPv2_NRTidal",
waveform_approximant="IMRPhenomPv2_NRTidalv2",
reference_frequency=50.0,
)

Expand Down Expand Up @@ -538,14 +538,14 @@ def setUp(self):
phase=0.0,
)
self.waveform_kwargs_fiducial = dict(
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
reference_frequency=50.0,
minimum_frequency=20.0,
catch_waveform_errors=True,
fiducial=True,
)
self.waveform_kwargs_binned = dict(
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
reference_frequency=50.0,
minimum_frequency=20.0,
catch_waveform_errors=True,
Expand Down Expand Up @@ -653,13 +653,13 @@ def setUp(self):
lambda_2=100.0,
)
self.waveform_kwargs_fiducial = dict(
waveform_approximant="IMRPhenomPv2_NRTidal",
waveform_approximant="IMRPhenomPv2_NRTidalv2",
reference_frequency=50.0,
minimum_frequency=20.0,
fiducial=True,
)
self.waveform_kwargs_binned = dict(
waveform_approximant="IMRPhenomPv2_NRTidal",
waveform_approximant="IMRPhenomPv2_NRTidalv2",
reference_frequency=50.0,
minimum_frequency=20.0,
fiducial=False,
Expand Down
2 changes: 1 addition & 1 deletion test/gw/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_lalsim_SimInspiralChooseFDWaveform(self):
1000,
20,
None,
lalsim.IMRPhenomPv2,
lalsim.IMRPhenomXPHM,
)
self.assertEqual(len(a), 2)
self.assertEqual(type(a[0]), lal.COMPLEX16FrequencySeries)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/make_standard_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
luminosity_distance=100.0,
theta_jn=0.4,
phase=1.3,
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
reference_frequency=50.0,
ra=1.375,
dec=-1.2108,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/sample_from_the_prior_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_fifteen_dimensional_cbc(self):
bilby.core.utils.random.seed(8817021)

waveform_arguments = dict(
waveform_approximant="IMRPhenomPv2",
waveform_approximant="IMRPhenomXPHM",
reference_frequency=50.0,
minimum_frequency=20.0,
)
Expand Down
Loading