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

Update boundary check

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