tidy3d.Simulation.data¶
- Simulation.data(monitor)¶
Return a dictionary with all the stored data in a
Monitor
.- Parameters
monitor (Monitor) – The queried monitor.
- Returns
monitor_data – Dictonary with all the data currently in the monitor. For example, in a frequency monitor, after a simulation run,
monitor_data['E']
andmonitor_data['H']
are 5D arrays of shape(3, Nx, Ny, Nz, Nf)
The first index is the vector component of the field, the next three dimensions index the x, y, z, position in space, and the last index is the frequency index at which the data was stored.Returned data is organized as explained below. Some of the items may be empty arrays depending on the monitor settings.
'xmesh'
: (micron) Center coordinate of the Yee cells along x.'ymesh'
: (micron) Center coordinate of the Yee cells along y.'zmesh'
: (micron) Center coordinate of the Yee cells along z.'xmesh_b'
: (micron) Beginning coordinate of the Yee cells along x.'ymesh_b'
: (micron) Beginning coordinate of the Yee cells along y.'zmesh_b'
: (micron) Beginning coordinate of the Yee cells along z.'tmesh'
: (s) Time points at which the fields are stored. Empty array for a frequency monitor.'freqs'
: (Hz) Frequencies at which the fields are stored. Empty array for a time monitor.'E'
: (V/micron) E-field array.'H'
: (A/micron) H-field array.'flux'
: (W) flux array with size equal to the size oftmesh
for aTimeMonitor
and to the size offreqs
for aFreqMonitor
.'eps'
: Relative permittivity, same shape as the E-field array.'mode_amps'
(W^{1/2}) For aModeMonitor
, the decomposition coefficients into the different modes, in units of power amplitude. The shape of the array is(2, Nf, Nmodes)
, wheremode_amps[0, :, :]
are the coefficients for forward-propagating modes, andmode_amps[1, :, :]
- for backward-propagating modes.'modes'
For aModeMonitor
, a list of lengthNf
of lists of lengthNmodes
ofMode
objects which store theE
andH
fields of each mode as well as the real and imaginary part of the effective index,neff
andkeff
. The fields are oriented in the mode plane axes, such that they are arrays of shape (3, Np1, Np2) whereNp1
andNp2
are the two in-plane directions. The three components are also oriented in-plane as(parallel_1, parallel_2, normal)
.
- Return type
dict
Note
If the
interpolate
parameter of the Monitor isTrue
(default), all fields and components are computed on the grid defined by[xmesh, ymesh, zmesh]
. Ifinterpolate
isFalse
, the field components live on the following grids:Ex
:[xmesh, ymesh_b, zmesh_b]
Ey
:[xmesh_b, ymesh, zmesh_b]
Ez
:[xmesh_b, ymesh_b, zmesh]
Hx
:[xmesh_b, ymesh, zmesh]
Hy
:[xmesh, ymesh_b, zmesh]
Hz
:[xmesh, ymesh, zmesh_b]
If stored, the permittivity array has the same dimension as the E-field array. If
interpolate
isTrue
, the staircased permittivity at the Yee grid cell centers is returned. IfFalse
, the subpixel smoothening is applied at geometry interfaces, if it was turned on in the original simulation.