Skip to content

[BUG] neutrino mass incorrectly implemented #117

@liuxx479

Description

@liuxx479

Describe the bug
Neutrino mass parameter is not properly modeled right now, because astropy takes in m_nu (in unit of eV), but camb uses omnuh2 (no unit).

To Reproduce
Steps to reproduce the behavior:

from astropy import units as u
tr0 = Transfer(cosmo_params={"m_nu":u.eV*np.array([0,0,0]) })
tr1 = Transfer(cosmo_params={"m_nu":u.eV*np.array([0.1, 0.1, 0.1]) } )

tr0.transfer_function - tr1.transfer_function

would show 0, meaning massive and massless neutrinos have identical transfer functions, because m_nu parameter is not passed on to camb

Expected behavior
tr0.transfer_function - tr1.transfer_function should be different

Additional context
I have a quick fix by redefining the CDM parameter omch2:

change line 212 in hmf/density_field/transfer_models.py from:
omch2=(self.cosmo.Om0 - self.cosmo.Ob0) * self.cosmo.h ** 2
to:
omch2=(self.cosmo.Om0 - self.cosmo.Ob0) * self.cosmo.h ** 2 - sum(self.cosmo.m_nu.value)/93.14

But I think there should be a better way to do it.

Metadata

Metadata

Labels

type: accuracyEnhancement that improves accuracy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions