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 the growth function g in growth_rate() and growth_rate_fn() #197

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/hmf/cosmology/growth_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def growth_factor_fn(self, zmin=0.0, inverse=False):
def growth_rate(self, z):
"""
Growth rate, dln(d)/dln(a) from Hamilton 2000 eq. 4
Note that the growth function g in Hamilton 2000 is defined as g=D*(1+z).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, can we update the docs to point to the arxiv or DOI of the paper? (https://arxiv.org/pdf/astro-ph/0006089.pdf)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! You meant implement:

  • A similar fix to the growth rate method in GenMF? And
  • A python built-in UserWarning for each method?

I can do so, but maybe we should just merge this with the fix to the issue I mentioned in #198?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a good idea -- it might be best to figure out what's going on in #198 and add the fix to this PR. I think the fix for GenMF should not be difficult, and neither should the warning (perhaps you can add it to the base class). I'm still a little hesitant on the growth rate differences between CAMB and the numerical integral. I'd like to understand it better, but I have no time in the next couple of weeks.


Parameters
----------
Expand All @@ -175,12 +176,13 @@ def growth_rate(self, z):
-1
- self.cosmo.Om(z) / 2
+ self.cosmo.Ode(z)
+ 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z))
+ 5 * self.cosmo.Om(z) / (2 * self.growth_factor(z) * (1 + z))
)

def growth_rate_fn(self, zmin=0):
"""
Growth rate, dln(d)/dln(a) from Hamilton 2000 eq. 4, as callable.
Note that the growth function g in Hamilton 2000 is defined as g=D*(1+z).

Parameters
----------
Expand All @@ -198,7 +200,7 @@ def growth_rate_fn(self, zmin=0):
-1
- self.cosmo.Om(z) / 2
+ self.cosmo.Ode(z)
+ 5 * self.cosmo.Om(z) / (2 * gfn(z))
+ 5 * self.cosmo.Om(z) / (2 * gfn(z) * (1 + z))
)


Expand Down