tidy3d.FieldProjector#

class FieldProjector[source]#

Bases: Tidy3dBaseModel

Projection of near fields to points on a given observation grid.

Parameters:
  • sim_data (SimulationData) – Container for simulation data containing the near field monitors.

  • surfaces (tuple[FieldProjectionSurface, …]) – tuple of each FieldProjectionSurface to use as source of near field.

  • pts_per_wavelength (Optional[int] = 10) – Number of points per wavelength in the background medium with which to discretize the surface monitors for the projection. If None, fields will will not resampled, but will still be colocated.

  • origin (Optional[tuple[float, float, float]] = None) – [units = um]. Local origin used for defining observation points. If None, uses the average of the centers of all surface monitors.

Notes

See also

FieldProjectionAngleMonitor

Monitor that samples electromagnetic near fields in the frequency domain and projects them at given observation angles.

Notebooks:

Attributes

currents

Sets the surface currents.

frequencies

Return the list of frequencies associated with the field monitors.

is_2d_simulation

medium

Medium into which fields are to be projected.

sim_data

surfaces

pts_per_wavelength

origin

Methods

apply_window_to_currents(proj_monitor, currents)

Apply windowing function to the surface currents.

compute_surface_currents(sim_data, surface, ...)

Returns resampled surface current densities associated with the surface monitor.

from_near_field_monitors(sim_data, ...[, ...])

Constructs FieldProjection from a list of surface monitors and their directions.

project_fields(proj_monitor[, verbose])

Compute projected fields.

trapezoid(ary, pts[, axes])

Trapezoidal integration in n dimensions.

sim_data#
surfaces#
pts_per_wavelength#
origin#
property is_2d_simulation#
property medium#

Medium into which fields are to be projected.

property frequencies#

Return the list of frequencies associated with the field monitors.

classmethod from_near_field_monitors(sim_data, near_monitors, normal_dirs, pts_per_wavelength=10, origin=None)[source]#

Constructs FieldProjection from a list of surface monitors and their directions.

Parameters:
  • sim_data (SimulationData) – Container for simulation data containing the near field monitors.

  • near_monitors (list[FieldMonitor]) – tuple of FieldMonitor objects on which near fields will be sampled.

  • normal_dirs (list[Literal['+', '-']]) – tuple containing the Literal['+', '-'] of the normal to each surface monitor w.r.t. to the positive x, y or z unit vectors. Must have the same length as monitors.

  • pts_per_wavelength (int = 10) – Number of points per wavelength with which to discretize the surface monitors for the projection. If None, fields will not be resampled.

  • origin (tuple[float, float, float]) – Local origin used for defining observation points. If None, uses the average of the centers of all surface monitors.

property currents#

Sets the surface currents.

static compute_surface_currents(sim_data, surface, medium, pts_per_wavelength=10)[source]#

Returns resampled surface current densities associated with the surface monitor.

Parameters:
  • sim_data (SimulationData) – Container for simulation data containing the near field monitors.

  • surface (FieldProjectionSurface) – FieldProjectionSurface to use as source of near field.

  • medium (MediumType) – Background medium through which to project fields.

  • pts_per_wavelength (int = 10) – Number of points per wavelength with which to discretize the surface monitors for the projection. If None, fields will not be resampled, but will still be colocated.

Returns:

Colocated surface current densities for the given surface.

Return type:

xarray.Dataset

static trapezoid(ary, pts, axes=0)[source]#

Trapezoidal integration in n dimensions.

Parameters:
  • ary (np.ndarray) – Array to integrate.

  • pts (Iterable[np.ndarray]) – Iterable of points for each dimension.

  • axes (Union[Iterable[int], int]) – Iterable of axes along which to integrate. If not an iterable, assume 1D integration.

Returns:

Integrated array.

Return type:

np.ndarray

static apply_window_to_currents(proj_monitor, currents)[source]#

Apply windowing function to the surface currents.

project_fields(proj_monitor, verbose=True)[source]#

Compute projected fields.

Parameters:
Returns:

Data structure with Er, Etheta, Ephi, Hr, Htheta, Hphi.

Return type:

AbstractFieldProjectionData