The latest public release of Montepython includes Euclid likelihoods for the redshift survey (**euclid_pk**) and the cosmic shear survey (**euclid_lensing**).

The **__init__.py ** file needs to be edited because of Python syntax issues. If you try to use it as provided, you will get two errors messages.

`File "/home/[APClogin]/montepython/montepython/likelihoods/euclid_pk/__init__.py", line 224, in loglkl`

k_sigma = np.zeros(2.*self.nbin+1, 'float64')

TypeError: 'float' object cannot be interpreted as an index

The problem here is the decimal point after the 2, which makes it a float, when it is being used to create an index, which must be an integer.

**Correction:**

`k_sigma = np.zeros(2*self.nbin+1, 'float64')`

The second error is caused once again by an unnecessary decimal point in the index:

`File "/home/[APClogin]/montepython/montepython/likelihoods/euclid_pk/__init__.py", line 330, in integrand`

return self.k_fid[:]**2/(2.*pi)**2*((self.tilde_P_th[:,index_z,index_mu] - self.tilde_P_fid[:,index_z,index_mu])**2/((2./self.V_survey[index_z])*(self.tilde_P_th[:,index_z,index_mu] + self.P_shot[index_z])**2 + (self.alpha[:,2.*index_z+1,index_mu]*self.tilde_P_th[:,index_z,index_mu])**2

*self.k_fid[:]**3/2./pi**2

*self.nbin*log(self.kmax/self.kmin)))

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indice

**Correction:**

`return self.k_fid[:]**2/(2.*pi)**2*((self.tilde_P_th[:,index_z,index_mu] - self.tilde_P_fid[:,index_z,index_mu])**2/((2/self.V_survey[index_z])*`

(self.tilde_P_th[:,index_z,index_mu] + self.P_shot[index_z])**2 + (self.alpha[:,2*index_z+1,index_mu]*self.tilde_P_th[:,index_z,index_mu])**2

*self.k_fid[:]**3/2./pi**2*

self.nbin*log(self.kmax/self.kmin)))

## Leave a Reply