tidy3d.components.base_sim.monitor.AbstractMonitor#

class AbstractMonitor[source]#

Bases: Box, ABC

Abstract base class for steady-state monitors.

Parameters:
  • attrs (dict = {}) โ€“ Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • center (Tuple[float, float, float] = (0.0, 0.0, 0.0)) โ€“ [units = um]. Center of object in x, y, and z.

  • size (Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]) โ€“ [units = um]. Size in x, y, and z directions.

  • name (ConstrainedStrValue) โ€“ Unique name for monitor.

Attributes

geometry

Box representation of monitor.

plot_params

Default parameters for plotting a Monitor object.

attrs

Methods

downsample(arr,ย axis)

Downsample a 1D array making sure to keep the first and last entries, based on the spatial interval defined for the axis.

downsampled_num_cells(num_cells)

Given a tuple of the number of cells spanned by the monitor along each dimension, return the number of cells one would have after downsampling based on interval_space.

storage_size(num_cells,ย tmesh)

Size of monitor storage given the number of points after discretization.

Inherited Common Usage

name#
property plot_params#

Default parameters for plotting a Monitor object.

property geometry#

Box representation of monitor.

Returns:

Representation of the monitor geometry as a Box.

Return type:

Box

abstract storage_size(num_cells, tmesh)[source]#

Size of monitor storage given the number of points after discretization.

Parameters:
  • num_cells (int) โ€“ Number of grid cells within the monitor after discretization by a Simulation.

  • tmesh (Array) โ€“ The discretized time mesh of a Simulation.

Returns:

Number of bytes to be stored in monitor.

Return type:

int

downsample(arr, axis)[source]#

Downsample a 1D array making sure to keep the first and last entries, based on the spatial interval defined for the axis.

Parameters:
  • arr (Numpy) โ€“ A 1D array of arbitrary type.

  • axis (Axis) โ€“ Axis for which to select the interval_space defined for the monitor.

Returns:

Downsampled array.

Return type:

Numpy

downsampled_num_cells(num_cells)[source]#

Given a tuple of the number of cells spanned by the monitor along each dimension, return the number of cells one would have after downsampling based on interval_space.

__hash__()#

Hash method.