FEMFy.FEFDResults.FEFDResults

class FEMFy.FEFDResults.FEFDResults

Bases: SimResults

FEFD Results class.

Methods

GetFieldData([target_wavelength, source_idx])

Returns the interpolated 2D field data for a specific wavelength.

GetNeffData([source_idx])

Returns the Effective Index data.

GetProfile1DData(target_wavelength[, source_idx])

Returns the interpolated 1D profile.

GetSParameterData([s_param])

_summary_

PlotField([target_wavelength, source_idx, ...])

Loads an HDF5 file, finds the field data, interpolates it to the requested wavelength, and plots the result.

PlotMaterial([plot_mode, figsize, cmap, show])

Loads the material structure (Permittivity) from the HDF5 file and plots it.

PlotNeff([source_idx, figsize, show])

Plots the Real and Imaginary parts of the Effective Index (Neff).

PlotPort([target_wavelength, source_idx, ...])

Plots the 1D Mode Profile cross-section at a specific wavelength.

PlotSParameters([s_param, figsize, show])

Plots the Linear Magnitude and Phase (rad) of a specific S-parameter.

loadHDF5(filename)

This method loads results from an HDF5 file.

mode_sources()

A dictionary of mode source data.

set_epsilons(epsilons)

set_fields(fields)

set_hdf5_path(path)

set_sparameters(sparameters[, phase_is_degrees])

Converts a raw numpy array of [Wavelength, Mag, Phase...] into a dictionary of your custom NXdata objects.

Attributes

epsilon_monitor

fields

ports_monitors

sparameters

A dictionary with scattering parameter results.

GetFieldData(target_wavelength: float = 1.5, source_idx: int = 0)

Returns the interpolated 2D field data for a specific wavelength.

Parameters:
  • target_wavelength (float) – the wavelength of the field.

  • source_idx (int, optional) – the index of the source. Defaults to 0.

Raises:

ValueError – _description_

Returns:

(x_samples, y_samples, interpolated_field_complex, actual_wavelength)

Return type:

tuple

GetNeffData(source_idx: int = 0) tuple

Returns the Effective Index data.

Parameters:

source_idx (int, optional) – source number. Defaults to 0.

Returns:

(wavelengths, neff_real, neff_imag, neff_complex)

Return type:

tuple

GetProfile1DData(target_wavelength: float, source_idx: int = 0)

Returns the interpolated 1D profile.

Parameters:
  • target_wavelength (float) – the wavelength of the data.

  • source_idx (int, optional) – the source number. Defaults to 0.

Returns:

(x_1d_positions, profile_values, actual_wavelength)

Return type:

tuple

GetSParameterData(s_param: str = 'S21')

_summary_

Parameters:

s_param (str, optional) – the sparameter label ‘S11’, ‘S21’, … etc. Defaults to “S21”.

Raises:

ValueError – _description_

Retrieves the numerical data for a specific S-parameter.

Returns:

(wavelengths, magnitude_linear, phase_rad, s_complex)

Return type:

tuple

PlotField(target_wavelength: float = 1.5, source_idx: int = 0, plot_mode: str = 'abs', figsize: tuple = (10, 6), cmap: str = 'RdBu_r', show: bool = True, **kwargs)

Loads an HDF5 file, finds the field data, interpolates it to the requested wavelength, and plots the result.

Parameters:
  • target_wavelength (float, optional) – The specific wavelength (in um) you want to visualize..

  • source_idx (int, optional) – The integer index of the source (port) to visualize. Defaults to 0.

  • plot_mode (str, optional) – ‘real’ (snapshot), ‘abs’ (envelope), ‘intensity’ . Defaults to ‘abs’.

  • figsize (tuple, optional) – Matplotlib figure size (width, height). Default (10,6).

  • cmap (str, optional) – _description_. Defaults to ‘RdBu_r’.

Raises:
PlotMaterial(plot_mode: str = 'real', figsize: tuple = (10, 6), cmap: str = 'Greys', show: bool = True, **kwargs)

Loads the material structure (Permittivity) from the HDF5 file and plots it.

Parameters:
  • plot_mode (str, optional) – ‘real’: Plots the real part of permittivity (Dielectric Constant). ‘imag’: Plots the imaginary part (Loss/Gain). ‘abs’ : Plots the magnitude.. Defaults to ‘real’.

  • figsize (tuple, optional) – Matplotlib figure size (width, height). Default (10,6).

  • cmap (str, optional) – _description_. Defaults to ‘Greys’.

Raises:
PlotNeff(source_idx: int = 0, figsize: tuple = (10, 6), show: bool = True, **kwargs)

Plots the Real and Imaginary parts of the Effective Index (Neff).

Parameters:
  • source_idx (int, optional) – The integer index of the source (port) to visualize. Defaults to 0.

  • figsize (tuple, optional) – Matplotlib figure size (width, height). Default (10,6).

PlotPort(target_wavelength: float = 1.5, source_idx: int = 0, figsize: tuple = (10, 6), show: bool = True, **kwargs)

Plots the 1D Mode Profile cross-section at a specific wavelength. Performs linear interpolation between nearest wavelength frames.

Parameters:
  • target_wavelength (float, optional) – _description_. Defaults to 1.5.

  • source_idx (int, optional) – index of the source to plot. Defaults to 0.

  • figsize (tuple, optional) – the figure size. Defaults to (10, 6).

  • show (bool, optional) – show the plot. Defaults to True.

PlotSParameters(s_param: str = 'S21', figsize: tuple = (10, 6), show: bool = True, **kwargs)

Plots the Linear Magnitude and Phase (rad) of a specific S-parameter.

Parameters:
  • s_param (str, optional) – The name of the parameter (e.g., ‘S11’, ‘S21’). Defaults to “S21”.

  • figsize (tuple, optional) – Matplotlib figure size (width, height). Default (10,6).

Raises:

ValueError – _description_

mode_sources() Dict[str, FEFDModeData]

A dictionary of mode source data.

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

Return type:

Dict[str, FEFDModeData]

set_sparameters(sparameters: ndarray, phase_is_degrees=True)

Converts a raw numpy array of [Wavelength, Mag, Phase…] into a dictionary of your custom NXdata objects.

property sparameters

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]