Skip to content

Commit cdd693c

Browse files
author
Yossi Synett
committed
chapter 5 - fix bug in main score for multiple halos
1 parent 45efc52 commit cdd693c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Chapter5_LossFunctions/DarkWorldsMetric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ def main_score( nhalo_all, x_true_all, y_true_all, x_ref_all, y_ref_all, sky_pre
205205
x_predicted=np.array([],dtype=float)
206206
y_predicted=np.array([],dtype=float)
207207
for i in range(nhalo):
208-
x_predicted=np.append(x_predicted,float(sky[0])) #get the predicted values
209-
y_predicted=np.append(y_predicted,float(sky[1]))
208+
x_predicted=np.append(x_predicted,float(sky[2*i])) #get the predicted values
209+
y_predicted=np.append(y_predicted,float(sky[2*i+1]))
210210
#The solution file for the test data provides masses
211211
#to calculate the centre of mass where as the Training_halo.csv
212212
#direct provides x_ref y_ref. So in the case of test data

0 commit comments

Comments
 (0)