tidy3d.components.source.SourceTime#
- class SourceTime[source]#
Bases:
AbstractTimeDependence
Base class describing the time dependence of a source.
- Parameters:
amplitude (NonNegativeFloat = 1.0) – Real-valued maximum amplitude of the time dependence.
phase (float = 0.0) – [units = rad]. Phase shift of the time dependence.
Attributes
Methods
frequency_range
([num_fwidth])Frequency range within plus/minus
num_fwidth * fwidth
of the central frequency.plot_spectrum
(times[, num_freqs, val, ax])Plot the complex-valued amplitude of the source time-dependence.
- plot_spectrum(times, num_freqs=101, val='real', ax=None)[source]#
Plot the complex-valued amplitude of the source time-dependence. Note: Only the real part of the time signal is used.
- Parameters:
times (np.ndarray) – Array of evenly-spaced times (seconds) to evaluate source time-dependence at. The spectrum is computed from this value and the source time frequency content. To see source spectrum for a specific
Simulation
, passsimulation.tmesh
.num_freqs (int = 101) – Number of frequencies to plot within the SourceTime.frequency_range.
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
- abstract frequency_range(num_fwidth=4.0)[source]#
Frequency range within plus/minus
num_fwidth * fwidth
of the central frequency.
- __hash__()#
Hash method.