tidy3d.components.source.Source
tidy3d.components.source.Source#
- class tidy3d.components.source.Source#
Abstract base class for all sources.
- Parameters
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.
source_time (Union[GaussianPulse, ContinuousWave]) – Specification of the source time-dependence.
name (Optional[str] = None) – Optional name for the source.
Show JSON schema
{ "title": "Source", "description": "Abstract base class for all sources.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\n [units = um]. Size in x, y, and z directions.\nsource_time : Union[GaussianPulse, ContinuousWave]\n Specification of the source time-dependence.\nname : Optional[str] = None\n Optional name for the source.", "type": "object", "properties": { "type": { "title": "Type", "default": "Source", "enum": [ "Source" ], "type": "string" }, "center": { "title": "Center", "description": "Center of object in x, y, and z.", "default": [ 0.0, 0.0, 0.0 ], "units": "um", "type": "array", "minItems": 3, "maxItems": 3, "items": [ { "type": "number" }, { "type": "number" }, { "type": "number" } ] }, "size": { "title": "Size", "description": "Size in x, y, and z directions.", "units": "um", "type": "array", "minItems": 3, "maxItems": 3, "items": [ { "type": "number", "minimum": 0 }, { "type": "number", "minimum": 0 }, { "type": "number", "minimum": 0 } ] }, "source_time": { "title": "Source Time", "description": "Specification of the source time-dependence.", "anyOf": [ { "$ref": "#/definitions/GaussianPulse" }, { "$ref": "#/definitions/ContinuousWave" } ] }, "name": { "title": "Name", "description": "Optional name for the source.", "type": "string" } }, "required": [ "size", "source_time" ], "additionalProperties": false, "definitions": { "GaussianPulse": { "title": "GaussianPulse", "description": "Source time dependence that describes a Gaussian pulse.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)", "type": "object", "properties": { "amplitude": { "title": "Amplitude", "description": "Real-valued maximum amplitude of the time dependence.", "default": 1.0, "minimum": 0, "type": "number" }, "phase": { "title": "Phase", "description": "Phase shift of the time dependence.", "default": 0.0, "units": "rad", "type": "number" }, "type": { "title": "Type", "default": "GaussianPulse", "enum": [ "GaussianPulse" ], "type": "string" }, "freq0": { "title": "Central Frequency", "description": "Central frequency of the pulse.", "units": "Hz", "exclusiveMinimum": 0, "type": "number" }, "fwidth": { "title": "Fwidth", "description": "Standard deviation of the frequency content of the pulse.", "units": "Hz", "exclusiveMinimum": 0, "type": "number" }, "offset": { "title": "Offset", "description": "Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).", "default": 5.0, "minimum": 2.5, "type": "number" } }, "required": [ "freq0", "fwidth" ], "additionalProperties": false }, "ContinuousWave": { "title": "ContinuousWave", "description": "Source time dependence that ramps up to continuous oscillation\nand holds until end of simulation.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n [units = rad]. Phase shift of the time dependence.\nfreq0 : PositiveFloat\n [units = Hz]. Central frequency of the pulse.\nfwidth : PositiveFloat\n [units = Hz]. Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\n\nExample\n-------\n>>> cw = ContinuousWave(freq0=200e12, fwidth=20e12)", "type": "object", "properties": { "amplitude": { "title": "Amplitude", "description": "Real-valued maximum amplitude of the time dependence.", "default": 1.0, "minimum": 0, "type": "number" }, "phase": { "title": "Phase", "description": "Phase shift of the time dependence.", "default": 0.0, "units": "rad", "type": "number" }, "type": { "title": "Type", "default": "ContinuousWave", "enum": [ "ContinuousWave" ], "type": "string" }, "freq0": { "title": "Central Frequency", "description": "Central frequency of the pulse.", "units": "Hz", "exclusiveMinimum": 0, "type": "number" }, "fwidth": { "title": "Fwidth", "description": "Standard deviation of the frequency content of the pulse.", "units": "Hz", "exclusiveMinimum": 0, "type": "number" }, "offset": { "title": "Offset", "description": "Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).", "default": 5.0, "minimum": 2.5, "type": "number" } }, "required": [ "freq0", "fwidth" ], "additionalProperties": false } } }
- attribute name: str = None#
Optional name for the source.
- Validated by
field_has_unique_names
- attribute source_time: Union[tidy3d.components.source.GaussianPulse, tidy3d.components.source.ContinuousWave] [Required]#
Specification of the source time-dependence.
- plot(x: Optional[float] = None, y: Optional[float] = None, z: Optional[float] = None, ax: Optional[matplotlib.axes._axes.Axes] = None, sim_bounds: Optional[Tuple[Tuple[float, float, float], Tuple[float, float, float]]] = None, **patch_kwargs) matplotlib.axes._axes.Axes #
Plot geometry cross section at single (x,y,z) coordinate.
- Parameters
x (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
y (float = None) – Position of plane in y direction, only one of x,y,z can be specified to define plane.
z (float = None) – Position of plane in z direction, only one of x,y,z can be specified to define plane.
ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
**patch_kwargs – Optional keyword arguments passed to the matplotlib patch plotting of structure. For details on accepted values, refer to Matplotlib’s documentation.
- Returns
The supplied or created matplotlib axes.
- Return type
matplotlib.axes._subplots.Axes
- property geometry: tidy3d.components.geometry.Box#
Box
representation of source.
- property plot_params: tidy3d.components.viz.PlotParams#
Default parameters for plotting a Source object.