Пример #1
0
 def test_double_peak_normalised(self):
     norms = list()
     for ii in range(self.n_test):
         parameters = self.power_prior.sample()
         parameters.update(self.double_gauss_prior.sample())
         parameters.update(self.smooth_prior.sample())
         p_m = mass.MultiPeakSmoothedMassDistribution()(self.dataset, **parameters)
         norms.append(trapz(trapz(p_m, self.m1s), self.qs))
     self.assertAlmostEqual(_max_abs_difference(norms, 1.0), 0.0, 2)
Пример #2
0
 def test_double_peak_delta_m_zero_matches_two_component_primary_mass_ratio(
         self):
     max_diffs = list()
     for ii in range(self.n_test):
         parameters = self.power_prior.sample()
         parameters.update(self.double_gauss_prior.sample())
         del parameters["beta"]
         p_m1 = mass.three_component_single(mass=self.dataset["mass_1"],
                                            **parameters)
         parameters["delta_m"] = 0
         p_m2 = mass.MultiPeakSmoothedMassDistribution().p_m1(
             self.dataset, **parameters)
         max_diffs.append(_max_abs_difference(p_m1, p_m2))
     self.assertAlmostEqual(max(max_diffs), 0.0)