{
  "title": "FreqRange",
  "public_path": "flex_rf.tidy3d.FreqRange",
  "lookup_path": "tidy3d.FreqRange",
  "slug": "flex_rf/tidy3d/FreqRange",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/freqrange/",
  "object_kind": "class",
  "introduction": "Convenience class for handling frequency/wavelength conversion; it simplifies specification\nof frequency ranges and sample points for sources and monitors.",
  "notes": "Depending on the context the user can define desired frequency range by specifying:\n- central frequency `freq0` and frequency bandwidth `fwidth`;\n- frequency interval [`fmin`,`fmax`];\n- central wavelength `wvl0` and wavelength range `wvl_width`;\n- wavelength interval [`wvl_min`, `wvl_max`].",
  "examples": "```python\nimport tidy3d as td\nfreq0  = 1e12\nfwidth = 1e11\nfreq_range = td.FreqRange(freq0=freq0, fwidth=fwidth)\ncentral_freq = freq_range.freqs(num_points=1, spacing=\"uniform_freq\")\nfreqs = freq_range.freqs(num_points=11, spacing=\"uniform_wvl\")\nsource = freq_range.to_gaussian_pulse()\n```",
  "references": "",
  "signature": "class FreqRange(Tidy3dBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/frequencies.py",
    "url": "",
    "lineno": 254,
    "endlineno": 564
  },
  "bases": [
    "Tidy3dBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "freq0",
      "annotation": "PositiveFloat",
      "default": "...",
      "description": "Real-valued positive central frequency.",
      "origin": "declared"
    },
    {
      "name": "fwidth",
      "annotation": "PositiveFloat",
      "default": "...",
      "description": "Real-valued positive width of the frequency range (bandwidth).",
      "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"
    }
  ],
  "members": [
    {
      "name": "check_half_fwidth_less_than_freq0",
      "kind": "function",
      "signature": "check_half_fwidth_less_than_freq0()",
      "description": ""
    },
    {
      "name": "fmax",
      "kind": "attribute",
      "signature": "fmax: float",
      "description": "Infer highest frequency `fmax` from central frequency `freq0` and bandwidth `fwidth`."
    },
    {
      "name": "fmin",
      "kind": "attribute",
      "signature": "fmin: float",
      "description": "Infer lowest frequency `fmin` from central frequency `freq0` and bandwidth `fwidth`."
    },
    {
      "name": "freqs",
      "kind": "function",
      "signature": "freqs(num_points: int, spacing: str = 'uniform_freq')",
      "description": "method `freqs()` returns a numpy array of `num_point` frequencies uniformly sampled from the specified frequency range; if `num_points == 1` method returns the central frequency `freq0`."
    },
    {
      "name": "from_freq_interval",
      "kind": "function",
      "signature": "from_freq_interval(fmin: float, fmax: float)",
      "description": "method `from_freq_interval()` creates instance of class `FreqRange` from frequency interval defined by arguments `fmin` and `fmax`."
    },
    {
      "name": "from_wvl",
      "kind": "function",
      "signature": "from_wvl(wvl0: float, wvl_width: float)",
      "description": "method `from_wvl()` updated instance of class `FreqRange` by reassigning new frequency- and wavelength-related parameters."
    },
    {
      "name": "from_wvl_interval",
      "kind": "function",
      "signature": "from_wvl_interval(wvl_min: float, wvl_max: float)",
      "description": "method `from_wvl_interval()` updated instance of class `FreqRange` by reassigning new frequency- and wavelength-related parameters."
    },
    {
      "name": "sweep_decade",
      "kind": "function",
      "signature": "sweep_decade(num_points_per_decade: int)",
      "description": "Generate frequencies with logarithmic spacing across decades."
    },
    {
      "name": "to_gaussian_pulse",
      "kind": "function",
      "signature": "to_gaussian_pulse(**kwargs: Any)",
      "description": "to_gaussian_pulse(): Return a `GaussianPulse` instance based on this frequency range."
    },
    {
      "name": "wvl0",
      "kind": "attribute",
      "signature": "wvl0: float",
      "description": "Get central wavelength from central frequency and bandwidth."
    },
    {
      "name": "wvls",
      "kind": "function",
      "signature": "wvls(num_points: int, spacing: str = 'uniform_wvl')",
      "description": "method `wvls()` returns a numpy array of `num_points` wavelengths uniformly sampled from the range of wavelengths; if `num_points == 1` the method returns central wavelength `wvl0`."
    }
  ],
  "group": "flex_rf.tidy3d"
}
