Extend the functionality built-in to Pk2D to allow for power-law (or similar) extrapolation when is_logp = False. This will prevent differences in Pk that comes from nl_pt vs directly from the main cosmology object, and it will provide a physically reasonable extrapolation for PT calculations. This closes #773, since it will solve the underlying issue.
Something like this:
if is_logp = True
continue as normal
(could add an option for all neg values, i.e. log(-P) was passed)
if is_logp = False
if log_ext = False(new option)
... original behavior
if log_ext = True
use the last two values on both ends (or three, depending on desired order of taylor expansion. or use more if we are worried about noise)
confirm all positive or negative
take log of P (or -P)
perform 1st or 2nd order extrapolation
(could also use the original Pk2D extension for all pos or all neg values, but we might want to allow a purely flexible power law extension without assuming n_s at low k)
Extend the functionality built-in to Pk2D to allow for power-law (or similar) extrapolation when is_logp = False. This will prevent differences in Pk that comes from nl_pt vs directly from the main cosmology object, and it will provide a physically reasonable extrapolation for PT calculations. This closes #773, since it will solve the underlying issue.
Something like this:
if is_logp = True continue as normal (could add an option for all neg values, i.e. log(-P) was passed)
if is_logp = False if log_ext = False(new option) ... original behavior if log_ext = True