tidy3d.ModeSimulationData#
- class ModeSimulationData[source]#
Bases:
AbstractYeeGridSimulationDataData associated with a mode solver simulation.
- Parameters:
simulation (
ModeSimulation) – Mode simulation associated with this data.data (tuple[Union[
PermittivityData,MediumData], …] = ()) – List of monitor data associated with the monitors of the originalModeSimulation.log (Optional[str] = None) – A string containing the log information from the simulation run.
modes_raw (Union[
ModeSolverData,MicrowaveModeSolverData]) – Union[ModeSolverData,MicrowaveModeSolverData] containing the field and effective index on unexpanded grid.
Attributes
ModeSolverDatacontaining the field and effective index data.logMethods
plot_field(field_name[, val, scale, ...])Plot the field for a
ModeSolverDatawithSimulationplot overlaid.sort_modes(sort_spec)Sort modes per frequency according to
sort_spec.- simulation#
- modes_raw#
- data#
- property modes#
ModeSolverDatacontaining the field and effective index data.
- plot_field(field_name, val='real', scale='lin', eps_alpha=0.2, robust=True, vmin=None, vmax=None, ax=None, cmap=None, **sel_kwargs)[source]#
Plot the field for a
ModeSolverDatawithSimulationplot overlaid.- Parameters:
field_name (str) – Name of
fieldcomponent to plot (eg.'Ex'). Also accepts'E'and'H'to plot the vector magnitudes of the electric and magnetic fields, and'S'for the Poynting vector.val (Literal['real', 'imag', 'abs', 'abs^2', 'dB'] = 'real') – Which part of the field to plot.
eps_alpha (float = 0.2) – Opacity of the structure permittivity. Must be between 0 and 1 (inclusive).
robust (bool = True) – If True and vmin or vmax are absent, uses the 2nd and 98th percentiles of the data to compute the color limits. This helps in visualizing the field patterns especially in the presence of a source.
vmin (float = None) – The lower bound of data range that the colormap covers. If
None, they are inferred from the data and other keyword arguments.vmax (float = None) – The upper bound of data range that the colormap covers. If
None, they are inferred from the data and other keyword arguments.ax (matplotlib.axes._subplots.Axes = None) – matplotlib axes to plot on, if not specified, one is created.
cmap (Optional[Union[str, Colormap]] = None) – Colormap for visualizing the field values.
Noneuses the default which infers it from the data.sel_kwargs (keyword arguments used to perform
.sel()selection in the monitor data.) – These kwargs can select over the spatial dimensions (x,y,z), frequency or time dimensions (f,t) or mode_index, if applicable. For the plotting to work appropriately, the resulting data after selection must contain only two coordinates with len > 1. Furthermore, these should be spatial coordinates (x,y, orz).
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes