{
  "title": "ModeSolverData",
  "public_path": "flex_rf.tidy3d.ModeSolverData",
  "lookup_path": "tidy3d.ModeSolverData",
  "slug": "flex_rf/tidy3d/ModeSolverData",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/modesolverdata/",
  "object_kind": "class",
  "introduction": "Data associated with a `ModeSolverMonitor`: scalar components of E and H fields.",
  "notes": "The data is stored as a [DataArray](https://docs.xarray.dev/en/stable/generated/xarray.DataArray.html)\nobject using the [xarray](https://docs.xarray.dev/en/stable/index.html) package.",
  "examples": "```python\nfrom tidy3d import ModeSpec\nfrom tidy3d import ScalarModeFieldDataArray, ModeIndexDataArray\nx = [-1,1,3]\ny = [-2,0]\nz = [-3,-1,1,3,5]\nf = [2e14, 3e14]\nmode_index = np.arange(5)\ngrid = Grid(boundaries=Coords(x=x, y=y, z=z))\nfield_coords = dict(x=x[:-1], y=y[:-1], z=z[:-1], f=f, mode_index=mode_index)\nfield = ScalarModeFieldDataArray((1+1j)*np.random.random((2,1,4,2,5)), coords=field_coords)\nindex_coords = dict(f=f, mode_index=mode_index)\nindex_data = ModeIndexDataArray((1+1j) * np.random.random((2,5)), coords=index_coords)\nmonitor = ModeSolverMonitor(\n   size=(2,0,6),\n   freqs=[2e14, 3e14],\n   mode_spec=ModeSpec(num_modes=5),\n   name='mode_solver',\n)\ndata = ModeSolverData(\n    monitor=monitor,\n    Ex=field,\n    Ey=field,\n    Ez=field,\n    Hx=field,\n    Hy=field,\n    Hz=field,\n    n_complex=index_data,\n    grid_expanded=grid\n)\n```",
  "references": "",
  "signature": "class ModeSolverData(ModeData)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/data/monitor_data.py",
    "url": "",
    "lineno": 3379,
    "endlineno": 3704
  },
  "bases": [
    "ModeData"
  ],
  "parameter_rows": [
    {
      "name": "monitor",
      "annotation": "ModeSolverMonitor",
      "default": "",
      "description": "Mode solver monitor associated with the data.",
      "origin": "declared"
    },
    {
      "name": "amps",
      "annotation": "ModeAmpsDataArray | None",
      "default": "None",
      "description": "Unused for ModeSolverData.",
      "origin": "declared"
    },
    {
      "name": "grid_distances_primal",
      "annotation": "tuple[float] | tuple[float, float]",
      "default": "(0.0,)",
      "description": "Relative distances to the primal grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.",
      "origin": "declared"
    },
    {
      "name": "grid_distances_dual",
      "annotation": "tuple[float] | tuple[float, float]",
      "default": "(0.0,)",
      "description": "Relative distances to the dual grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.",
      "origin": "declared"
    },
    {
      "name": "log",
      "annotation": "str | None",
      "default": "None",
      "description": "A string containing the log information from the mode solver run.",
      "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": "Ex",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the x-component of the electric field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "Ey",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the y-component of the electric field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "Ez",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the z-component of the electric field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "Hx",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the x-component of the magnetic field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "Hy",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the y-component of the magnetic field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "Hz",
      "annotation": "ScalarModeFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the z-component of the magnetic field of the mode.",
      "origin": "inherited"
    },
    {
      "name": "symmetry",
      "annotation": "tuple[Symmetry, Symmetry, Symmetry]",
      "default": "(0, 0, 0)",
      "description": "Symmetry eigenvalues of the original simulation in x, y, and z.",
      "origin": "inherited"
    },
    {
      "name": "symmetry_center",
      "annotation": "Coordinate | None",
      "default": "None",
      "description": "Center of the symmetry planes of the original simulation in x, y, and z. Required only if any of the `symmetry` field are non-zero.",
      "origin": "inherited"
    },
    {
      "name": "grid_expanded",
      "annotation": "Grid | None",
      "default": "None",
      "description": "`Grid` discretization of the associated monitor in the simulation which created the data. Required if symmetries are present, as well as in order to use some functionalities like getting Poynting vector and flux.",
      "origin": "inherited"
    },
    {
      "name": "grid_primal_correction",
      "annotation": "GRID_CORRECTION_TYPE",
      "default": "1.0",
      "description": "Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the primal grid locations along the normal direction.",
      "origin": "inherited"
    },
    {
      "name": "grid_dual_correction",
      "annotation": "GRID_CORRECTION_TYPE",
      "default": "1.0",
      "description": "Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the dual grid locations along the normal direction.",
      "origin": "inherited"
    },
    {
      "name": "n_complex",
      "annotation": "ModeIndexDataArray",
      "default": "",
      "description": "Complex-valued effective propagation constants associated with the mode.",
      "origin": "inherited"
    },
    {
      "name": "n_group_raw",
      "annotation": "GroupIndexDataArray | None",
      "default": "None",
      "description": "Index associated with group velocity of the mode.",
      "origin": "inherited"
    },
    {
      "name": "dispersion_raw",
      "annotation": "ModeDispersionDataArray | None",
      "default": "None",
      "description": "Dispersion parameter for the mode.",
      "origin": "inherited"
    },
    {
      "name": "eps_spec",
      "annotation": "list[EpsSpecType] | None",
      "default": "None",
      "description": "Characterization of the permittivity profile on the plane where modes are computed. Possible values are 'diagonal', 'tensorial_real', 'tensorial_complex'.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "interp_in_freq",
      "kind": "function",
      "signature": "interp_in_freq(freqs: FreqArray, method: Literal['linear', 'cubic', 'poly'] = 'linear', renormalize: bool = True, recalculate_grid_correction: bool = True, assume_sorted: bool = False)",
      "description": "Interpolate mode data to new frequency points."
    },
    {
      "name": "interpolated_copy",
      "kind": "attribute",
      "signature": "interpolated_copy: ModeSolverData",
      "description": "Return a copy of the data with interpolated fields."
    }
  ],
  "group": "flex_rf.tidy3d"
}
