flex_rf.tidy3d.ModeData
Type: class │ Base(s): ModeSolverDataset, AbstractOverlapData
Description
Section titled “Description”Data associated with a ModeMonitor: modal amplitudes, propagation indices and mode profiles.
The data is stored as a DataArray object using the xarray package.
The mode monitor data contains the complex effective indices and the complex mode amplitudes at the monitor
position calculated by mode decomposition. The data structure of the complex effective
indices :attrn_complex contains two coordinates: f and mode_index, both of which are specified when
defining the ModeMonitor in the simulation.
Besides the effective index, ModeMonitor is primarily used to calculate the transmission of
certain modes in certain directions. We can extract the complex amplitude and square it to compute the mode
transmission power.
Example(s)
Section titled “Example(s)”from tidy3d import ModeSpecfrom tidy3d import ModeAmpsDataArray, ModeIndexDataArraydirection = ["+", "-"]f = [1e14, 2e14, 3e14]mode_index = np.arange(5)index_coords = dict(f=f, mode_index=mode_index)index_data = ModeIndexDataArray((1+1j) * np.random.random((3, 5)), coords=index_coords)amp_coords = dict(direction=direction, f=f, mode_index=mode_index)amp_data = ModeAmpsDataArray((1+1j) * np.random.random((2, 3, 5)), coords=amp_coords)monitor = ModeMonitor( size=(2,0,6), freqs=[2e14, 3e14], mode_spec=ModeSpec(num_modes=5), name='mode',)data = ModeData(monitor=monitor, amps=amp_data, n_complex=index_data)Parameters
Section titled “Parameters”amps [ModeAmpsDataArray] |
|
Complex-valued amplitudes of the overlap decomposition. |
n_complex [ModeIndexDataArray] |
|
Complex-valued effective propagation constants associated with the mode. |
monitor [ModeMonitor] |
|
Monitor associated with the data. |
Ex [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the x-component of the electric field of the mode. |
Ey [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the y-component of the electric field of the mode. |
Ez [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the z-component of the electric field of the mode. |
Hx [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the x-component of the magnetic field of the mode. |
Hy [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the y-component of the magnetic field of the mode. |
Hz [ScalarModeFieldDataArray | None] = None |
|
Spatial distribution of the z-component of the magnetic field of the mode. |
symmetry [tuple[Symmetry, Symmetry, Symmetry]] = (0, 0, 0) |
|
Symmetry eigenvalues of the original simulation in x, y, and z. |
symmetry_center [Coordinate | None] = None |
|
Center of the symmetry planes of the original simulation in x, y, and z. Required only if any of the |
grid_expanded [Grid | None] = None |
|
|
grid_primal_correction [GRID_CORRECTION_TYPE] = 1.0 |
|
Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the primal grid locations along the normal direction. |
grid_dual_correction [GRID_CORRECTION_TYPE] = 1.0 |
|
Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the dual grid locations along the normal direction. |
n_group_raw [GroupIndexDataArray | None] = None |
|
Index associated with group velocity of the mode. |
dispersion_raw [ModeDispersionDataArray | None] = None |
|
Dispersion parameter for the mode. |
eps_spec [list[EpsSpecType] | None] = None |
|
Characterization of the permittivity profile on the plane where modes are computed. Possible values are ‘diagonal’, ‘tensorial_real’, ‘tensorial_complex’. |
Attributes
Section titled “Attributes”modes_info [xr.Dataset] |
|
Dataset collecting various properties of the stored modes. |
solver_field_bounds [BoundOptional] |
|
Per-axis bounds where solver field data is physically valid. |
TE_fraction [xr.DataArray] |
|
Alias for |
TM_fraction [xr.DataArray] |
|
Alias for |
wg_TE_fraction [xr.DataArray] |
|
Alias for |
wg_TM_fraction [xr.DataArray] |
|
Alias for |
Methods
Section titled “Methods”eps_spec_match_mode_spec() |
|
Raise validation error if frequencies in eps_spec does not match frequency list |
overlap_sort(track_freq: TrackFreq, overlap_thresh: float = 0.9) |
|
Starting from the base frequency defined by parameter |
pol_fraction() |
|
Compute the TE and TM polarization fraction defined as the field intensity along the first or the second of the two tangential axes. More precisely, if and are the electric field components along the two tangential axes, the TE fraction is defined as: |
pol_fraction_waveguide() |
|
Compute the TE and TM polarization fraction using the waveguide definition. If is the propagation direction, the TE fraction is defined as: |
sort_modes(sort_spec: ModeSortSpec | None = None, track_freq: TrackFreq | None = None) |
|
Sort modes per frequency according to |
to_dataframe() |
|
xarray-like method to export the |