@@ -550,16 +550,8 @@ def DDF_radial_image(points_array_w_rphi, radius, Rshape, tol=1):
550550
551551 radialimage = np .zeros (shape = Rshape )
552552
553- for i in range (Rshape [0 ]):
554- for j in range (Rshape [1 ]):
555- radialimage [i , j ] = np .where (
556- np .logical_and (
557- radial_filtered_points_array [:, 3 ] == i ,
558- radial_filtered_points_array [:, 4 ] == j ,
559- ),
560- radial_filtered_points_array [:, 2 ],
561- 0 ,
562- ).sum ()
553+ for line in radial_filtered_points_array :
554+ radialimage [int (line [3 ]), int (line [4 ])] += line [2 ]
563555
564556 return radialimage
565557
@@ -612,14 +604,7 @@ def DDFradialazimuthimage(points_array_w_rphi, radius, phi0, phi1, Rshape, tol=1
612604 )
613605 radiusazimuthimage = np .zeros (shape = Rshape )
614606
615- for i in range (Rshape [0 ]):
616- for j in range (Rshape [1 ]):
617- radiusazimuthimage [i , j ] = np .where (
618- np .logical_and (
619- rphi_filtered_points_array [:, 3 ] == i ,
620- rphi_filtered_points_array [:, 4 ] == j ,
621- ),
622- rphi_filtered_points_array [:, 2 ],
623- 0 ,
624- ).sum ()
607+ for line in rphi_filtered_points_array :
608+ radiusazimuthimage [int (line [3 ]), int (line [4 ])] += line [2 ]
609+
625610 return radiusazimuthimage
0 commit comments