Relax requirement on polar/azimuthal axis for wwinp conversion (#3307)

This commit is contained in:
Paul Romano 2025-02-19 07:48:39 -06:00 committed by GitHub
parent d96e6860e6
commit 06a88526cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -513,9 +513,19 @@ def wwinp_to_wws(path: PathLike) -> list[WeightWindows]:
line_arr = np.fromstring(wwinp.readline(), sep=' ')
xyz2 = line_arr[:3]
# oriented polar and azimuthal vectors aren't yet supported
if np.count_nonzero(xyz1) or np.count_nonzero(xyz2):
raise NotImplementedError('Custom sphere/cylinder orientations are not supported')
# Get polar and azimuthal axes
polar_axis = xyz1 - xyz0
azimuthal_axis = xyz2 - xyz0
# Check for polar axis other than (0, 0, 1)
norm = np.linalg.norm(polar_axis)
if not np.isclose(polar_axis[2]/norm, 1.0):
raise NotImplementedError('Polar axis not aligned to z-axis not supported')
# Check for azimuthal axis other than (1, 0, 0)
norm = np.linalg.norm(azimuthal_axis)
if not np.isclose(azimuthal_axis[0]/norm, 1.0):
raise NotImplementedError('Azimuthal axis not aligned to x-axis not supported')
# read geometry type
nwg = int(line_arr[-1])

View file

@ -2,7 +2,7 @@
1
8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001
2.0000 2.0000 4.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 2.0000
1.0000 0.0000 -9.0001 2.0000
0.0000 3.0000 3.0200 1.0000 5.0000 6.0001
1.0000
0.0000 4.0000 8.0080 1.0000 3.0000 14.002

View file

@ -2,7 +2,7 @@
1
8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001
2.0000 4.0000 4.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 3.0000
1.0000 0.0000 -9.0001 3.0000
0.0000 3.0000 3.0200 1.0000 5.0000 6.0001
1.0000
0.0000 2.0000 0.25000 1.0000 1.0000 0.50000