tidy3d.ModeData#
- class ModeData[source]#
Bases:
MonitorDataData associated with a
ModeMonitor: modal amplitudes and propagation indices.- Parameters:
monitor (Attribute:
monitor) –TypeModeMonitor
DefaultDescriptionMode monitor associated with the data.
amps (Attribute:
amps) –TypeModeAmpsDataArray
DefaultDescriptionComplex-valued amplitudes associated with the mode.
n_complex (Attribute:
n_complex) –TypeModeIndexDataArray
DefaultDescriptionComplex-valued effective propagation constants associated with the mode.
n_group_raw (Attribute:
n_group_raw) –TypeOptional[GroupIndexDataArray]
Default= None
DescriptionIndex associated with group velocity of the mode.
dispersion_raw (Attribute:
dispersion_raw) –TypeOptional[ModeDispersionDataArray]
Default= None
Unitsps/(nm km)
DescriptionDispersion parameter for the mode.
Notes
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 :attr`n_complex` contains two coordinates:
fandmode_index, both of which are specified when defining the :class:ModeMonitorin the simulation.Besides the effective index, :class:
ModeMonitoris 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
>>> from tidy3d import ModeSpec >>> from tidy3d import ModeAmpsDataArray, ModeIndexDataArray >>> direction = ["+", "-"] >>> 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)
Attributes
Dispersion parameter.
Imaginary part of the propagation index.
Real part of the propagation index.
Group index.
Methods
normalize(source_spectrum_fn)Return copy of self after normalization is applied using source spectrum function.
- monitor#
- amps#
- n_complex#
- n_group_raw#
- dispersion_raw#
- property n_eff#
Real part of the propagation index.
- property k_eff#
Imaginary part of the propagation index.
- property n_group#
Group index.
- property dispersion#
Dispersion parameter.
\[D = -\frac{\lambda}{c_0} \frac{{\rm d}^2 n_{\text{eff}}}{{\rm d}\lambda^2}\]
- normalize(source_spectrum_fn)[source]#
Return copy of self after normalization is applied using source spectrum function.
- __hash__()#
Hash method.