Page 1 of 1

CAMB: reuse results with changing source windows

Posted: October 11 2022
by Nicolas Tessore
I am repeatedly computing angular power spectra for counts and lensing using the exact same cosmology, but differing splined source windows. You could think of it as exploring different parametrisations of $n(z)$.

Is there a way for CAMB to reuse parts of the computation, such as e.g. the nonlinear matter power spectra? It seems that passing the updated parameter object pars in the call to get_source_cls_dict(pars, ...) is not much different than calling it on new results as in get_results(pars).get_source_cls_dict(...).

Re: CAMB: reuse results with changing source windows

Posted: October 13 2022
by Antony Lewis
No, the best you can do is pass an array of source windows to calculate them all at once. Of course for quick investigations, or where limber is accurate, you could just separately calculate the result yourself from Pk using Limber.

Re: CAMB: reuse results with changing source windows

Posted: October 13 2022
by Nicolas Tessore
Thanks, that's what I was doing, but I was hoping to get around the "batching" that it requires. Unfortunately, Limber is not an option.

NB: A related question maybe, can (or could) CAMB compute not the entire matrix of cls, but e.g. just individual rows like "W1xWn"?

Re: CAMB: reuse results with changing source windows

Posted: October 14 2022
by Antony Lewis
Currently it calculates all of them. I don't think it would be much faster as calculating the Cl is relatively quick once you have the transfer functions (except perhaps for very large arrays of windows).