openworld_radio_twin.simulation.building_grid#

Functions

prepare_surface_building_rasters(buildings, ...)

Keep the surface's building-raster file when it holds the current rasters, else write it.

rasterize_building_footprints(buildings, ...)

Sample the vertical building projection on exact grid cell centers.

rasterize_building_heights(buildings, ...[, ...])

Sample building occupancy at one AGL plane on exact grid cell centers.

supersample_building_mask(buildings, ...[, ...])

Sample building occupancy at one AGL plane on factor x factor points per cell.

surface_building_rasters(buildings, surface, ...)

Sample buildings at the cell centres of a measurement surface, rows south to north.

openworld_radio_twin.simulation.building_grid.rasterize_building_heights(buildings, mapping, width, height, receiver_height_agl_m, environment=None)[source]#

Sample building occupancy at one AGL plane on exact grid cell centers.

Return type:

tuple[ndarray, ndarray]

openworld_radio_twin.simulation.building_grid.supersample_building_mask(buildings, mapping, width, height, receiver_height_agl_m, factor, environment=None)[source]#

Sample building occupancy at one AGL plane on factor x factor points per cell.

The points are the centres of an even split of each cell, so the mask has height * factor rows and width * factor columns in the mapping’s row order.

Return type:

ndarray

openworld_radio_twin.simulation.building_grid.rasterize_building_footprints(buildings, mapping, width, height)[source]#

Sample the vertical building projection on exact grid cell centers.

Return type:

ndarray

openworld_radio_twin.simulation.building_grid.surface_building_rasters(buildings, surface, origin_longitude, origin_latitude, receiver_height_agl_m, environment=None)[source]#

Sample buildings at the cell centres of a measurement surface, rows south to north.

footprint_mask marks cells whose centre lies in the vertical projection of a building, roof_height_agl_m holds the roof height above ground as the height map computes it (NaN where there is no building), and receiver_in_building_mask marks cells whose receiver point lies inside a building. With the scene’s environment the samples follow the terrain, as the radio view’s building mask does.

Return type:

dict[str, ndarray]

openworld_radio_twin.simulation.building_grid.prepare_surface_building_rasters(buildings, surface, origin_longitude, origin_latitude, receiver_height_agl_m, environment=None)[source]#

Keep the surface’s building-raster file when it holds the current rasters, else write it.

The rasters are always computed from the given buildings and terrain; the stored file is kept untouched only when it holds exactly these arrays, so re-fetched buildings or terrain replace it.

Return type:

Path