{
  "title": "CustomSourceTime",
  "public_path": "flex_rf.tidy3d.CustomSourceTime",
  "lookup_path": "tidy3d.CustomSourceTime",
  "slug": "flex_rf/tidy3d/CustomSourceTime",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/customsourcetime/",
  "object_kind": "class",
  "introduction": "Custom source time dependence consisting of a real or complex envelope\nmodulated at a central frequency, as shown below.",
  "notes": "$$\namp\\_time(t) = amplitude \\cdot \\\n        e^{i \\cdot phase - 2 \\pi i \\cdot freq0 \\cdot t} \\cdot \\\n        envelope(t - offset / (2 \\pi \\cdot fwidth))\n$$\n\nDepending on the envelope, field decay may not occur.\nIf field decay does not occur, then the simulation will run for the full `run_time`.\nAlso, if field decay does not occur, then source normalization of frequency-domain\nmonitors is not meaningful.\n\nThe source time dependence is linearly interpolated to the simulation time steps.\nThe sampling rate should be sufficiently fast that this interpolation does not\nintroduce artifacts. The source time dependence should also start at zero and ramp up smoothly.\nThe first and last values of the envelope will be used for times that are out of range\nof the provided data.",
  "examples": "```python\ncst = CustomSourceTime.from_values(freq0=1, fwidth=0.1,\n    values=np.linspace(0, 9, 10), dt=0.1)\n```",
  "references": "",
  "signature": "class CustomSourceTime(Pulse)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/source/time.py",
    "url": "",
    "lineno": 478,
    "endlineno": 664
  },
  "bases": [
    "Pulse"
  ],
  "parameter_rows": [
    {
      "name": "offset",
      "annotation": "float",
      "default": "0.0",
      "description": "Time delay of the envelope in units of 1 / (`2pi * fwidth`).",
      "origin": "declared"
    },
    {
      "name": "source_time_dataset",
      "annotation": "TimeDataset | None",
      "default": "None",
      "description": "Dataset for storing the envelope of the custom source time. This envelope will be modulated by a complex exponential at frequency `freq0`.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "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.model_dump_json()`.",
      "origin": "inherited"
    },
    {
      "name": "amplitude",
      "annotation": "NonNegativeFloat",
      "default": "1.0",
      "description": "Real-valued maximum amplitude of the time dependence.",
      "origin": "inherited"
    },
    {
      "name": "phase",
      "annotation": "float",
      "default": "0.0",
      "description": "Phase shift of the time dependence.",
      "origin": "inherited"
    },
    {
      "name": "freq0",
      "annotation": "PositiveFloat",
      "default": "",
      "description": "Central frequency of the pulse.",
      "origin": "inherited"
    },
    {
      "name": "fwidth",
      "annotation": "PositiveFloat",
      "default": "",
      "description": "Standard deviation of the frequency content of the pulse.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "amp_time",
      "kind": "function",
      "signature": "amp_time(time: float | ArrayFloat1D)",
      "description": "Complex-valued source amplitude as a function of time."
    },
    {
      "name": "data_times",
      "kind": "attribute",
      "signature": "data_times: ArrayFloat1D",
      "description": "Times of envelope definition."
    },
    {
      "name": "end_time",
      "kind": "function",
      "signature": "end_time()",
      "description": "Time after which the source is effectively turned off / close to zero amplitude."
    },
    {
      "name": "from_values",
      "kind": "function",
      "signature": "from_values(freq0: float, fwidth: float, values: ArrayComplex1D, dt: float)",
      "description": "Create a `CustomSourceTime` from a numpy array."
    }
  ],
  "group": "flex_rf.tidy3d"
}
