Bug #4293
IndexError in Cosmo
Start date:
07/04/2013
Due date:
% Done:
0%
Estimated time:
Description
I fixed some obvious bugs in Cosmo (incorrect archive addresses). Now this surfaced:
Config Structure not supplied. Going to paramfile ... ('Omega_m = ', 0.3) ('Omega_l = ', 0.6999152476484926) ('h = ', 0.7) ('n = ', 1.0) ('w_0 = ', -0.95) ('w_a = ', 0.0) Config Structure not supplied. Going to paramfile ... ('Omega_m = ', 0.3) ('Omega_l = ', 0.6999152476484926) ('h = ', 0.7) ('n = ', 1.0) ('w_0 = ', -0.95) ('w_a = ', 0.0) CORRELATED CASE ---------------------------------------------------------------------------- IndexError Traceback (most recent call last) /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where) 176 else: 177 filename = fname --> 178 __builtin__.execfile(filename, *where) /Users/ben/Documents/DESpec/repo/despec/10-EstimateCosmologyParameters/EstimateCosmologyParameters_Nicola/EstimateCosmologyParameters.py in <module>() 195 196 print("CORRELATED CASE") --> 197 fisher_matrix_corr, fisher_matrix_red = fiducial.fisher_corr(param_list1, param_list2, no_of_bins, l_max, n_param, f_sky, n_A, survey) 198 fisher_matrix_corr = fisher_matrix_corr[:, [0,1,2,3,4,5]] # Changed (AN) June 20, 2013: Marginalise over power spectrum amplitude 199 fisher_matrix_corr = fisher_matrix_corr[[0,1,2,3,4,5], :] /Users/ben/Documents/DESpec/repo/despec/10-EstimateCosmologyParameters/EstimateCosmologyParameters_Nicola/PyCosmo_params.py in fisher_corr(self, param_list1, param_list2, no_of_bins, l_max, n_param, f_sky, n_A, survey) 682 normalisation = 0 683 for i in range(1, no_of_bins+1): --> 684 normalisation = normalisation + scipy.integrate.quad(lambda x: self.W_Bin_true_tab(i-1, numpy.ones(no_of_bins), survey, z=x), bin_edge[2*i-2], bin_edge[2*i-1])[0] 685 delattr(self, 'W_Bin_true_interp_z') 686 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/integrate/quadpack.pyc in quad(func, a, b, args, full_output, epsabs, epsrel, limit, points, weight, wvar, wopts, maxp1, limlst) 246 if type(args) != type(()): args = (args,) 247 if (weight is None): --> 248 retval = _quad(func,a,b,args,full_output,epsabs,epsrel,limit,points) 249 else: 250 retval = _quad_weight(func,a,b,args,full_output,epsabs,epsrel,limlst,limit,maxp1,weight,wvar,wopts) /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/integrate/quadpack.pyc in _quad(func, a, b, args, full_output, epsabs, epsrel, limit, points) 311 if points is None: 312 if infbounds == 0: --> 313 return _quadpack._qagse(func,a,b,args,full_output,epsabs,epsrel,limit) 314 else: 315 return _quadpack._qagie(func,bound,infbounds,args,full_output,epsabs,epsrel,limit) /Users/ben/Documents/DESpec/repo/despec/10-EstimateCosmologyParameters/EstimateCosmologyParameters_Nicola/PyCosmo_params.py in <lambda>(x) 682 normalisation = 0 683 for i in range(1, no_of_bins+1): --> 684 normalisation = normalisation + scipy.integrate.quad(lambda x: self.W_Bin_true_tab(i-1, numpy.ones(no_of_bins), survey, z=x), bin_edge[2*i-2], bin_edge[2*i-1])[0] 685 delattr(self, 'W_Bin_true_interp_z') 686 /Users/ben/Documents/DESpec/repo/despec/10-EstimateCosmologyParameters/EstimateCosmologyParameters_Nicola/PyCosmo_params.py in W_Bin_true_tab(self, bin_no, normalisations, survey, z) 176 self.W_Bin_true_interp_z = [0 for j in range(no_of_bins)] 177 for i in range(0, no_of_bins): --> 178 self.W_Bin_true_interp_z[i] = interpolate.interp1d(bin_centers[i,:], true_hist[i, :]/normalisations[i], bounds_error=False, fill_value=0.) 179 return self.W_Bin_true_interp_z[bin_no](z) 180 IndexError: too many indices
Please fix.