Closed ravi398 closed 1 year ago
Hi Ravi
I am assuming that you are using the Python wrapper. You need to add a few entries to python/cclassy.pxd
and python/classy.pyx
:
python/cclassy.pxd
, around line 102, inside the cdef background scope:
int N_ncdm
double * deg_ncdm
python/classy.pyx
, at the end of the file inside the Class class scope:
def get_ncdm_deg(self):
cdef int i
cdef np.ndarray[DTYPE_t, ndim=1] deg_ncdm = np.zeros(self.ba.N_ncdm,'float64')
for i in range(self.ba.N_ncdm):
deg_ncdm[i] = self.ba.deg_ncdm[i]
return deg_ncdm
Now you can test it using
from classy import Class
ncdm = {'N_ncdm':1, 'Omega_cdm':0.125, 'Omega_ncdm':0.125, 'm_ncdm':1000}
cosmo = Class()
cosmo.set(ncdm)
cosmo.compute(['input'])
deg_ncdm = cosmo.get_ncdm_deg()
print(deg_ncdm)
Cheers, Thomas
It worked. Thank you for your help.
Regards Ravi sharma
Hello, When we specify both omega_ncdm and m_ncdm in the class input file. it rescales the distribution function to satisfy both conditions.
Is there any way to get that rescale parameters as class output especially when I am not using the standard Fermi Dirac distribution?
@ThomasTram would you please help regarding this ?
Thank you in advance.
Regards Ravi sharma