remap_wavelengths#
- static DEpsCalculator.remap_wavelengths(fdtd_session: FdtdSession, d_eps_dP_dict: dict[str, dict[str, dict[str, ndarray]]], global_shape: ndarray, current_wl_m: float, material_outside: str, material_inside: str, new_wavelengths_m: ndarray) tuple[dict[str, dict[str, dict[str, ndarray]]], ndarray, ndarray]#
Remap single-wavelength dEps/dP to multiple wavelengths. Uses fill-fraction scaling:
eps_mean = ff * eps_inside + (1-ff) * eps_outside, sod(eps_mean) = (eps_inside - eps_outside) * d_ff.- Parameters:
- fdtd_session
FdtdSession FDTD session within which to query material properties.
- d_eps_dP_dict
dict[str,dict[str,dict[str,np.ndarray]]] Sparse dEps/dP dictionary as returned by
compute().- global_shape
np.ndarray Shape
(4,)of the global index monitor[Nx, Ny, Nz, Nlambda].- current_wl_m
float Current wavelength in meters.
- material_outside
str Name of the material outside the shape as defined in the FDTD materials database.
- material_inside
str Name of the material inside as defined in the FDTD materials database.
- new_wavelengths_m
np.ndarray 1D array of new wavelengths in meters.
- fdtd_session
- Returns:
- d_eps_dP_dict
dict[str,dict[str,dict[str,np.ndarray]]] Remapped dEps/dP dictionary for the new wavelengths.
- new_global_shape
np.ndarray Updated global shape
[Nx, Ny, Nz, len(new_wavelengths)].
- d_eps_dP_dict
- Raises:
ValueErrorIf inputs are invalid (equal inside/outside epsilons, mismatched array lengths, non-1D arrays, etc.).