get_adjoint_fields#

PortFom.get_adjoint_fields(fdtd_session, entry)#

Extract and scale adjoint fields for port-based simulation, one per wavelength.

For port-based simulations, the adjoint simulation is set with unit amplitude and 0 phase, so the adjoint fields need to be scaled appropriately. The mode profiles (em, hm) and spatial coordinates (x, y, z) are wavelength-independent; all other quantities (e, h, Nm, freq, phase corrections) are extracted at each requested wavelength.

Parameters:
fdtd_sessionFdtdSession

FDTD session providing access to simulation data and parameters.

entrydict

Dictionary containing filenames and simulation results for the current entry.

Returns:
list of np.ndarray

Scaled adjoint electric field data, one array per wavelength in entry['sim_result'].wavelengths.