Commit 3860e42d authored by Gregory Ashton's avatar Gregory Ashton

Remove obsolete likelihood

parent 91dec665
Pipeline #19571 passed with stages
in 6 minutes and 14 seconds
......@@ -136,39 +136,6 @@ class GravitationalWaveTransient(object):
bounds_error=False, fill_value=-np.inf)
class BasicGravitationalWaveTransient(object):
def __init__(self, interferometers, waveform_generator):
self.interferometers = interferometers
self.waveform_generator = waveform_generator
def noise_log_likelihood(self):
log_l = 0
for interferometer in self.interferometers:
log_l -= 2. / self.waveform_generator.time_duration * np.sum(
abs(interferometer.data) ** 2 / interferometer.power_spectral_density_array)
return log_l.real
def log_likelihood(self):
log_l = 0
waveform_polarizations = self.waveform_generator.frequency_domain_strain()
if waveform_polarizations is None:
return np.nan_to_num(-np.inf)
for interferometer in self.interferometers:
log_l += self.log_likelihood_interferometer(waveform_polarizations, interferometer)
return log_l.real
def log_likelihood_interferometer(self, waveform_polarizations, interferometer):
signal_ifo = interferometer.get_detector_response(waveform_polarizations, self.waveform_generator.parameters)
log_l = - 2. / self.waveform_generator.time_duration * np.vdot(interferometer.data - signal_ifo,
(interferometer.data - signal_ifo)
/ interferometer.power_spectral_density_array)
return log_l.real
def log_likelihood_ratio(self):
return self.log_likelihood() - self.noise_log_likelihood()
def get_binary_black_hole_likelihood(interferometers):
""" A rapper to quickly set up a likelihood for BBH parameter estimation
......@@ -190,4 +157,3 @@ def get_binary_black_hole_likelihood(interferometers):
parameters={'waveform_approximant': 'IMRPhenomPv2', 'reference_frequency': 50})
likelihood = tupak.likelihood.GravitationalWaveTransient(interferometers, waveform_generator)
return likelihood
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment