tidy3d.ApodizationSpec#
- class ApodizationSpec[source]#
Bases:
Tidy3dBaseModel
Stores specifications for the apodizaton of frequency-domain 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 anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.start (Optional[NonNegativeFloat] = None) – [units = sec]. Defines the time at which the start apodization ends.
end (Optional[NonNegativeFloat] = None) – [units = sec]. Defines the time at which the end apodization begins.
width (Optional[PositiveFloat] = None) – [units = sec]. Characteristic decay length of the apodization function.
Example
>>> apod_spec = ApodizationSpec(start=1, end=2, width=0.5)
Attributes
Methods
end_greater_than_start
(val, values)Ensure end is greater than or equal to start.
plot
(times[, ax])Plot the apodization function.
width_provided
(val, values)Check that width is provided if either start or end apodization is requested.
Inherited Common Usage
- start#
- end#
- width#
- classmethod end_greater_than_start(val, values)[source]#
Ensure end is greater than or equal to start.
- classmethod width_provided(val, values)[source]#
Check that width is provided if either start or end apodization is requested.
- plot(times, ax=None)[source]#
Plot the apodization function.
- Parameters:
times (np.ndarray) – Array of times (seconds) to plot source at. To see source time amplitude for a specific
Simulation
, passsimulation.tmesh
.ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- __hash__()#
Hash method.