Closed jessmuir closed 1 year ago
Thanks for catching this. Could you try afc6bc113762d7735d054460b6b7ed74aaf4d835 and let me know if that works as intended?
This seems to fix things: I now get the same behavior (matching CAMB HMCode) independent of the order in which linear power and parameters are set. Thanks!
Hi! I'm not sure if this is a bug or just user error but I wanted to flag this just in case (at the very least it might signal useful documentation to add):
I've been exploring using this module as an option for separating CAMB calculations of linear P(k,z) and the nonlinear calculation into separate steps in modeling pipeline. As part of that, I've been comparing the two-step CAMB-then-pyhmcode calculations to a single-step CAMB run using the built-in HMCode. In doing so I've found that the results of this comparison depends on the order of how different parts of the pyhmcode.Cosmology() object are set up.
If I follow your example notebook directly, the one-step and two-step setups match when doing:
However, things do not match if instead I do something like this, with the set_linear_power_spectrum before parameters (as I was initially trying):
This results in offsets between the one-step and two-step calculations even at linear scales, with bigger differences at higher redshifts.