@@ -105,6 +105,8 @@ def get_antenna_metrics_data(
105
105
Container with antenna parameters including directivity, gain, and radiation efficiency,
106
106
computed from the superposition of fields from all excited ports.
107
107
"""
108
+ from tidy3d .plugins .smatrix .run import compute_power_wave_amplitudes_at_each_port
109
+
108
110
# Use the first port as default if none specified
109
111
if port_amplitudes is None :
110
112
port_amplitudes = {self .simulation .ports [0 ].name : None }
@@ -132,8 +134,10 @@ def get_antenna_metrics_data(
132
134
sim_data_port = self .simulation .batch_data [self .simulation ._task_name (port = port )]
133
135
radiation_data = sim_data_port [rad_mon .name ]
134
136
135
- a , b = self .compute_power_wave_amplitudes_at_each_port (
136
- self .port_reference_impedances , sim_data_port
137
+ a , b = compute_power_wave_amplitudes_at_each_port (
138
+ simulation = self .simulation ,
139
+ port_reference_impedances = self .simulation .port_reference_impedances ,
140
+ sim_data = sim_data_port ,
137
141
)
138
142
# Select a possible subset of frequencies
139
143
a = a .sel (f = f )
@@ -172,7 +176,7 @@ def port_reference_impedances(self) -> PortDataArray:
172
176
"""The reference impedance used at each port for definining power wave amplitudes."""
173
177
from tidy3d .plugins .smatrix .run import _port_reference_impedances
174
178
175
- return _port_reference_impedances (self .simulation . batch_data )
179
+ return _port_reference_impedances (self .simulation )
176
180
177
181
def compute_power_wave_amplitudes_at_each_port (
178
182
self , port_reference_impedances : PortDataArray , sim_data : SimulationData
0 commit comments