get_scaling_factor#

FieldFom.get_scaling_factor(fdtd_session: FdtdSession, parametrization, sim_result) ndarray#

Compute a per-wavelength scaling factor for the adjoint gradient (field-based).

For field-based simulations, the scaling factor includes the normalization amplitude from the dipole source, which depends on frequency.

Parameters:
fdtd_sessionFdtdSession

FDTD session used to query monitor normalization amplitude.

parametrizationBaseParametrization

Current geometry parametrization supplying mesh cell sizes and counts.

sim_resultFieldResults

Simulation result object whose wavelengths list determines the frequencies at which the scaling factor is evaluated.

Returns:
np.ndarray

Array of scaling factors with shape (n_wavelengths,), one per wavelength in sim_result.