It might be good to have math-only functions to compute P1D and Px, somehting that could leave outside of this repo
# define a function that returns the P3D model you want to integrate
# example 1: Arinyo model
def get_func_arinyo_p3d_kt_kp(z, args):
# if you want Arinyo, sth like this (I made this up)
p3d_model = forestflow.arinyo.p3d_model(z, args)
def func(kt, kp):
return p3d_model.predict_p3d(z, kt, kp, args)
return func
# example 2: model from McQuinn & White
def get_func_mcw_p3d_kt_kp(args):
p3d_kaiser = get_kaiser(args)
def func(kt, kp):
kp = args['kp_Mpc']
k2 = kpar**2 + kperp**2
p3d_suppresion = np.exp(- k2/kp**2)
return p3d_kaiser.get_p3d(kt, kp) * p3d_suppresion
return func
# this is the actual code that would be inside the p1d (or px) module
def compute_p1d(p3d_func, kpar, lnkperp=None)
if lnkperp is None:
lnkperp = default setup
kperp = np.exp(lnkperp)
# integrate p3d_func over kperp
p3d = p3d_func(kperp, kpar)
p1d = intengrate_p3d
return p1d
# and this is how you would use it for Arinyo
ari_p3d_func = get_func_arinyo_p3d_kt_kp(z, args)
ari_p1d = compute_p1d(ari_p3d_func, kpar)
# and for other models
mcw_p3d_func = get_func_mcw_p3d_kt_kp(args)
mcw_p1d = compute_p1d(mcw_p3d_func, kpar)
It might be good to have math-only functions to compute P1D and Px, somehting that could leave outside of this repo