You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On python3.8.8 I am trying the following beginners script
from classy import Class
#Start by specifying the cosmology
Omega_b = 0.05
Omega_m = 0.3
Omega_cdm = Omega_m - Omega_b
h = 0.7 #H0/100
A_s = 2.1e-9
n_s = 0.96
#Create a params dictionary
#Need to specify the max wavenumber
k_max = 10 #UNITS: 1/Mpc
params = {
'output':'mPk',
'non linear':'halofit',
'Omega_b':Omega_b,
'Omega_cdm':Omega_cdm,
'h':h,
'A_s':A_s,
'n_s':n_s,
'P_k_max_1/Mpc':k_max,
'z_max_pk':10. #Default value is 10
}
#Initialize the cosmology andcompute everything
cosmo = Class()
cosmo.set(params)
cosmo.compute()
#Specify k and z
k = np.logspace(-5, np.log10(k_max), num=1000) #Mpc^-1
z = 1.
#Call these for the nonlinear and linear matter power spectra
Pnonlin = np.array([cosmo.pk(ki, z) for ki in k])
Plin = np.array([cosmo.pk_lin(ki, z) for ki in k])
# NOTE: You will need to convert these to h/Mpc and (Mpc/h)^3
# to use in the toolkit. To do this you would do:
k /= h
Plin *= h**3
Pnonlin *= h**3
which gives the following error
---------------------------------------------------------------------------
CosmoComputationError Traceback (most recent call last)
Cell In[4], line 30
28 cosmo = Class()
29 cosmo.set(params)
---> 30 cosmo.compute()
32 #Specify k and z
33 k = np.logspace(-5, np.log10(k_max), num=1000) #Mpc^-1
File ~/Documents/Work/CompactCollab/CorrelationMatrices/.venv/lib/python3.8/site-packages/class_public/python/classy.pyx:391, in classy.Class.compute()
CosmoComputationError:
Error in Class: thermodynamics_init(L:344) :error in thermodynamics_helium_from_bbn(ppr,pba,pth);
=>thermodynamics_helium_from_bbn(L:589) :could not open fA with name /Users/deyanmihaylov/Library/Python/3.8/lib/python/site-packages/class_public/external/bbn/sBBN_2017.dat and mode "r"
I checked and the file does not exist.
The text was updated successfully, but these errors were encountered:
On python3.8.8 I am trying the following beginners script
which gives the following error
I checked and the file does not exist.
The text was updated successfully, but these errors were encountered: