tidy3d.components.source.Source#

class Source[source]#

Bases: Box, AbstractSource, ABC

Abstract base class for all sources.

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().

  • name (Optional[str] = None) – Optional name for the source.

  • center (Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.

  • size (Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]) – [units = um]. Size in x, y, and z directions.

  • source_time (Union[GaussianPulse, ContinuousWave, CustomSourceTime]) – Specification of the source time-dependence.

Attributes

geometry

Box representation of source.

plot_params

Default parameters for plotting a Source object.

attrs

Methods

plot([x,Β y,Β z,Β ax])

Plot this source.

Inherited Common Usage

source_time#
property plot_params#

Default parameters for plotting a Source object.

property geometry#

Box representation of source.

plot(x=None, y=None, z=None, ax=None, **patch_kwargs)[source]#

Plot this source.

__hash__()#

Hash method.