lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
232 stars 288 forks source link

fsigma8(z) #393

Open SafaeCosmology opened 3 years ago

SafaeCosmology commented 3 years ago

hello everyone, is it possible to plot the growth rate fsigma8(z) as a function of z, with CLASS ? thank you in advance. Best regards

shan1525 commented 3 years ago

Hi @SafaeCosmology ,

You can look into the script folder of class. From there, you can get the idea to plot what you are asking. To be more precise look into distances.py in script folder and in place of distance you define fsigma8 . From get argument get fsigma8 and plot fsigma8 vs z. I hope this helps.

best regards, shan.

SafaeCosmology commented 3 years ago

Hi @shan1525 ok thank you so much, i wanted to know if CLASS can calculate f*sigma8 and not just sigma8, can i get values of fsigma8 in output folder as file.dat. best regards,

shan1525 commented 3 years ago

Hi @SafaeCosmology , Sorry for the late reply.I could suggest you two methods: 1) First find ,where this cosmological parameter is calculated . You have to check in which module this is calculated . For example , if it is calculated in background.c , all the data are stored in last few lines of background.c starting from the line 2241. you can add this parameter in those succeeding line if fsigma is calculated in background.c. And in the .ini file comment the write background as yes. Check all the modules in source file and add this parameter in the store commands. 2) 2nd method involves python wrapper. As I have suggested before set your params in the set params line. import classy and define this fsigma8 . This can be done as folllowing: import matplotlib import matplotlib.pyplot as plt import numpy as np from classy import Class Safae = Class() Safae.set({'h': .7219, 'A_s': 2.215e-09, 'n_s': 0.9889, 'omega_b': 0.02253, 'omega_cdm': 0.1306, 'tau_reio': 0.072, 'N_ncdm': 1, 'N_ur': 2.0328} set more parameters such as omega lambda and all) Safae.compute() baM = Safae.getbackground() then define fsigma8 as you define like followingL: fsigma8 = Safae.fsigma8() baH = baM['H [1/Mpc]'] baT = baM['conf. time [Mpc]'] baa = 1/(1 + baM['z']) plt.figure(figsize=(14,12)) plt.xscale('log') plt.xlim([10,1e5]) plt.ylim([0,0.14]) plt.xlabel('$z$') plt.ylabel(r'$f{sigma8}$') plt.grid() plt.plot(baM['z'],fsigma8,w=4,c='k') something like this. I hope this helps. Define your parameter like this. I hope this works

Best regards, shan.

shan1525 commented 3 years ago

Hi @SafaeCosmology ,

You can also look in the notebooks folder of class . With jupyter notebook check the file Growth_with_w.ipynb . That can be helpful also.

Best, shan.

SafaeCosmology commented 3 years ago

Thank you so much @shan1525 .

JesusTorrado commented 3 years ago

Hi @lesgourg et al,

Can we get this in 3.0 as a method in classy.pyx?

brinckmann commented 3 years ago

Line 1314 of classy.pyx gives you f(z): def scale_independent_growth_factor_f(self, z): and line 1065 gives you sigma(z): def sigma(self,double R,double z):

If you really want a function with the two together it shouldn't be very challenging to make one by combining the two functions. If it's for communication between public codes I agree it might be nice to have in the public version for simplicity, but at least the ingredients are already there to extract both values from CLASS via the wrapper.

Best, Thejs

JesusTorrado commented 3 years ago

Thanks, @brinckmann !

But apparently for general models, the quantity closest to what is measured is define as the RHS of eq. (33) in https://arxiv.org/pdf/1502.01589.pdf

So in that case we would also need the velocity-density correlation, which I am no sure CLASS computes or makes available?

JesusTorrado commented 3 years ago

Hi all,

Any update on this? @Pablo-Lemos is adding the latest (e)BOSS BAO data to Cobaya, and it needs fsigma8, as described above (so velocity-density correlation should be the last piece missing, I think?).