FEMFy.FEFDResults.FEFDResults
- class FEMFy.FEFDResults.FEFDResults
Bases:
SimResultsFEFD 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.
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_monitorfieldsports_monitorsA 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:
- Raises:
ValueError – _description_
- Returns:
(x_samples, y_samples, interpolated_field_complex, actual_wavelength)
- Return type:
- GetProfile1DData(target_wavelength: float, source_idx: int = 0)
Returns the interpolated 1D profile.
- 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:
- 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:
ValueError – _description_
ValueError – _description_
- 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:
ValueError – _description_
ValueError – _description_
ValueError – _description_
- PlotNeff(source_idx: int = 0, figsize: tuple = (10, 6), show: bool = True, **kwargs)
Plots the Real and Imaginary parts of the Effective Index (Neff).
- 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.
- 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:
- 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]