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, so d(eps_mean) = (eps_inside - eps_outside) * d_ff.

Parameters:
fdtd_sessionFdtdSession

FDTD session within which to query material properties.

d_eps_dP_dictdict[str, dict[str, dict[str, np.ndarray]]]

Sparse dEps/dP dictionary as returned by compute().

global_shapenp.ndarray

Shape (4,) of the global index monitor [Nx, Ny, Nz, Nlambda].

current_wl_mfloat

Current wavelength in meters.

material_outsidestr

Name of the material outside the shape as defined in the FDTD materials database.

material_insidestr

Name of the material inside as defined in the FDTD materials database.

new_wavelengths_mnp.ndarray

1D array of new wavelengths in meters.

Returns:
d_eps_dP_dictdict[str, dict[str, dict[str, np.ndarray]]]

Remapped dEps/dP dictionary for the new wavelengths.

new_global_shapenp.ndarray

Updated global shape [Nx, Ny, Nz, len(new_wavelengths)].

Raises:
ValueError

If inputs are invalid (equal inside/outside epsilons, mismatched array lengths, non-1D arrays, etc.).