pyOptiShared.SimResults.FDTDSimResults

class pyOptiShared.SimResults.FDTDSimResults

Bases: BaseSimResults

FDTD Results class.

Methods

GetSPArray()

PlotDFTMonitor(mon_name[, run_num, field, ...])

Plots the field distribtuin at a given frequency

PlotPermittivity([profile, cut, position, ...])

Plots permittivity distribution for x, y or z at a given cross section

PlotSParameters([snp, plot_type, ...])

Plots s-parameter values

PlotTimeMonitor(mon_name[, run_num, field, ...])

Plots the field component of a time monitor at a given time

loadHDF5(filename)

This method loads results from an HDF5 file.

Attributes

mode_sources

A dictionary of mode source data.

permeability

The permeability material grid.

permittivity

The permittivity material grid.

runs

A list that stores each run's results.

sparameters

A dictionary with scattering parameter results.

PlotDFTMonitor(mon_name: str, run_num: int = 0, field: Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'] = 'Ex', frequency: float = 192.1, plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'mag', width: float = 6, height: float = 4)

Plots the field distribtuin at a given frequency

Parameters:
  • mon_name (str) – Name of the monitor

  • run_num (int, optional) – Number of the excitation port. Defaults to 0.

  • field (Literal['Ex','Ey','Ez','Hx','Hy','Hz'], optional) – Field component to plot. Defaults to ‘Ex’.

  • frequency (float, optional) – Frequency in THz. Defaults to 192.1.

  • plot_type (Literal['real','imag','mag','phase','power','polar','cartesian'], optional) – Plot type. Defaults to ‘mag’.

  • width (float, optional) – Width of the plot. Defaults to 6.

  • height (float, optional) – Height of the plot. Defaults to 4.

PlotPermittivity(profile: Literal['EPS_X', 'EPS_Y', 'EPS_Z'] = 'EPS_X', cut: Literal['x', 'y', 'z'] = 'z', position: float = 0, plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'real', width: float = 6, height: float = 4)

Plots permittivity distribution for x, y or z at a given cross section

Parameters:
  • profile (Literal['EPS_X','EPS_Y','EPS_Z'], optional) – Profile to plot. Defaults to ‘EPS_X’.

  • cut (Literal['x','y','z'], optional) – Cut dimension. Defaults to ‘z’.

  • position (float, optional) – Cut position. Defaults to 0 um. The value will be rounded to the closest position

  • plot_type (Literal['real','imag','mag','phase','power','polar','cartesian'], optional) – Plot type. Defaults to ‘real’.

  • width (float, optional) – Width of the plot. Defaults to 6.

  • height (float, optional) – Height of the plot. Defaults to 4.

Raises:

ValueError – If cut type is not x,y or z

PlotSParameters(snp: str | list[str] = ['S11', 'S21'], plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'mag', unwrap_phase: bool = True, width: float = 6, height: float = 3)

Plots s-parameter values

Parameters:
  • snp (str | list[str], optional) – It can be a single s-parameter or a list of s-parameter values. The format is Sij where i and j are rows and coluns of the s-parameter.Defaults to ‘S21’.

  • plot_type (Literal['real','imag','mag','phase','power','polar','cartesian'], optional) – Plot type. Defaults to ‘mag’.

  • unwrap_phase (bool, optional) – Unwraps phase if the plot thpe is polar or phase. Defaults to True.

  • width (float, optional) – Width of the plot. Defaults to 6.

  • height (float, optional) – Height of the plot. Defaults to 3.

PlotTimeMonitor(mon_name: str, run_num: int = 0, field: Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'] = 'Ex', time: float = 1, plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'mag', width: float = 6, height: float = 3)

Plots the field component of a time monitor at a given time

Parameters:
  • mon_name (str) – Name of the time monitor

  • run_num (int, optional) – Number of the excitation port. Defaults to 0.

  • field (Literal['Ex','Ey','Ez','Hx','Hy','Hz'], optional) – Field component to plot. Defaults to ‘Ex’.

  • time (float, optional) – Time to plot. Defaults to 1 fs. The value will be rounded to the closest position

  • plot_type (Literal['real','imag','mag','phase','power','polar','cartesian'], optional) – Plot type. Defaults to ‘mag’.

  • width (float, optional) – Width of the plot. Defaults to 6.

  • height (float, optional) – Height of the plot. Defaults to 3.

property mode_sources: Dict[str, FDTDModeData]

A dictionary of mode source data.

The keys are Mode Source o# where # is the port number starting from 1. The values are FDTDModeData objects.

Return type:

Dict[str, FDTDModeData]

property permeability: NXdata

The permeability material grid.

Return type:

NXdata

property permittivity: NXdata

The permittivity material grid.

Return type:

NXdata

property runs: list[FDTDSimRun]

A list that stores each run’s results.

The results are stored as FDTDSimRun.

Returns:

A list of FDTD run results.

Return type:

list[FDTDSimRun]

property sparameters: Dict[str, NXdata]

A dictionary with scattering parameter results.

The keys are either "ALL" or "SNM", where N and M are port numbers, starting from 1.

Return type:

Dict[str, NXdata]