flex_rf.tidy3d.DiffractionData
Type: class │ Base(s): AbstractFieldProjectionData
Description
Section titled “Description”Data for a DiffractionMonitor: complex components of diffracted far fields.
The diffraction data are separated into S and P polarizations. At normal incidence when
S and P are undefined, P(S) corresponds to Ey(Ez) polarization for monitor normal
to x, P(S) corresponds to Ex(Ez) polarization for monitor normal to y, and P(S)
corresponds to Ex(Ey) polarization for monitor normal to z.
The power amplitudes per polarization and diffraction order, and correspondingly the power per diffraction order, correspond to the power carried by each diffraction order in the monitor normal direction. They are not to be confused with power carried by plane waves in the propagation direction of each diffraction order, which can be obtained from the spherical-coordinate fields which are also stored. The power definition is such that the grating efficiency is the recorded power over the input source power, and the direct sum over the power in all orders should equal the total power flowing through the monitor.
Example(s)
Section titled “Example(s)”from tidy3d import DiffractionDataArrayf = np.linspace(1e14, 2e14, 10)orders_x = list(range(-4, 5))orders_y = list(range(-6, 7))pol = ["s", "p"]coords = dict(orders_x=orders_x, orders_y=orders_y, f=f)values = (1+1j) * np.random.random((len(orders_x), len(orders_y), len(f)))field = DiffractionDataArray(values, coords=coords)monitor = DiffractionMonitor( center=(1,2,3), size=(np.inf,np.inf,0), freqs=f, name='diffraction')data = DiffractionData( monitor=monitor, sim_size=[1,1], bloch_vecs=[1,2], Etheta=field, Ephi=field, Er=field, Htheta=field, Hphi=field, Hr=field,)Parameters
Section titled “Parameters”monitor [DiffractionMonitor] |
|
Diffraction monitor associated with the data. |
Er [DiffractionDataArray] |
|
Spatial distribution of r-component of the electric field. |
Etheta [DiffractionDataArray] |
|
Spatial distribution of the theta-component of the electric field. |
Ephi [DiffractionDataArray] |
|
Spatial distribution of phi-component of the electric field. |
Hr [DiffractionDataArray] |
|
Spatial distribution of r-component of the magnetic field. |
Htheta [DiffractionDataArray] |
|
Spatial distribution of theta-component of the magnetic field. |
Hphi [DiffractionDataArray] |
|
Spatial distribution of phi-component of the magnetic field. |
sim_size [tuple[float, float]] |
|
Size of the near field in the local x and y directions. |
bloch_vecs [tuple[float, float] | tuple[ArrayFloat1D, ArrayFloat1D]] |
|
Bloch vectors along the local x and y directions in units of |
medium [MediumType] = factory: Medium |
|
Background medium through which to project fields. |
is_2d_simulation [bool] = False |
|
Indicates whether the monitor data is for a 2D simulation. |
Attributes
Section titled “Attributes”amps [DataArray] |
|
Complex power amplitude in each order for ‘s’ and ‘p’ polarizations, normalized so that the power carried by the wave of that order and polarization equals |
angles [tuple[DataArray]] |
|
The (theta, phi) angles corresponding to each allowed pair of diffraction orders storeds as data arrays. Disallowed angles are set to |
coords_spherical [dict[str, np.ndarray]] |
|
Coordinates grid for the fields in the spherical system. |
fields_cartesian [xr.Dataset] |
|
Get all field components in Cartesian coordinates relative to the monitor’s local origin for all allowed diffraction orders and frequencies specified in the |
fields_spherical [xr.Dataset] |
|
Get all field components in spherical coordinates relative to the monitor’s local origin for all allowed diffraction orders and frequencies specified in the |
orders_x [np.ndarray] |
|
Allowed orders along x. |
orders_y [np.ndarray] |
|
Allowed orders along y. |
power [DataArray] |
|
Total power in each order, summed over both polarizations. |
radar_cross_section [DataArray] |
|
Radar cross section in units of incident power. |
reciprocal_vectors [tuple[np.ndarray, np.ndarray]] |
|
Get the normalized “ux” and “uy” reciprocal vectors. |
ux [np.ndarray] |
|
Normalized wave vector along x relative to |
uy [np.ndarray] |
|
Normalized wave vector along y relative to |
Methods
Section titled “Methods”adjoint_source_amp(amp: DataArray, fwidth: float) |
|
Generate an adjoint |
compute_angles(reciprocal_vectors: tuple[np.ndarray, np.ndarray]) |
|
Compute the polar and azimuth angles associated with the given reciprocal vectors. |
reciprocal_coords(orders: np.ndarray, size: float, bloch_vec: float | np.ndarray, f: float, medium: MediumType) |
|
Get the normalized “u” reciprocal coords for a vector of orders, size, and bloch vec. |
shifted_orders(orders: tuple[int, ...], bloch_vec: float | np.ndarray) |
|
Diffraction orders shifted by the Bloch vector. |