openworld_radio_twin.simulation.radio_map#

Functions

array_grid_mapping(request, data)

Grid of the stored radio arrays: the first sample is the south-west cell centre.

build_coverage_grid(request, data, buildings)

build_coverage_products(request, data, buildings)

Create the north-up JSON view from the same canonical arrays used for export.

finite_max(values, axis)

Reduce finite values while preserving an all-missing cell as NaN.

normalize_solver_arrays(path_gain, rss, ...)

Normalize a solver result to float32 and south-to-north row order.

pack_path_gain(path_gain)

Pack linear path gain into the stored little-endian uint16 dB values.

serving_transmitter(path_gain, rss, sinr, metric)

Return the int32 serving transmitter of each cell under metric.

sinr_from_rss(rss, noise_power_w)

Return each transmitter's float32 SINR: its RSS over the other RSS plus noise.

unpack_path_gain(packed)

Return the linear float32 path gain of packed values; the fill value gives 0.

Classes

CoverageProducts(coverage, building_mask, ...)

MetricDefinition(label, unit, ...)

RadioMapData(path_gain, rss, sinr, ...[, ...])

Canonical solver products using the reference package's array contract.

class openworld_radio_twin.simulation.radio_map.MetricDefinition(label, unit, logarithmic_offset_db)[source]#

Bases: object

label: str#
unit: str#
logarithmic_offset_db: float#
class openworld_radio_twin.simulation.radio_map.CoverageProducts(coverage, building_mask, building_heights_m)[source]#

Bases: object

coverage: CoverageGrid#
building_mask: ndarray#
building_heights_m: ndarray#
openworld_radio_twin.simulation.radio_map.finite_max(values, axis)[source]#

Reduce finite values while preserving an all-missing cell as NaN.

Return type:

ndarray

class openworld_radio_twin.simulation.radio_map.RadioMapData(path_gain, rss, sinr, association, cell_centers, sample_layout='cell_average')[source]#

Bases: object

Canonical solver products using the reference package’s array contract.

All metric arrays are finite, non-negative linear float32 values with shape (n_tx, rows, columns); 0 means no coverage. Row zero is the south edge so the arrays can be plotted with origin="lower", exactly as in reference/package. Coordinates are local ENU meters.

path_gain: ndarray#
rss: ndarray#
sinr: ndarray#
association: ndarray#
cell_centers: ndarray#
sample_layout: str = 'cell_average'#
property shape: tuple[int, int, int]#
property transmitter_count: int#
property rows: int#
property columns: int#
linear(metric)[source]#
Return type:

ndarray

best_db(metric, *, zero_floor=False)[source]#
Return type:

ndarray

openworld_radio_twin.simulation.radio_map.sinr_from_rss(rss, noise_power_w)[source]#

Return each transmitter’s float32 SINR: its RSS over the other RSS plus noise.

The other transmitters are summed directly in float64: subtracting the desired power from the total can erase weak interference when the desired signal is much stronger.

Return type:

ndarray

openworld_radio_twin.simulation.radio_map.serving_transmitter(path_gain, rss, sinr, metric)[source]#

Return the int32 serving transmitter of each cell under metric.

The transmitter with the largest value serves the cell, the first one on a tie; a cell where no transmitter has a positive value gets ASSOCIATION_NO_SERVICE.

Return type:

ndarray

openworld_radio_twin.simulation.radio_map.pack_path_gain(path_gain)[source]#

Pack linear path gain into the stored little-endian uint16 dB values.

A positive gain becomes round((10 * log10(gain) - add_offset) / scale_factor), rounded half to even, and 0 becomes the fill value. Negative or non-finite gains, and gains whose packed value falls outside the valid range, raise ValueError instead of being clipped.

Return type:

ndarray

openworld_radio_twin.simulation.radio_map.unpack_path_gain(packed)[source]#

Return the linear float32 path gain of packed values; the fill value gives 0.

Return type:

ndarray

openworld_radio_twin.simulation.radio_map.normalize_solver_arrays(path_gain, rss, sinr, association, cell_centers)[source]#

Normalize a solver result to float32 and south-to-north row order.

Return type:

RadioMapData

openworld_radio_twin.simulation.radio_map.array_grid_mapping(request, data)[source]#

Grid of the stored radio arrays: the first sample is the south-west cell centre.

Rows run south to north, so row_step_m is positive. The north-up images are these arrays flipped; the web view’s CoverageGrid.grid_mapping starts at the north-west cell centre instead.

Return type:

GridMapping

openworld_radio_twin.simulation.radio_map.build_coverage_grid(request, data, buildings, environment=None)[source]#
Return type:

CoverageGrid

openworld_radio_twin.simulation.radio_map.build_coverage_products(request, data, buildings, environment=None)[source]#

Create the north-up JSON view from the same canonical arrays used for export.

Return type:

CoverageProducts