voxcity.simulator_gpu.solar.svf =============================== .. py:module:: voxcity.simulator_gpu.solar.svf .. autoapi-nested-parse:: Sky View Factor (SVF) calculation for palm-solar. Computes the fraction of sky hemisphere visible from each surface element. Uses GPU-accelerated ray tracing to sample the hemisphere. Coordinate System: SVF calculations use a local ENU-style coordinate system for hemisphere sampling (x=East-like, y=North-like, z=Up). This is self-consistent within SVF and does not affect sun direction calculations. Direction indices follow PALM naming convention: - 0 (IUP): +z, upward-facing - 1 (IDOWN): -z, downward-facing - 2 (INORTH): +y normal (East-facing in geographic terms) - 3 (ISOUTH): -y normal (West-facing in geographic terms) - 4 (IEAST): +x normal (South-facing in geographic terms) - 5 (IWEST): -x normal (North-facing in geographic terms) PALM Alignment: - Uses PALM's vffrac_up formula: (cos(2*elev_low) - cos(2*elev_high)) / (2*n_azim) - Default discretization: n_azimuth=80, n_elevation=40 (PALM defaults) - svf output is equivalent to PALM's skyvft (transmissivity-weighted sky view factor) - svf_urban output is equivalent to PALM's skyvf (urban-only, no canopy) - Ray accumulation: SUM(vffrac * trans) matching PALM's methodology PALM: skyvft = SUM(ztransp * vffrac, MASK=(itarget < 0)) Classes ------- .. toctree:: :hidden: /autoapi/voxcity/simulator_gpu/solar/svf/SVFCalculator .. autoapisummary:: voxcity.simulator_gpu.solar.svf.SVFCalculator Functions --------- .. autoapisummary:: voxcity.simulator_gpu.solar.svf.compute_svf_grid_kernel Module Contents --------------- .. py:function:: compute_svf_grid_kernel(topo_top: ti.template(), is_solid: ti.template(), directions: ti.template(), solid_angles: ti.template(), nx: taichi.i32, ny: taichi.i32, nz: taichi.i32, dx: taichi.f32, dy: taichi.f32, dz: taichi.f32, n_azim: taichi.i32, n_elev: taichi.i32, max_dist: taichi.f32, svf_grid: ti.template()) Compute SVF for a 2D grid at terrain level. svf_grid[i, j] = SVF at terrain surface (i, j)