@@ -288,14 +288,14 @@ def get_radiation_monitor_by_name(self, monitor_name: str) -> DirectivityMonitor
288
288
return monitor
289
289
raise Tidy3dKeyError (f"No radiation monitor named '{ monitor_name } '." )
290
290
291
+ ##### Backwards compatibility methods, should be external functions really#####
291
292
def run (self , path_dir : str = DEFAULT_DATA_DIR ):
292
293
"""Solves for the scattering matrix of the system."""
293
294
from tidy3d .plugins .smatrix .local_run import run
294
295
295
296
terminal_component_modeler_data = run (simulation = self , path_dir = path_dir )
296
297
return terminal_component_modeler_data
297
298
298
- ##### Backwards compatibility methods, should be used within TerminalComponentModelerData really#####
299
299
@staticmethod
300
300
def _check_port_impedance_sign (Z_numpy : np .ndarray ):
301
301
"""Sanity check for consistent sign of real part of Z for each port across all frequencies."""
@@ -329,6 +329,10 @@ def _monitor_data_at_port_amplitude(
329
329
monitor_data : MonitorData ,
330
330
a_port : Union [FreqDataArray , complex ],
331
331
) -> MonitorData :
332
+ """Normalize the monitor data to a desired complex amplitude of a port,
333
+ represented by ``a_port``, where :math:`\\ frac{1}{2}|a|^2` is the power
334
+ incident from the port into the system.
335
+ """
332
336
from tidy3d .plugins .smatrix .local_run import run
333
337
334
338
terminal_component_modeler_data = run (simulation = self )
@@ -476,6 +480,28 @@ def get_antenna_metrics_data(
476
480
port_amplitudes : Optional [dict [str , complex ]] = None ,
477
481
monitor_name : Optional [str ] = None ,
478
482
) -> AntennaMetricsData :
483
+ """Calculate antenna parameters using superposition of fields from multiple port excitations.
484
+
485
+ The method computes the radiated far fields and port excitation power wave amplitudes
486
+ for a superposition of port excitations, which can be used to analyze antenna radiation
487
+ characteristics.
488
+
489
+ Parameters
490
+ ----------
491
+ port_amplitudes : dict[str, complex] = None
492
+ Dictionary mapping port names to their desired excitation amplitudes. For each port,
493
+ :math:`\\ frac{1}{2}|a|^2` represents the incident power from that port into the system.
494
+ If None, uses only the first port without any scaling of the raw simulation data.
495
+ monitor_name : str = None
496
+ Name of the :class:`.DirectivityMonitor` to use for calculating far fields.
497
+ If None, uses the first monitor in `radiation_monitors`.
498
+
499
+ Returns
500
+ -------
501
+ :class:`.AntennaMetricsData`
502
+ Container with antenna parameters including directivity, gain, and radiation efficiency,
503
+ computed from the superposition of fields from all excited ports.
504
+ """
479
505
from tidy3d .plugins .smatrix .local_run import run
480
506
481
507
terminal_component_modeler_data = run (simulation = self )
0 commit comments