{
  "title": "FieldData",
  "public_path": "flex_rf.tidy3d.FieldData",
  "lookup_path": "tidy3d.FieldData",
  "slug": "flex_rf/tidy3d/FieldData",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/fielddata/",
  "object_kind": "class",
  "introduction": "Data associated with a `FieldMonitor`: 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.\n\nThis dataset can contain all electric and magnetic field components: `Ex`, `Ey`, `Ez`, `Hx`, `Hy`,\nand `Hz`.",
  "examples": "```python\nfrom tidy3d import ScalarFieldDataArray\nx = [-1,1,3]\ny = [-2,0,2,4]\nz = [-3,-1,1,3,5]\nf = [2e14, 3e14]\ncoords = dict(x=x[:-1], y=y[:-1], z=z[:-1], f=f)\ngrid = Grid(boundaries=Coords(x=x, y=y, z=z))\nscalar_field = ScalarFieldDataArray((1+1j) * np.random.random((2,3,4,2)), coords=coords)\nmonitor = FieldMonitor(\n    size=(2,4,6), freqs=[2e14, 3e14], name='field', fields=['Ex', 'Hz'], colocate=True\n)\ndata = FieldData(monitor=monitor, Ex=scalar_field, Hz=scalar_field, grid_expanded=grid)\n```\n\n.. TODO sort out standalone data example.",
  "references": "",
  "signature": "class FieldData(FieldDataset, ElectromagneticFieldData)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/data/monitor_data.py",
    "url": "",
    "lineno": 1797,
    "endlineno": 1941
  },
  "bases": [
    "FieldDataset",
    "ElectromagneticFieldData"
  ],
  "parameter_rows": [
    {
      "name": "monitor",
      "annotation": "FieldMonitor",
      "default": "",
      "description": "Frequency-domain field monitor associated with the data.",
      "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": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the x-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Ey",
      "annotation": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the y-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Ez",
      "annotation": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the z-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Hx",
      "annotation": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the x-component of the magnetic field.",
      "origin": "inherited"
    },
    {
      "name": "Hy",
      "annotation": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the y-component of the magnetic field.",
      "origin": "inherited"
    },
    {
      "name": "Hz",
      "annotation": "ScalarFieldDataArray | None",
      "default": "None",
      "description": "Spatial distribution of the z-component of the magnetic field.",
      "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"
    }
  ],
  "members": [
    {
      "name": "normalize",
      "kind": "function",
      "signature": "normalize(source_spectrum_fn: Callable[[float], complex])",
      "description": "Return copy of self after normalization is applied using source spectrum function."
    },
    {
      "name": "to_source",
      "kind": "function",
      "signature": "to_source(source_time: SourceTimeType, center: Coordinate, size: Size = None, **kwargs: Any)",
      "description": "Create a `CustomFieldSource` from the fields stored in the `FieldData`."
    }
  ],
  "group": "flex_rf.tidy3d"
}
