Changes between Version 25 and Version 26 of Tutorials/Digital Twins/Geo2Sig Map Getting Started


Ignore:
Timestamp:
Jan 27, 2026, 4:10:44 AM (2 weeks ago)
Author:
srivera2
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/Digital Twins/Geo2Sig Map Getting Started

    v25 v26  
    8989   {{{
    9090   #!python
    91    # Core imports
    92    import numpy as np
    93    import mitsuba as mi
    94    import matplotlib as mpl
    95    import matplotlib.pyplot as plt
    96    import sionna
    97    from sionna.rt import load_scene, Camera, Transmitter, Receiver, PlanarArray,\
    98                          PathSolver, RadioMapSolver, load_mesh, watt_to_dbm, transform_mesh,\
    99                          cpx_abs_square 
     91# Core imports
     92import numpy as np
     93import mitsuba as mi
     94from sionna.rt import load_scene, Transmitter, Receiver, RadioMapSolver, transform_mesh
    10095   }}}
    10196
     
    10499   {{{
    105100   #!python
    106    SCENE_FOLDER = "../scenes/COSMOS"
    107    scene = load_scene(f"{SCENE_FOLDER}/scene.xml")
     101import os
     102current_dir = os.getcwd()
     103print(current_dir)
     104SCENE_FOLDER = "../scene/COSMOS"
     105scene = load_scene(f"{SCENE_FOLDER}/scene.xml")
    108106
    109    # Interactive 3D visualization and view of the scene
    110    scene.preview();   
     107# Interactive 3D visualization and view of the scene
     108scene.preview();    
    111109   }}}
    112110
     
    115113   {{{
    116114   #!python
    117    # Set the operating frequency (n48 band for 5G)
    118    scene.frequency = 3.7e9  # 3.7 GHz
     115   from sionna.rt import AntennaArray
     116from sionna.rt.antenna_pattern import antenna_pattern_registry
    119117
    120    # Define Rx position
    121    ue_position = [10.0, 0.0, 0.0]   # Rx position (x, y, z in meters)
     118# Set the operating frequency (n48 band for 5G)
     119scene.frequency = 3.7e9  # 3.7 GHz
    122120
    123    # Define Tx position
    124    gnb_position = [0.0, 0.0, 20.0]
     121# Define Rx position
     122ue_position = [20.0, 20.0, 0.0]   # Rx position (x, y, z in meters)
    125123
    126    # gNB antenna: 3GPP TR 38.901 pattern (AIRSTRAN D 2200)
    127    gnb_pattern_factory = antenna_pattern_registry.get("tr38901")
    128    gnb_pattern = gnb_pattern_factory(polarization="V")
    129    
    130    # Use isotropic antenna pattern
    131    ue_pattern_factory = antenna_pattern_registry.get("iso")
    132    # Polarization should match the transmitter
    133    ue_pattern = ue_pattern_factory(polarization="V")
     124# Define Tx position
     125gnb_position = [0.0, 0.0, 70.0]
    134126
    135    # SISO: Single antenna element at origin [0, 0, 0] for both TX and RX
    136    single_element = np.array([[0.0, 0.0, 0.0]])  # Shape: (1, 3)
     127# gNB antenna: 3GPP TR 38.901 pattern (AIRSTRAN D 2200)
     128gnb_pattern_factory = antenna_pattern_registry.get("tr38901")
     129gnb_pattern = gnb_pattern_factory(polarization="V")
    137130
    138    # Configure antenna arrays
    139    scene.tx_array = AntennaArray(
    140        antenna_pattern=gnb_pattern,
    141        normalized_positions=single_element.T  # Shape: (3, 1)
    142    )
     131# Use isotropic antenna pattern
     132ue_pattern_factory = antenna_pattern_registry.get("iso")
     133# Polarization should match the transmitter
     134ue_pattern = ue_pattern_factory(polarization="V")
    143135
    144    scene.rx_array = AntennaArray(
    145        antenna_pattern=ue_pattern,
    146        normalized_positions=single_element.T  # Shape: (3, 1)
    147    ) 
     136# SISO: Single antenna element at origin [0, 0, 0] for both TX and RX
     137single_element = np.array([[0.0, 0.0, 0.0]])  # Shape: (1, 3)
    148138
    149    # Create Rx
    150    rx = Receiver(name="ue", position=ue_position, display_radius=0.03)
    151    scene.add(rx)
     139# Configure antenna arrays
     140scene.tx_array = AntennaArray(
     141    antenna_pattern=gnb_pattern,
     142    normalized_positions=single_element.T  # Shape: (3, 1)
     143)
    152144
    153    # Create Tx
    154    tx = Receiver(name="gnb", position=gnb_position, display_radius=0.03)
    155    scene.add(tx)
     145scene.rx_array = AntennaArray(
     146    antenna_pattern=ue_pattern,
     147    normalized_positions=single_element.T  # Shape: (3, 1)
     148
    156149
     150# Create Rx
     151rx = Receiver(name="ue", position=ue_position, display_radius=0.03)
     152scene.add(rx)
     153
     154# Create Tx
     155tx = Transmitter(name="gnb", position=gnb_position, display_radius=0.03)
     156scene.add(tx)
    157157   }}}
    158158
     
    162162   #!python
    163163rm_solver = RadioMapSolver()
    164 
    165164
    166165# Create a measurement surface by cloning the terrain
     
    174173    los=True,
    175174    refraction=False,
    176     cell_size=(2., 2.),
    177     size=[512, 512],          # Size of the radio map in meters. The number of cells in the x and y directions should be [size/cell_size]
     175    cell_size=(1.0, 1.0),
     176    size=[1000, 1000],          # Size of the radio map in meters. The number of cells in the x and y directions should be [size/cell_size]
    178177    # orientation=[0, 0, 0],    # Orientation of the radio map plane
    179178    measurement_surface=measurement_surface, # TO BE UDPATED