I want to calculate the (uninterpolated) Non Linear Matter Power Spectrum using the python version of CAMB. In particular, have two issues:

1) I want to calculate the Power Spectrum for more redshift values than the 150 allowed by the program

2) I want to test my result for different values of k_per_logint.

I (think) I have solved the first issue dividing my z_redshift list in smaller list with less than 150 redshifts. For the second issue, I wrote this python code

Code: Select all

```
z_values = np.linspace(0.001, 2.5, 300)
z_list = np.split(z_values, 2)
camb_pars=camb.read_ini(os.path.join(camb_pars_path,'planck_2018.ini'))
pk_nonlin_list = []
z_nonlin_list = []
for z_bin in z_list:
camb_pars.set_matter_power(redshifts=z_bin, kmax=4., k_per_logint=130, nonlinear=True, accurate_massive_neutrino_transfers=True)
background_camb = camb.get_background(camb_pars)
camb_pars.NonLinear = model.NonLinear_both
background_camb.calc_power_spectra(camb_pars)
kh_nonlin, z_nonlin_small, pk_nonlin_small = background_camb.get_nonlinear_matter_power_spectrum(params=camb_pars)
pk_nonlin_list.append(pk_nonlin_small)
z_nonlin_list.append(z_nonlin_small)
```

So, I do not understand where is my mistake. Any hints?

Thank you all for your time,

Marco