Help with CAMB's Spline interpolation module [Python]
Posted: March 07 2019
I have recently started with the python version of CAMB. Currently I am stuck with the module :
I have a custom data set of which I would like to feed in to this module.
I am unable to locate the proper function call to extract the Splined output. I have tried :
my question is how to extract the splined results from here ? If I try (after implementing the cosmology params)
My kernel dies .
Also is there a provision, to implement the boundary conditions on the spline at the two ends of the spectrum with this module(or other) ?
thanks
Code: Select all
camb.initialpower.SplinedInitialPower(**kwargs)
Code: Select all
k, P(K)
I am unable to locate the proper function call to extract the Splined output. I have tried :
Code: Select all
np.random.seed(0)
k = np.logspace(np.log10(1), np.log10(1000.0), num=10)
ran = np.random.randint(5,16,size=np.shape(k)[0])
pk2 = np.power(k,0.2)*(ran/10.)
inflation_params2 = initialpower.SplinedInitialPower()
#inflation_params2.set_scalar_log_regular(1.0,1000.0,pk2)
inflation_params2.set_scalar_table(k,pk2)
Code: Select all
camb.get_transfer_functions(pars).power_spectra_from_transfer(inflation_params2)
Also is there a provision, to implement the boundary conditions on the spline at the two ends of the spectrum with this module(or other) ?
thanks