voxcity.simulator_gpu.visibility.view.ViewCalculator

class voxcity.simulator_gpu.visibility.view.ViewCalculator(domain, n_azimuth: int = 120, n_elevation: int = 20, ray_sampling: str = 'grid', n_rays: int = None)

GPU-accelerated View Index calculator.

Computes view indices (green view, sky view, custom targets) by tracing rays from observer positions through the voxel domain.

domain
nx
ny
nz
dx
dy
dz
n_azimuth = 120
n_elevation = 20
ray_sampling = 'grid'
n_rays
max_dist
compute_view_index(voxel_data: numpy.ndarray = None, mode: str = None, hit_values: Tuple[int, Ellipsis] = None, inclusion_mode: bool = True, view_point_height: float = 1.5, elevation_min_degrees: float = -30.0, elevation_max_degrees: float = 30.0, tree_k: float = 0.5, tree_lad: float = 1.0, workspace=None, computation_mask: numpy.ndarray = None) numpy.ndarray

Compute View Index map.

Parameters:
  • voxel_data – 3D voxel class array (optional if domain has voxel data)

  • mode – Predefined mode (‘green’, ‘sky’, or None for custom)

  • hit_values – Target voxel values to count as visible

  • inclusion_mode – If True, count hits on targets; if False, count non-blocked rays

  • view_point_height – Observer height above ground (meters)

  • elevation_min_degrees – Minimum viewing angle

  • elevation_max_degrees – Maximum viewing angle

  • tree_k – Tree extinction coefficient

  • tree_lad – Leaf area density for trees

  • workspace – Optional pre-allocated ViewWorkspace whose Taichi fields are reused instead of allocating new ones on every call.

Returns:

2D array of view index values (nx, ny)

compute_sky_view_factor(voxel_data: numpy.ndarray = None, view_point_height: float = 1.5, n_azimuth: int = 120, n_elevation: int = 20, tree_k: float = 0.6, tree_lad: float = 1.0) numpy.ndarray

Compute Sky View Factor map.

Parameters:
  • voxel_data – 3D voxel class array (optional)

  • view_point_height – Observer height above ground (meters)

  • n_azimuth – Number of azimuthal divisions

  • n_elevation – Number of elevation divisions

  • tree_k – Tree extinction coefficient

  • tree_lad – Leaf area density

Returns:

2D array of SVF values (nx, ny)