tidy3d.components.data.dataset.ModeSolverDataset#
- class ModeSolverDataset[source]#
Bases:
ElectromagneticFieldDataset
Dataset storing scalar components of E and H fields as a function of freq. and mode_index.
- Parameters:
attrs (dict = {}) β Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.Ex (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the x-component of the electric field of the mode.
Ey (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the y-component of the electric field of the mode.
Ez (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the z-component of the electric field of the mode.
Hx (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the x-component of the magnetic field of the mode.
Hy (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the y-component of the magnetic field of the mode.
Hz (Optional[ScalarModeFieldDataArray] = None) β Spatial distribution of the z-component of the magnetic field of the mode.
n_complex (ModeIndexDataArray) β Complex-valued effective propagation constants associated with the mode.
n_group_raw (Optional[GroupIndexDataArray] = None) β Index associated with group velocity of the mode.
dispersion_raw (Optional[ModeDispersionDataArray] = None) β [units = ps/(nm km)]. Dispersion parameter for the mode.
Example
>>> from tidy3d import ModeSpec >>> x = [-1,1] >>> y = [0] >>> z = [-3,-1,1,3] >>> f = [2e14, 3e14] >>> mode_index = np.arange(5) >>> field_coords = dict(x=x, y=y, z=z, f=f, mode_index=mode_index) >>> field = ScalarModeFieldDataArray((1+1j)*np.random.random((2,1,4,2,5)), coords=field_coords) >>> index_coords = dict(f=f, mode_index=mode_index) >>> index_data = ModeIndexDataArray((1+1j) * np.random.random((2,5)), coords=index_coords) >>> data = ModeSolverDataset( ... Ex=field, ... Ey=field, ... Ez=field, ... Hx=field, ... Hy=field, ... Hz=field, ... n_complex=index_data ... )
Attributes
Dispersion parameter.
Maps the field components to their associated data.
Imaginary part of the propagation index.
Real part of the propagation index.
Group index.
Methods
plot_field
(*args,Β **kwargs)Warn user to use the
ModeSolver
plot_field
function now.Inherited Common Usage
- Ex#
- Ey#
- Ez#
- Hx#
- Hy#
- Hz#
- n_complex#
- n_group_raw#
- dispersion_raw#
- property field_components#
Maps the field components to their associated data.
- 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}\]
- plot_field(*args, **kwargs)[source]#
Warn user to use the
ModeSolver
plot_field
function now.
- __hash__()#
Hash method.