Skip to content
Snippets Groups Projects
Commit 4822e7a2 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Update boundary check

parent 947e9144
No related branches found
No related tags found
No related merge requests found
......@@ -694,7 +694,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.6"
}
},
"nbformat": 4,
......
......@@ -134,16 +134,14 @@ def pcv(place_code, viewing_directions):
should be 1'.format(place_code.shape[component_dim]))
elevation = viewing_directions[..., __spherical_indeces__['elevation']]
azimuth = viewing_directions[..., __spherical_indeces__['azimuth']]
if (np.any(elevation < -np.pi / 2) or np.any(elevation > np.pi / 2)):
# if (np.any(elevation < -2*np.pi) or np.any(elevation > 2*np.pi)):
raise ValueError(" Elevation must be radians in range [-2*pi;2*pi]")
if (np.max(elevation) - np.min(elevation) > 2 * np.pi):
if (np.any(elevation <= -np.pi) or np.any(elevation >= np.pi)):
raise ValueError(" Elevation must be radians in range [-pi;pi]")
if (np.max(elevation) - np.min(elevation) >= 2 * np.pi):
raise ValueError(" max difference in elevation must be < 2*pi")
if (np.any(azimuth < -np.pi) or np.any(azimuth > np.pi)):
# if (np.any(azimuth < -2*np.pi) or np.any(azimuth > np.pi*2)):
if (np.any(azimuth <= -2*np.pi) or np.any(azimuth >= 2*np.pi)):
raise ValueError(" Azimuth must be radians in range [-2*pi;2*pi]")
if (np.max(azimuth) - np.min(azimuth) > 2 * np.pi):
raise ValueError(" max difference in azimuth must be < 2*pi")
raise ValueError(" max difference in azimuth must be <= 2*pi")
x, y, z = spherical_to_cartesian(elevation, azimuth, radius=1)
unscaled_lv = np.zeros((viewing_directions.shape[0],
viewing_directions.shape[1],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment