Open dkirkby opened 7 years ago
My guess is that always saving these as part of the cosmo structure would not add much run time. Which exact transfer functions would you like to have as part of the CCL, and do you know how these are accessed from CLASS?
It may be interesting to save delta, phi+psi and at some point, v (the latter two for lensing and RSDs). These are trivially related to each other in LCDM, but not necessarily in other models (which will be important when we extend CCL). I have accessed these before in my hacked versions of CLASS, so I could look into this at some point.
I am able to access the CLASS transfer functions within my hacked ccl_cosmology_compute_power_class()
but I see negative values so I'm not sure how they are defined. Any ideas? In any case, it looks straightforward to add and fill a new ccl_spline2d
in ccl_data
for the matter and velocity transfer functions of each species, as well as phi & psi.
The CLASS transfer functions make sense if I plot -t(k) / t(kmin) / k**2
, as shown in this plot of the total matter density transfer function compared with BBKS:
I propose that we adopt the normalization and scaling shown in this plot, rather than the raw CLASS values, unless there are objections. I think this also matches how CAMB provides transfer functions.
I believe we still do not save the transfer functions. Is this something we still want? I can see it being useful, especially for modified gravity applications. @damonge @dkirkby?
Yes, this is eventually gonna bite us in the ass. We have a relatively nice formalism to store these things (the generalized Pks), but we're not using it for it.
Yes, I think we still want this. Is it easier to implement now?
I think so, and it could be done at the python level (the same way it's done for the power spectrum now)
This could either be triggered by an option to
ccl_cosmology_compute_power_class()
or we could always calculate and save the transfer functions (since they are presumably always being calculated anyway) to simplify the API. Any opinions?