Skip to content

Commit

Permalink
Update fremu_pk.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroBai authored May 27, 2024
1 parent b34df78 commit fe44359
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyccl/emulators/fremu_pk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class FREmu(EmulatorPk):
Details: https://arxiv.org/abs/2405.05840
Documentation: https://astrobai.github.io/codes/fremu.html
Source code: https://github.com/AstroBai/FREmu
Usage:
pip install fremu
fremu_nl = ccl.FREmu()
cosmo = pyccl.Cosmology(extra_parameters={"fR0":fR0},
matter_power_spectrum=fremu_nl)
"""
def __init__(self, n_sampling_a=100):
# avoid tensorflow warnings
Expand All @@ -23,7 +28,7 @@ def __init__(self, n_sampling_a=100):
self.mpk = fremu.emulator()
self.a_min = 0.25
self.a_max = 1
self.k_min = self.mpk.get_k_values()[0]
self.k_min = self.mpk.get_k_values()[1]
self.k_max = self.mpk.get_k_values()[-1]
self.n_sampling_a = n_sampling_a

Expand All @@ -47,7 +52,7 @@ def _get_pk_at_a(self, cosmo, a):
for a_ in a:
pk_hubble_ = self.mpk.get_power_spectrum(z=1/a_-1)
pk_hubble.append(pk_hubble_)
k_hubble = self.mpk.get_k_values()
k_hubble = self.mpk.get_k_values()[1:]
pk_hubble = np.array(pk_hubble)
return k_hubble * h, pk_hubble / h**3

Expand Down

0 comments on commit fe44359

Please sign in to comment.