Using UnivariateSpline for the calculation of the luminosity in def LuminosityDistance(self, z): is pretty dangerous. The spline doesn't necessary behave very well for small redshifts and can even produce negative values.
For example
from firesong.Evolution import get_evolution, SourcePopulation from firesong.Evolution import cosmology population = SourcePopulation(cosmology, get_evolution('NoEvolution')) population.LuminosityDistance(np.full(1001, 0.0017507872720130618))
Using
UnivariateSpline
for the calculation of the luminosity indef LuminosityDistance(self, z):
is pretty dangerous. The spline doesn't necessary behave very well for small redshifts and can even produce negative values.For example
from firesong.Evolution import get_evolution, SourcePopulation from firesong.Evolution import cosmology population = SourcePopulation(cosmology, get_evolution('NoEvolution')) population.LuminosityDistance(np.full(1001, 0.0017507872720130618))
produces
array([-1.04664586, -1.04664586, -1.04664586, ..., -1.04664586, -1.04664586, -1.04664586])
a safer alternative would it be to simply use interp1d or another more stable interpolator