tidy3d.CustomSourceTime#

class CustomSourceTime[source]#

Bases: Pulse

Custom source time dependence consisting of a real or complex envelope modulated at a central frequency, as shown below.

Parameters:
  • amplitude (Attribute: amplitude) –

    Type

    NonNegativeFloat

    Default

    = 1.0

    Description

    Real-valued maximum amplitude of the time dependence.

  • phase (Attribute: phase) –

    Type

    float

    Default

    = 0.0

    Units

    rad

    Description

    Phase shift of the time dependence.

  • freq0 (Attribute: freq0) –

    Type

    PositiveFloat

    Default

    Units

    Hz

    Description

    Central frequency of the pulse.

  • fwidth (Attribute: fwidth) –

    Type

    PositiveFloat

    Default

    Units

    Hz

    Description

    Standard deviation of the frequency content of the pulse.

  • offset (Attribute: offset) –

    Type

    float

    Default

    = 0.0

    Description

    Time delay of the envelope in units of 1 / (2pi * fwidth).

  • source_time_dataset (Attribute: source_time_dataset) –

    Type

    Optional[TimeDataset]

    Default

    Description

    Dataset for storing the envelope of the custom source time. This envelope will be modulated by a complex exponential at frequency freq0.

Note

\[amp\_time(t) = amplitude \cdot \ e^{i \cdot phase - 2 \pi i \cdot freq0 \cdot t} \cdot \ envelope(t - offset / (2 \pi \cdot fwidth))\]

Note

Depending on the envelope, field decay may not occur. If field decay does not occur, then the simulation will run for the full run_time. Also, if field decay does not occur, then source normalization of frequency-domain monitors is not meaningful.

Note

The source time dependence is linearly interpolated to the simulation time steps. The sampling rate should be sufficiently fast that this interpolation does not introduce artifacts. The source time dependence should also start at zero and ramp up smoothly. The first and last values of the envelope will be used for times that are out of range of the provided data.

Example

>>> cst = CustomSourceTime.from_values(freq0=1, fwidth=0.1,
...     values=np.linspace(0, 9, 10), dt=0.1)

Attributes

Methods

amp_time(time)

Complex-valued source amplitude as a function of time.

from_values(freq0,Β fwidth,Β values,Β dt)

Create a CustomSourceTime from a numpy array.

offset#
source_time_dataset#
classmethod from_values(freq0, fwidth, values, dt)[source]#

Create a CustomSourceTime from a numpy array.

Parameters:
  • freq0 (float) – Central frequency of the source. The envelope provided will be modulated by a complex exponential at this frequency.

  • fwidth (float) – Estimated frequency width of the source.

  • values (ArrayComplex1D) – Complex values of the source envelope.

  • dt (float) – Time step for the values array. This value should be sufficiently small that the interpolation to simulation time steps does not introduce artifacts.

Returns:

CustomSourceTime with envelope given by values, modulated by a complex exponential at frequency freq0. The time coordinates are evenly spaced between 0 and dt * (N-1) with a step size of dt, where N is the length of the values array.

Return type:

CustomSourceTime

amp_time(time)[source]#

Complex-valued source amplitude as a function of time.

Parameters:

time (float) – Time in seconds.

Returns:

Complex-valued source amplitude at that time.

Return type:

complex

__hash__()#

Hash method.