def test_powerlaw_volume(self): """ Test that the total volume matches the expected value for a trivial case """ model = redshift.PowerLawRedshift() parameters = dict(lamb=1) total_volume = np.trapz( Planck15.differential_comoving_volume(self.zs).value * 4 * np.pi, self.zs, ) self.assertEqual(total_volume, model.normalisation(parameters))
def test_powerlaw_normalised(self): model = redshift.PowerLawRedshift() priors = PriorDict() priors["lamb"] = Uniform(-15, 15) self._run_model_normalisation(model=model, priors=priors)
def test_zero_outside_domain(self): model = redshift.PowerLawRedshift(z_max=1) parameters = dict(lamb=1) p_z = model(self.test_data, **parameters) self.assertTrue(all(p_z[self.zs > 1] == 0))