@@ -100,9 +100,7 @@ class WeightWindows(ObjectSingleton):
100100 Nz : int
101101
102102 # reference vector for calculating mu and azimuthal angle
103- px : float
104- py : float
105- pz : float
103+ polar_reference : Annotated [NDArray [np .float64 ], (3 ,)]
106104
107105 # arrays of ww params
108106 lower_weights : Annotated [
@@ -128,9 +126,7 @@ def __init__(self):
128126 self .mesh_ID = - 1 # skirt around having to create a MeshBase instance
129127 self .Nx , self .Ny , self .Nz = 1 , 1 , 1
130128 self .Nt = 1
131- self .px = 0.0
132- self .py = 0.0
133- self .pz = 1.0
129+ self .polar_reference = np .array ([0.0 , 0.0 , 1.0 ])
134130 shape = (self .Nt , self .Ne , self .Nmu , self .Na , self .Nx , self .Ny , self .Nz )
135131 self .lower_weights = np .array ([1.0 ]).reshape (* shape )
136132 self .target_weights = np .array ([1.0 ]).reshape (* shape )
@@ -217,10 +213,8 @@ def __call__(
217213 )
218214
219215 def set_polar_reference (self , px , py , pz ):
220- norm = np .linalg .norm ([px , py , pz ])
221- self .px = px / norm
222- self .py = py / norm
223- self .pz = pz / norm
216+ polar_reference = np .array ([px , py , pz ])
217+ self .polar_reference = polar_reference / np .linalg .norm (polar_reference )
224218
225219 @staticmethod
226220 def __check_array (array : NDArray [np .float64 ], name : str ):
0 commit comments