Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix neutrino mass parameter in camb #118

Merged
merged 3 commits into from Dec 17, 2020
Merged

Conversation

liuxx479
Copy link
Contributor

Originally, omega_cdm (omch2) assumes all matter in cold dark matter and baryons, and ignores massive neutrinos:
omch2=(self.cosmo.Om0 - self.cosmo.Ob0) * self.cosmo.h ** 2

I changed the definition to include massive neutrinos:
omch2=(self.cosmo.Om0 - self.cosmo.Ob0 **- self.cosmo.Onu0**) * self.cosmo.h ** 2
where I used astropy's cosmo.Onu0 calculation.

In addition, camb requires the neutrino mass and hierarchy.. I did not fix the code for different hierarchies (normal, inverted, degenerate) since it should be a sub-percent effect that's not observable by near future LSS surveys. So I assumed degenerate hierarchy (i.e. the 3 neutrinos are assumed to have equal mass = 1/3 *total mass):

mnu=sum(self.cosmo.m_nu.value)
neutrino_hierarchy='degenerate'

@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #118 (8b24f5d) into dev (cb19a62) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #118   +/-   ##
=======================================
  Coverage   85.68%   85.68%           
=======================================
  Files          26       26           
  Lines        2285     2285           
=======================================
  Hits         1958     1958           
  Misses        327      327           
Impacted Files Coverage Δ
src/hmf/density_field/transfer_models.py 87.79% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95c3440...8b24f5d. Read the comment docs.

@steven-murray
Copy link
Collaborator

Thanks @liuxx479, this is much appreciated. Can I get you to do three things:

First, do pre-commit install in the top-level directory (this will catch the linting problems before a commit is checked in). If you don't have pre-commit you can first do pip install pre-commit.

Secondly, add this change to the CHANGELOG.rst under dev-version (or make that sub-heading if it doesn't exist), under Fixes.

Thirdly, add your name to the contributors list!

@liuxx479 liuxx479 reopened this Dec 17, 2020
@steven-murray steven-murray merged commit 1d6b595 into halomod:dev Dec 17, 2020
@steven-murray steven-murray mentioned this pull request Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants