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)
223 stars 292 forks source link

Velocity divergence power spectrum #450

Open gabygga opened 2 years ago

gabygga commented 2 years ago

Hi! I'm trying to plot the velocity divergence power spectrum. Is this an standard output of class? Also I'm interested in obtain the cross velocity divergence--matter power spectrum. Is there a common way to obtain these spectra?

Thanks

adematti commented 2 years ago

Hi - I'm just a CLASS user, and it's probably a bit late, I don't think such spectra are provided within the default Python wrapper, but I made this to access them from the C structure: https://github.com/adematti/pyclass/blob/e4211926245d8802df08c6d94cfa3822d65acecb/pyclass/binding.pyx#L1665 happy for anyone to copy/paste, etc. - hope it's useful!

ThomasTram commented 2 years ago

Hi

Just saw this now. You can get the velocity transfer functions by adding 'vTk' to the list of outputs and then just call the 'get_transfer(z)' method from the wrapper. You then just need the primordial powespectrum, available through 'get_primordial()' and you are good to go!

Cheers, Thomas

adematti commented 2 years ago

Thanks Thomas!