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'] and monitor_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 of tmesh for a TimeMonitor and to the size of freqs for a FreqMonitor.

  • 'eps': Relative permittivity, same shape as the E-field array.

  • 'mode_amps' (W1/2) For a ModeMonitor, the decomposition coefficients into the different modes, in units of power amplitude. The shape of the array is (2, Nf, Nmodes), where mode_amps[0, :, :] are the coefficients for forward-propagating modes, and mode_amps[1, :, :] - for backward-propagating modes.

  • 'modes' For a ModeMonitor, a list of length Nf of lists of length Nmodes of Mode objects which store the E and H fields of each mode as well as the real and imaginary part of the effective index, neff and keff. The fields are oriented in the mode plane axes, such that they are arrays of shape (3, Np1, Np2) where Np1 and Np2 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 is True (default), all fields and components are computed on the grid defined by [xmesh, ymesh, zmesh]. If interpolate is False, 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 is True, the staircased permittivity at the Yee grid cell centers is returned. If False, the subpixel smoothening is applied at geometry interfaces, if it was turned on in the original simulation.