### Compare Installation Commands Source: https://deepmimo.net/docs/tutorials/8_migration_guide.html Installation syntax differences between v3 and v4 packages. ```bash # v3: pip install deepmimov3 # v4: pip install --pre deepmimo print("v3: pip install DeepMIMOv3") print("v4: pip install --pre deepmimo") ``` -------------------------------- ### Install Sionna dependency Source: https://deepmimo.net/docs/tutorials/manual.html Install the specific version of Sionna required for the provided ray tracing examples. ```bash # pip install sionna==0.19.1 ``` -------------------------------- ### Start MkDocs Live Preview Source: https://deepmimo.net/docs/resources/workflow.html Use this command to start the live preview server for MkDocs in the repository root. ```bash mkdocs serve ``` -------------------------------- ### Install Development Dependencies Source: https://deepmimo.net/docs/resources/contributing.html Install the 'uv' package manager and then install the project's development dependencies in editable mode. ```bash pip install uv uv pip install -e ".[dev]" ``` -------------------------------- ### Install DeepMIMO from Source Source: https://deepmimo.net/docs/installation.html Clone the repository and install DeepMIMO locally from its source code. ```bash git clone https://github.com/DeepMIMO/DeepMIMO.git cd DeepMIMO pip install . ``` -------------------------------- ### Complete Installation Source: https://deepmimo.net/docs/installation.html Installs DeepMIMO with all available dependencies for a complete setup. Compatible with Python 3.10 or 3.11. ```bash pip install .[all] ``` -------------------------------- ### Quick Install DeepMIMO Source: https://deepmimo.net/docs/installation.html Use this command for a straightforward installation of the DeepMIMO package. ```bash pip install deepmimo ``` -------------------------------- ### Install and Initialize DeepMIMO Source: https://deepmimo.net/docs/tutorials/manual.html Install the library via pip and load a specific scenario dataset for use. ```python # Install DeepMIMO (run this in your terminal or uncomment to run here) # pip install --pre deepmimo # Import manual-wide dependencies import matplotlib.pyplot as plt import numpy as np import deepmimo as dm # Load example scenario scen_name = "asu_campus_3p5" dm.download(scen_name) dataset = dm.load(scen_name) ``` -------------------------------- ### Full Development Environment Install Source: https://deepmimo.net/docs/installation.html Installs DeepMIMO with all development dependencies, including documentation. ```bash pip install .[dev] ``` -------------------------------- ### Install with uv package manager Source: https://deepmimo.net/docs/installation.html Installs the 'uv' package manager and then uses it to install DeepMIMO dependencies. ```bash pip install uv uv pip install <...> ``` -------------------------------- ### Install DeepMIMO Environment Source: https://deepmimo.net/docs/tutorials/manual.html Commands to create a dedicated environment and install the DeepMIMO package. ```bash mamba create -n deepmimo_env python=3.11 expat=2.5.0 mamba activate deepmimo_env ``` -------------------------------- ### Get scenario summary Source: https://deepmimo.net/docs/tutorials/1_getting_started.html Uses the DeepMIMO library to output a detailed summary of the ray-tracing configuration, scene, materials, and TX/RX setup. ```python # Get scenario summary print("Scenario Summary:") dm.summary(city_scen) ``` -------------------------------- ### Initialize ChannelParameters Source: https://deepmimo.net/docs/api/generator.html Examples of initializing channel parameters with default, specific, or nested configurations. ```python params = ChannelParameters() ``` ```python params = ChannelParameters(doppler=True, freq_domain=True) ``` ```python params = ChannelParameters(bs_antenna={"shape": [4, 4]}) ``` -------------------------------- ### Install DeepMIMO Source: https://deepmimo.net/docs/tutorials/index.html Install the DeepMIMO package using pip. ```bash pip install --pre deepmimo ``` -------------------------------- ### Compute and Visualize Channel Magnitude Response Source: https://deepmimo.net/docs/tutorials/manual.html Configures channel parameters including the number of paths and selected subcarriers, computes the channels, and then visualizes the channel magnitude response. This example highlights the setup for generating channels with a specific number of subcarriers. ```python ch_params = dm.ChannelParameters() ch_params.num_paths = 5 ch_params.ofdm.bandwidth = 50e6 ch_params.ofdm.selected_subcarriers = np.arange(64) # Which subcarriers to generate channels = dataset.compute_channels(ch_params) user_idx = np.where(dataset.n_paths > 0)[0][0] plt.imshow(np.abs(np.squeeze(channels[user_idx]).T)) plt.title("Channel Magnitude Response") plt.xlabel("TX Antennas") plt.ylabel("Subcarriers") plt.show() ``` -------------------------------- ### Install Ray Tracing Pipeline (Sionna 1.0.x) Source: https://deepmimo.net/docs/installation.html Installs the ray tracing pipeline using Sionna version 1.0.x. Compatible with Python 3.10 or 3.11. ```bash pip install .[sionna1] ``` -------------------------------- ### Install Ray Tracing Pipeline (Sionna 0.19.x) Source: https://deepmimo.net/docs/installation.html Installs the ray tracing pipeline using Sionna version 0.19.x. Compatible with Python 3.10 or 3.11. ```bash pip install .[sionna019] ``` -------------------------------- ### Install DeepMIMO v3 Source: https://deepmimo.net/docs/tutorials/manual.html Install the DeepMIMO v3 package. This is a specific version for migration purposes. ```bash # pip install deepmimov3 ``` -------------------------------- ### Generate frequency-domain channels Source: https://deepmimo.net/docs/api/generator.html Example of configuring parameters for frequency-domain channel generation. ```python params.doppler = False params.freq_domain = True channels = dataset.compute_channels(params) ``` -------------------------------- ### Run Tutorial Source: https://deepmimo.net/docs/tutorials/index.html Execute a downloaded tutorial script using the Python interpreter. ```bash python 1_getting_started.py ``` -------------------------------- ### Get Help for Any Function with dm.info() Source: https://deepmimo.net/docs/tutorials/1_getting_started.html Use `dm.info()` to get help or view the docstring for any function within the DeepMIMO module. This example shows how to get help for `dm.download`. ```python # Get help for any function # dm.info(dm.download) # Uncomment to view docstring print("Use dm.info(dm.download) to view the docstring of any function") ``` -------------------------------- ### Run All Tutorial Tests Source: https://deepmimo.net/docs/resources/workflow.html Execute all tutorial tests by specifying the tutorial directory. This command takes approximately 6 minutes. ```bash uv run pytest tests/tutorials/ ``` -------------------------------- ### Import Libraries and Configure Matplotlib Source: https://deepmimo.net/docs/tutorials/6_beamforming.html Imports necessary libraries like matplotlib and numpy, and sets a configuration for matplotlib to avoid memory warnings. This is a common setup for DeepMIMO examples. ```python import matplotlib.pyplot as plt import numpy as np import deepmimo as dm # Set figure limit to avoid memory warnings plt.rcParams["figure.max_open_warning"] = 0 ``` -------------------------------- ### Download Tutorial Source: https://deepmimo.net/docs/tutorials/index.html Download a specific tutorial file from the DeepMIMO GitHub repository. ```bash wget https://raw.githubusercontent.com/DeepMIMO/DeepMIMO/main/docs/tutorials/1_getting_started.py ``` -------------------------------- ### Run Tutorial Tests using Marker Source: https://deepmimo.net/docs/resources/workflow.html Alternative method to run all tutorial tests by using the 'tutorial' marker. ```bash uv run pytest -m tutorial ``` -------------------------------- ### Export Sionna RT Simulation Data to DeepMIMO Format Source: https://deepmimo.net/docs/tutorials/7_converters.html This example shows how to export ray tracing paths computed by Sionna RT into the DeepMIMO format. It requires Sionna RT to be installed and configured, and should be integrated into your Sionna RT simulation script. ```python # Example: Export from Sionna RT to DeepMIMO # NOTE: This requires Sionna RT to be installed and configured # In your Sionna RT script, use the exporter: example_code = """ # In Sionna: from deepmimo.converters import sionna_exporter # After running your Sionna RT simulation: paths = scene.compute_paths() # Export to DeepMIMO format sionna_exporter( paths=paths, output_dir=\ ``` ```python ./deepmimo_output\", scenario_name="my_sionna_scenario" ) """ print("Sionna RT exporter example:") print(example_code) ``` -------------------------------- ### Run a Specific Tutorial Test Source: https://deepmimo.net/docs/resources/workflow.html Execute a single, specific tutorial test file by providing its path. ```bash uv run pytest tests/tutorials/test_1_getting_started.py ``` -------------------------------- ### Run Tutorial Directly Source: https://deepmimo.net/docs/resources/workflow.html Execute a tutorial Python file directly, not as part of a test suite. ```bash uv run python docs/tutorials/1_getting_started.py ``` -------------------------------- ### Class Docstring Example Source: https://deepmimo.net/docs/resources/contributing.html Example of a class docstring, detailing its purpose, functionality, attributes, and usage examples. ```python class ClassName: """Brief description of class purpose. Detailed explanation of class functionality and usage. Attributes: attr1 (type): Description of attr1 attr2 (type): Description of attr2 Example: >>> example usage code >>> more example code """ ``` -------------------------------- ### Run All Tutorial Tests with Output Capture Source: https://deepmimo.net/docs/resources/workflow.html Execute all tutorial tests while capturing and displaying their output using the '-s' flag. ```bash uv run pytest -s tests/tutorials/ ``` -------------------------------- ### Install AODT Dependencies Source: https://deepmimo.net/docs/api/converter.html Installs the necessary dependencies for AODT support. ```bash pip install --pre deepmimo[aodt] ``` -------------------------------- ### Install DeepMIMO Source: https://deepmimo.net/docs/tutorials/1_getting_started.html Use this command to install the DeepMIMO package via pip. ```python # Install DeepMIMO (if not already installed) %pip install --pre deepmimo ``` -------------------------------- ### Initialize DeepMIMO Environment Source: https://deepmimo.net/docs/tutorials/2_visualization.html Import necessary libraries and load a specific scenario dataset. ```python # Import libraries import matplotlib.pyplot as plt import numpy as np import deepmimo as dm ``` ```python # Load dataset scen_name = "asu_campus_3p5" dm.download(scen_name) dataset = dm.load(scen_name) ``` -------------------------------- ### Install AODT Features Source: https://deepmimo.net/docs/tutorials/5_doppler_mobility.html Command to install optional dependencies for AODT features. ```bash pip install 'deepmimo[aodt]' ``` -------------------------------- ### DeepMIMO Basic Configuration Usage Source: https://deepmimo.net/docs/api/config.html Demonstrates setting configuration values using parameter names and keywords, retrieving a value, printing the current configuration, and resetting to defaults. Ensure `deepmimo` is imported as `dm`. ```python import deepmimo as dm # Set with parameter names dm.config('sionna_version', '0.19.1') # Set with keywords dm.config(use_gpu=True, gpu_device_id=1) # Get current value dm.config('ray_tracer_version') # Print current config dm.config() # Reset to defaults dm.config.reset() ``` -------------------------------- ### Code Organization Example Source: https://deepmimo.net/docs/resources/contributing.html Illustrates a recommended code organization structure, including import order, constants, helper functions, and main classes. ```python """Module docstring.""" # Standard library imports import os import sys # Third-party imports import numpy as np import scipy # Local imports from . import utils from .core import Core #------------------------------------------------------------------------------ # Constants #------------------------------------------------------------------------------ CONSTANT_1 = value1 CONSTANT_2 = value2 #------------------------------------------------------------------------------ # Helper Functions #------------------------------------------------------------------------------ def helper_function(): """Helper function docstring.""" pass #------------------------------------------------------------------------------ # Main Classes #------------------------------------------------------------------------------ class MainClass: """Main class docstring.""" pass ``` -------------------------------- ### Build MkDocs Documentation Source: https://deepmimo.net/docs/resources/workflow.html Command to build the MkDocs documentation site. This will execute tutorials if enabled in mkdocs.yml. ```bash mkdocs build ``` -------------------------------- ### Install AODT Dependencies Source: https://deepmimo.net/docs/tutorials/manual.html Installs the necessary dependencies for AODT support within the DeepMIMO environment. ```bash # Install DeepMIMO in the Notebook (with AODT dependencies) # pip install --pre deepmimo[aodt] ``` -------------------------------- ### Create and Manipulate a Scene Source: https://deepmimo.net/docs/api/core.html Demonstrates how to create a new scene, add objects to it, retrieve objects by category, and visualize the scene. Ensure necessary objects like 'building', 'tree1', and 'tree2' are defined before use. ```python import deepmimo as dm # Create a new scene scene = dm.Scene() # Add objects scene.add_object(building) scene.add_objects([tree1, tree2]) # Get objects by category buildings = scene.get_objects(label='buildings') metal_objects = scene.get_objects(material=1) # material_id = 1 # 3D visualization scene.plot(mode='faces') ``` -------------------------------- ### Install DeepMIMO Python Package Source: https://deepmimo.net/get-started Use pip to install the DeepMIMO package and its minimal dependencies. ```bash 1pip install deepmimo ``` -------------------------------- ### Install Specific Previous Version of DeepMIMO Source: https://deepmimo.net/docs/installation.html Installs a specific previous version of the DeepMIMO package, such as v2.0.0 or v3.0.0. ```bash pip install deepmimo==2.0.0 ``` ```bash pip install deepmimo==3.0.0 ``` -------------------------------- ### Configure Sionna scene and compute paths Source: https://deepmimo.net/docs/tutorials/manual.html Setup a Sionna scene with transmitters and receivers, and define parameters for path computation. ```python from typing import Any import matplotlib.pyplot as plt import numpy as np import sionna from sionna.rt import DirectivePattern, PlanarArray, Receiver, Transmitter, load_scene from tqdm import tqdm def compute_array_combinations(arrays: list) -> np.ndarray: """Compute cartesian product combinations for array parameters.""" return np.stack(np.meshgrid(*arrays), -1).reshape(-1, len(arrays)) def gen_user_grid(box_corners: list, steps: list, box_offsets: list | None = None) -> np.ndarray: """Generate a grid of user positions. box_corners is = [bbox_min_corner, bbox_max_corner] steps = [x_step, y_step, z_step]. """ # Sample the ranges of coordinates ndim = len(box_corners[0]) dim_ranges = [] for dim in range(ndim): if steps[dim]: dim_range = np.arange(box_corners[0][dim], box_corners[1][dim], steps[dim]) else: dim_range = np.array([box_corners[0][dim]]) # select just the first limit dim_ranges.append(dim_range + box_offsets[dim] if box_offsets else 0) pos = compute_array_combinations(dim_ranges) print(f"Total positions generated: {pos.shape[0]}") return pos def create_base_scene(scene_path: str, center_frequency: float) -> Any: """Load a Sionna scene and apply frequency and array defaults.""" scene = load_scene(scene_path) scene.frequency = center_frequency scene.tx_array = PlanarArray( num_rows=1, num_cols=1, vertical_spacing=0.5, horizontal_spacing=0.5, pattern="iso", polarization="V", ) scene.rx_array = scene.tx_array scene.synthetic_array = True return scene # Save dict with compute path params to export later my_compute_path_params = { "max_depth": 5, "num_samples": 1e6, "scattering": False, "diffraction": False, } carrier_freq = 3.5 * 1e9 # Hz tx_pos = [-33, 11, 32.03] # 0- Create/Fetch scene and get buldings in the scene scene = create_base_scene(sionna.rt.scene.simple_street_canyon, center_frequency=carrier_freq) # 1- Compute TX position print("Computing BS position") scene.add(Transmitter(name="tx", position=tx_pos, orientation=[0, 0, 0])) # 2- Compute RXs positions print("Computing UEs positions") rxs = gen_user_grid( box_corners=[(-93, -60, 0), (93, 60, 0)], steps=[4, 4, 0], box_offsets=[0, 0, 2], ) # 3- Add the first batch of receivers to the scene n_rx = len(rxs) n_rx_in_scene = 10 # to compute in parallel print(f"Adding users to the scene ({n_rx_in_scene} at a time)") for rx_idx in range(n_rx_in_scene): scene.add(Receiver(name=f"rx_{rx_idx}", position=rxs[rx_idx], orientation=[0, 0, 0])) # 4- Enable scattering in the radio materials if my_compute_path_params["scattering"]: for rm in scene.radio_materials.values(): rm.scattering_coefficient = 1 / np.sqrt(3) # [0,1] rm.scattering_pattern = DirectivePattern(alpha_r=10) ``` -------------------------------- ### Initialize Ray Tracing Parameters Source: https://deepmimo.net/docs/api/core.html Configures ray tracing simulation settings. This includes maximum path depth, number of interactions, and minimum path gain. ```python import deepmimo as dm # Create ray tracing parameters rt_params = dm.RayTracingParameters( max_num_paths=25, max_num_interactions=5, min_path_gain=-160.0 ) ``` -------------------------------- ### Function Docstring Example Source: https://deepmimo.net/docs/resources/contributing.html Example of a function docstring following Google-style conventions, including arguments, return type, and potential exceptions. ```python def function_name(param1: type, param2: type = default) -> return_type: """Brief description of function purpose. Detailed explanation if needed. Args: param1 (type): Description of param1 param2 (type, optional): Description of param2. Defaults to default. Returns: return_type: Description of return value Raises: ErrorType: Description of when this error is raised """ ``` -------------------------------- ### Initialize channel parameters Source: https://deepmimo.net/docs/tutorials/manual.html Create and configure channel parameters, including antenna settings. ```python dm.ChannelParameters() ``` ```python # Create channel parameters with all options ch_params = dm.ChannelParameters() # Antenna parameters # Base station antenna parameters ch_params.bs_antenna.rotation = np.array([0, 0, 0]) # [az, el, pol] in degrees ch_params.bs_antenna.fov = np.array([360, 180]) # [az, el] in degrees ch_params.bs_antenna.shape = np.array([8, 1]) # [horizontal, vertical] elements ch_params.bs_antenna.spacing = 0.5 # Element spacing in wavelengths ``` -------------------------------- ### Import Dependencies and Load Scenario Source: https://deepmimo.net/docs/tutorials/manual.html Import necessary libraries and load an example DeepMIMO scenario. Ensure the scenario is downloaded before loading. ```python import matplotlib.pyplot as plt import numpy as np import deepmimo as dm # Load example scenario scen_name = "asu_campus_3p5" dm.download(scen_name) dataset = dm.load(scen_name) ``` -------------------------------- ### Module-Level Docstring Example Source: https://deepmimo.net/docs/resources/contributing.html Example of a module-level docstring, including a brief description, list of features, and the module's main role. ```python """ Module Name. Brief description of the module's purpose. This module provides: - Feature/responsibility 1 - Feature/responsibility 2 - Feature/responsibility 3 The module serves as [main role/purpose]. """ ``` -------------------------------- ### Define BS-UE Matrix File Patterns Source: https://deepmimo.net/docs/resources/specs.html Example file naming convention for BS to user grid matrices. ```text delay_t001_tx000_r000.mat # TX Set 1, BS 0 to RX Set 1 (users) delay_t001_tx001_r000.mat # TX Set 1, BS 1 to RX Set 1 (users) delay_t001_tx002_r000.mat # TX Set 1, BS 2 to RX Set 1 (users) ``` -------------------------------- ### Get Configuration Value Source: https://deepmimo.net/docs/api/config.html Use the `get` method to retrieve a configuration value by its key. An optional default value can be provided if the key does not exist. ```python get(key, default=None) ``` -------------------------------- ### Serve Legacy Sphinx HTML Build Source: https://deepmimo.net/docs/resources/workflow.html Serve the built Sphinx HTML documentation using Python's http.server. Ensure you are in the '_build/html' directory. ```bash python -m http.server --directory _build/html ``` -------------------------------- ### Configure Simulation Parameters Source: https://deepmimo.net/docs/applications/1_channel_prediction.html Sets up the scenario, antenna configuration, and sequence parameters for channel prediction. ```python RT_SCENARIO = "asu_campus_3p5" MAX_PATHS = 3 # Limit number of paths for simplicity # Antenna configuration NT = 2 # Number of transmit antennas NR = 1 # Number of receive antennas N_SUBCARRIERS = 1 # OFDM subcarriers # Sequence parameters SEQ_LENGTH = 60 # Target sequence length for channel prediction N_SEQUENCES_SAMPLE = 100 # Number of sequences to generate for demonstration INTERP_FACTOR = 10 # Points per segment for interpolation # Doppler parameters MAX_DOPPLER_HZ = 100 # Maximum Doppler shift [Hz] TIME_DELTA = 1e-3 # Time between samples [s] # Visualization SEED = 42 rng = np.random.default_rng(SEED) print("Configuration:") print(f" Scenario: {RT_SCENARIO}") print(f" Antennas: {NT}x{NR}") print(f" Sequence length: {SEQ_LENGTH}") print(f" Interpolation factor: {INTERP_FACTOR}") print(f" Max Doppler: {MAX_DOPPLER_HZ} Hz") ``` -------------------------------- ### Development Install DeepMIMO Source: https://deepmimo.net/docs/installation.html Install DeepMIMO with core dependencies for basic development. The -e flag ensures changes in the code are automatically reflected without reinstallation. ```bash pip install -e . ``` -------------------------------- ### Visualize Example Sequences on Map Source: https://deepmimo.net/docs/applications/1_channel_prediction.html Plots a specified number of example sequences on a map, showing user positions and connections. Requires the dataset and extracted sequences. ```python plt.figure(figsize=(12, 8), dpi=150) dataset.los.plot() n_plot = min(10, len(all_seqs)) for i in range(n_plot): seq = all_seqs[i] plt.plot( dataset.rx_pos[seq, 0], dataset.rx_pos[seq, 1], "o-", markersize=3, linewidth=2, label=f"Seq {i} ({len(seq)} users)", ) plt.title(f"Example Sequences (showing {n_plot} of {len(all_seqs)})") plt.xlabel("X [m]") plt.ylabel("Y [m]") plt.legend(loc="upper right", fontsize=8) plt.tight_layout() plt.show() ``` -------------------------------- ### Setup Baseline Channel Parameters Source: https://deepmimo.net/docs/applications/1_channel_prediction.html Configures channel parameters for a baseline scenario without Doppler effect. This setup is used for comparison against interpolated and Doppler-affected channels. ```python print("\n" + "=" * 70) print("SECTION 5: Baseline Channels (No Interpolation)") print("=" * 70) # Select a few sequences for detailed comparison N_COMPARE = min(3, final_samples) compare_seqs = all_seqs_mat_sample[:N_COMPARE] # Setup channel parameters ch_params = dm.ChannelParameters() ch_params.bs_antenna.shape = [NT, 1] ch_params.ue_antenna.shape = [NR, 1] ch_params.ofdm.subcarriers = N_SUBCARRIERS ch_params.ofdm.selected_subcarriers = np.arange(N_SUBCARRIERS) ch_params.ofdm.bandwidth = 15e3 * N_SUBCARRIERS # [Hz] ch_params.doppler = False # No Doppler for baseline print("\nChannel parameters:") print(f" TX antennas: {NT}") print(f" RX antennas: {NR}") print(f" Subcarriers: {N_SUBCARRIERS}") print(f" Bandwidth: {ch_params.ofdm.bandwidth / 1e3:.1f} kHz") ``` -------------------------------- ### Create a Scene and Add a Building Source: https://deepmimo.net/docs/resources/capabilities/core.html Use this pattern to initialize a simulation scene and add physical elements like buildings. Ensure all faces for a building are defined before adding it to the scene. ```python from deepmimo.core import Scene, PhysicalElement, Face # Create scene scene = Scene() # Create a building faces = [ Face(vertices=[(0,0,0), (1,0,0), (1,1,0), (0,1,0)], material_idx=0), # ... more faces ] building = PhysicalElement( faces=faces, object_id=0, label='building', name='Building_1' ) scene.add_object(building) ``` -------------------------------- ### Get Information About a Specific Parameter Source: https://deepmimo.net/docs/tutorials/1_getting_started.html Use `dm.info("parameter_name")` to get specific details about a single parameter, such as 'power'. This is useful for quickly understanding the properties and format of a particular data field. ```APIDOC ## Get Information About a Specific Parameter ### Description Retrieves detailed information for a specific parameter. ### Method `dm.info()` ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python dm.info("power") ``` ### Response Detailed description of the specified parameter, including its meaning, calculation, and dimensions. For example, for `power`: - **power**: Tap power. Received power in dBW for each path, assuming 0 dBW transmitted power. Calculation: 10*log10(|a|²), where a is the complex channel amplitude Dimensions: [num_rx, num_paths] ### Response Example (Output will be a detailed textual description of the specified parameter) ``` -------------------------------- ### Get Information About a Specific Parameter Source: https://deepmimo.net/docs/tutorials/1_getting_started.html Use dm.info("parameter_name") to get detailed information about a single parameter. This is helpful when you need to understand the specifics of a particular setting, such as its definition, calculation, and dimensions. ```python # Get information about a specific parameter dm.info("power") ``` -------------------------------- ### Create and Add Objects to a Scene Source: https://deepmimo.net/docs/api/scene.html Demonstrates initializing a scene and adding single or multiple objects to it. Ensure objects are defined before adding them. ```python scene = dm.Scene() # Add objects scene.add_object(building) scene.add_objects([tree1, tree2]) ``` -------------------------------- ### Get Dataset Summary Statistics Source: https://deepmimo.net/docs/api/datasets.html Use the `dm.summary` function to get a string representation of dataset statistics. For detailed analysis of specific TX/RX sets, use `dm.stats`, providing lists of desired TX set indices. ```python import deepmimo as dm # Get summary as a string summary_str = dm.summary('scenario_name', print_summary=False) # Get detailed stats for selected TX/RX sets stats_str = dm.stats('scenario_name', tx_sets=[4], print_summary=False) ``` -------------------------------- ### Initialize and configure Sionna scene Source: https://deepmimo.net/docs/tutorials/manual.html Helper functions for generating user grids and initializing a Sionna scene with specific frequency and array configurations. ```python from typing import Any import matplotlib.pyplot as plt import numpy as np import sionna from sionna.rt import DirectivePattern, PlanarArray, Receiver, Transmitter, load_scene from tqdm import tqdm def compute_array_combinations(arrays: list) -> np.ndarray: """Compute cartesian product combinations for array parameters.""" return np.stack(np.meshgrid(*arrays), -1).reshape(-1, len(arrays)) def gen_user_grid(box_corners: list, steps: list, box_offsets: list | None = None) -> np.ndarray: """Generate a grid of user positions. box_corners is = [bbox_min_corner, bbox_max_corner] steps = [x_step, y_step, z_step]. """ # Sample the ranges of coordinates ndim = len(box_corners[0]) dim_ranges = [] for dim in range(ndim): if steps[dim]: dim_range = np.arange(box_corners[0][dim], box_corners[1][dim], steps[dim]) else: dim_range = np.array([box_corners[0][dim]]) # select just the first limit dim_ranges.append(dim_range + box_offsets[dim] if box_offsets else 0) pos = compute_array_combinations(dim_ranges) print(f"Total positions generated: {pos.shape[0]}") return pos def create_base_scene(scene_path: str, center_frequency: float) -> Any: """Load a Sionna scene and apply frequency and array defaults.""" scene = load_scene(scene_path) scene.frequency = center_frequency scene.tx_array = PlanarArray( num_rows=1, num_cols=1, vertical_spacing=0.5, horizontal_spacing=0.5, pattern="iso", polarization="V", ) scene.rx_array = scene.tx_array scene.synthetic_array = True return scene # Save dict with compute path params to export later my_compute_path_params = { "max_depth": 5, "num_samples": 1e6, "scattering": False, "diffraction": False, } carrier_freq = 3.5 * 1e9 # Hz tx_pos = [-33, 11, 32.03] # 0- Create/Fetch scene and get buldings in the scene scene = create_base_scene(sionna.rt.scene.simple_street_canyon, center_frequency=carrier_freq) # 1- Compute TX position print("Computing BS position") scene.add(Transmitter(name="tx", position=tx_pos, orientation=[0, 0, 0])) # 2- Compute RXs positions print("Computing UEs positions") rxs = gen_user_grid( box_corners=[(-93, -60, 0), (93, 60, 0)], steps=[4, 4, 0], box_offsets=[0, 0, 2], ) # 3- Add the first batch of receivers to the scene n_rx = len(rxs) n_rx_in_scene = 10 # to compute in parallel print(f"Adding users to the scene ({n_rx_in_scene} at a time)") for rx_idx in range(n_rx_in_scene): scene.add(Receiver(name=f"rx_{rx_idx}", position=rxs[rx_idx], orientation=[0, 0, 0])) # 4- Enable scattering in the radio materials if my_compute_path_params["scattering"]: for rm in scene.radio_materials.values(): rm.scattering_coefficient = 1 / np.sqrt(3) # [0,1] rm.scattering_pattern = DirectivePattern(alpha_r=10) # 5- Compute the paths for each set of receiver positions path_list = [] n_rx_remaining = n_rx for x in tqdm(range(int(n_rx / n_rx_in_scene) + 1), desc="Path computation"): if n_rx_remaining > 0: n_rx_remaining -= n_rx_in_scene else: break if x != 0: # modify current RXs in scene for rx_idx in range(n_rx_in_scene): if rx_idx + n_rx_in_scene * x < n_rx: scene.receivers[f"rx_{rx_idx}"].position = rxs[rx_idx + n_rx_in_scene * x] else: # remove the last receivers in the scene scene.remove(f"rx_{rx_idx}") paths = scene.compute_paths(**my_compute_path_params) paths.normalize_delays = False # sum min_tau to tau, or tau of 1st path is always = 0 path_list.append(paths) ``` -------------------------------- ### GET /plot_coverage Source: https://deepmimo.net/docs/api/datasets.html Plots the coverage map of the dataset. ```APIDOC ## GET /plot_coverage ### Description Plot the coverage of the dataset. ### Method GET ### Parameters #### Query Parameters - **cov_map** (Any) - Required - The coverage map to plot. - **kwargs** (Any) - Optional - Additional keyword arguments to pass to the plot_coverage function. ```