pyOptiShared.SimResults.ModeSolverResults

class pyOptiShared.SimResults.ModeSolverResults

Bases: BaseSimResults

Mode Solver Results class.

Methods

ExportAsF3DFile([filename, field, lam_idx, mode])

Exports Hx, Hy, Hz, Ex, Ey, Ez for all the wavelengths and modes.

ExportNeff([filename, mode])

Exports the effective index for the specified mode to a text file determined by filename.

ExportNg([filename, mode])

Exports the group index for the specified mode to a text file determined by filename.

PlotIndex([index_type, modes, show_imag, ...])

Plots effective or group index at a given mode

PlotMode([field, lam, mode, plot_type, ...])

Plots the field component for a given mode at a given wavelength

PlotPermittivity([profile, lam, plot_type, ...])

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

loadHDF5(filename)

This method loads results from an HDF5 file.

Attributes

fields

The modal fields.

material_grid

The permittivity grid in the cross section.

neff

The modal effective refractive index.

ng

The group effective index.

ExportAsF3DFile(filename: str = './field', field: str | list[str] = 'all', lam_idx: int | str | list[int] = 'all', mode: int | str | list[int] = 'all')

Exports Hx, Hy, Hz, Ex, Ey, Ez for all the wavelengths and modes. Support to selected fields, wavelength and modes is pending.

Parameters:
  • filename (str, optional) – Export file name without extension. Defaults to ‘./field’.

  • field (str | list[str], optional) – Fields to be exported. Defaults to ‘all’.

  • lam_idx (int | str | list[int], optional) – Wavelengths to be exported. Defaults to ‘all’.

  • mode (int | str | list[int], optional) – Modes to be exported. Defaults to ‘all’.

ExportNeff(filename: str = './neff', mode: int | list[int] | str = -1)

Exports the effective index for the specified mode to a text file determined by filename.

Parameters:
  • filename (str, optional) – Filename without extention. Defaults to “./neff”.

  • mode (int | list[int], optional) – Mode index to be exported. Defaults to -1, the mode with the highest real neff. “all” export all modes. An integer select that particular mode starting from 0. A list of ints, select multiple modes. Otherwise: -1.

ExportNg(filename: str = './neff.txt', mode: int | list[int] = -1)

Exports the group index for the specified mode to a text file determined by filename.

Parameters:
  • filename (str, optional) – Filename without extention. Defaults to “./neff”.

  • mode (int | list[int], optional) – Mode index to be exported. Defaults to -1, the mode with the highest real neff. “all” export all modes. An integer select that particular mode starting from 0. A list of ints, select multiple modes. Otherwise: -1.

PlotIndex(index_type: Literal['neff', 'ng'] = 'neff', modes: list[int] = [0], show_imag: bool = False, width: float = 4, height: float = 4)

Plots effective or group index at a given mode

Parameters:
  • index_type (Literal['neff','ng'], optional) – Effective or group index. Defaults to ‘neff’.

  • modes (list, optional) – Mode numbers to plot. Defaults to [0].

  • show_imag (bool, optional) – Enables imaginary plot for the index. Defaults to True.

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

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

PlotMode(field: Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'] = 'Hx', lam: float = 1.55, mode: int = 0, plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'mag', width: float = 4, height: float = 4)

Plots the field component for a given mode at a given wavelength

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

  • lam (float, optional) – Wavelength in um. Defaults to 1.55.

  • mode (int, optional) – Mode Number. Defaults to 0.

  • 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 4.

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

PlotPermittivity(profile: Literal['EPS_X', 'EPS_Y', 'EPS_Z'] = 'EPS_X', lam: float = 1.55, plot_type: Literal['real', 'imag', 'mag', 'phase', 'power', 'polar', 'cartesian'] = 'real', width: float = 4, 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’.

  • lam (float, optional) – Cut position. Defaults to 1.55 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 4.

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

Raises:

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

property fields: NXdata

The modal fields.

The data is ecapsulated using an NXdata object.

Return type:

NXdata

property material_grid: NXdata

The permittivity grid in the cross section.

Its data is ecapsulated using an NXdata object.

Return type:

NXdata

property neff: NXdata

The modal effective refractive index.

Its data is ecapsulated using an NXdata object.

Return type:

NXdata

property ng: NXdata

The group effective index.

Its data is ecapsulated using an NXdata object. Available only if multiple frequencies were solved. Otherwise, None.

Return type:

NXdata