{
  "title": "DirectivityData",
  "public_path": "flex_rf.tidy3d.DirectivityData",
  "lookup_path": "tidy3d.rf.DirectivityData",
  "slug": "flex_rf/tidy3d/DirectivityData",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/directivitydata/",
  "object_kind": "class",
  "introduction": "Data associated with a `DirectivityMonitor`.",
  "notes": "",
  "examples": "```python\nfrom tidy3d import FluxDataArray, FieldProjectionAngleDataArray\nf = np.linspace(1e14, 2e14, 10)\nr = np.atleast_1d(1e6)\ntheta = np.linspace(0, np.pi, 10)\nphi = np.linspace(0, 2*np.pi, 20)\ncoords = dict(r=r, theta=theta, phi=phi, f=f)\ncoords_flux = dict(f=f)\nvalues = (1+1j) * np.random.random((len(r), len(theta), len(phi), len(f)))\nflux_data = FluxDataArray(np.random.random(len(f)), coords=coords_flux)\nscalar_field = FieldProjectionAngleDataArray(values, coords=coords)\nmonitor = DirectivityMonitor(center=(1,2,3), size=(2,2,2), freqs=f, name='n2f_monitor', phi=phi, theta=theta)\ndata = DirectivityData(monitor=monitor, flux=flux_data, Er=scalar_field, Etheta=scalar_field, Ephi=scalar_field,\n    Hr=scalar_field, Htheta=scalar_field, Hphi=scalar_field, projection_surfaces=monitor.projection_surfaces)\n```",
  "references": "",
  "signature": "class DirectivityData(FieldProjectionAngleData)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/data/monitor_data.py",
    "url": "",
    "lineno": 4892,
    "endlineno": 5307
  },
  "bases": [
    "FieldProjectionAngleData"
  ],
  "parameter_rows": [
    {
      "name": "monitor",
      "annotation": "DirectivityMonitor",
      "default": "",
      "description": "Monitor describing the angle-based projection grid on which to measure directivity data.",
      "origin": "declared"
    },
    {
      "name": "flux",
      "annotation": "FluxDataArray",
      "default": "",
      "description": "Flux values that are either computed from fields recorded on the projection surfaces or by integrating the projected fields over a spherical surface.",
      "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": "Er",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of r-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Etheta",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of the theta-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Ephi",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of phi-component of the electric field.",
      "origin": "inherited"
    },
    {
      "name": "Hr",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of r-component of the magnetic field.",
      "origin": "inherited"
    },
    {
      "name": "Htheta",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of theta-component of the magnetic field.",
      "origin": "inherited"
    },
    {
      "name": "Hphi",
      "annotation": "FieldProjectionAngleDataArray",
      "default": "",
      "description": "Spatial distribution of phi-component of the magnetic field.",
      "origin": "inherited"
    },
    {
      "name": "medium",
      "annotation": "MediumType",
      "default": "factory: Medium",
      "description": "Background medium through which to project fields.",
      "origin": "inherited"
    },
    {
      "name": "is_2d_simulation",
      "annotation": "bool",
      "default": "False",
      "description": "Indicates whether the monitor data is for a 2D simulation.",
      "origin": "inherited"
    },
    {
      "name": "projection_surfaces",
      "annotation": "tuple[FieldProjectionSurface, ...]",
      "default": "",
      "description": "Surfaces of the monitor where near fields were recorded for projection",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "axial_ratio",
      "kind": "attribute",
      "signature": "axial_ratio: FieldProjectionAngleDataArray",
      "description": "Axial Ratio (AR) in the frequency domain as a function of angles theta and phi. AR is a dimensionless quantity defined as the ratio of the major axis to the minor axis of the polarization ellipse."
    },
    {
      "name": "calc_gain",
      "kind": "function",
      "signature": "calc_gain(power_in: FreqDataArray)",
      "description": "The gain figure of merit for antennas. Gain is dimensionless."
    },
    {
      "name": "calc_partial_gain",
      "kind": "function",
      "signature": "calc_partial_gain(power_in: FreqDataArray, pol_basis: PolarizationBasis = 'linear', tilt_angle: float | None = None)",
      "description": "The partial gain figures of merit for antennas. The partial gains are computed in the `linear` or `circular` polarization bases. If `tilt_angle` is not `None`, the partial directivity is computed in the linear polarization basis rotated by `tilt_angle` from the theta-axis. Gain is dimensionless."
    },
    {
      "name": "calc_radiation_efficiency",
      "kind": "function",
      "signature": "calc_radiation_efficiency(power_in: FreqDataArray)",
      "description": "Calculate radiation efficiency as the ratio of radiated power to input power."
    },
    {
      "name": "directivity",
      "kind": "attribute",
      "signature": "directivity: FieldProjectionAngleDataArray",
      "description": "Directivity in the frequency domain as a function of angles theta and phi. Directivity is a dimensionless quantity defined as the ratio of the radiation intensity in a given direction to the average radiation intensity over all directions."
    },
    {
      "name": "fields_circular_polarization",
      "kind": "attribute",
      "signature": "fields_circular_polarization: xr.Dataset",
      "description": "Electric and magnetic fields in the circular polarization basis."
    },
    {
      "name": "fields_linear_polarization_tilted",
      "kind": "function",
      "signature": "fields_linear_polarization_tilted(tilt_angle: float)",
      "description": "Electric and magnetic fields in the linear polarization basis that is rotated at the pole of the radiation sphere by `tilt_angle`."
    },
    {
      "name": "from_spherical_field_dataset",
      "kind": "function",
      "signature": "from_spherical_field_dataset(monitor: DirectivityMonitor, field_dataset: xr.Dataset)",
      "description": "Creates a `DirectivityData` instance from a spherical field dataset."
    },
    {
      "name": "left_polarization",
      "kind": "attribute",
      "signature": "left_polarization: FieldProjectionAngleDataArray",
      "description": "Electric far field for left-hand circular polarization (counterclockwise component) with an angle-based projection grid."
    },
    {
      "name": "normalize",
      "kind": "function",
      "signature": "normalize(source_spectrum_fn: Callable[[float], complex])",
      "description": "Return a copy of self after normalization is applied using the source spectrum function, for both field components and flux data."
    },
    {
      "name": "partial_directivity",
      "kind": "function",
      "signature": "partial_directivity(pol_basis: PolarizationBasis = 'linear', tilt_angle: float | None = None)",
      "description": "Directivity in the frequency domain as a function of angles theta and phi. The partial directivities are computed in the `linear` or `circular` polarization bases. If `tilt_angle` is not `None`, the radiation intensity is computed in the linear polarization basis rotated by `tilt_angle` from the theta-axis. Directivity is a dimensionless quantity defined as the ratio of the radiation intensity in a given direction to the average radiation intensity over all directions."
    },
    {
      "name": "partial_radiation_intensity",
      "kind": "function",
      "signature": "partial_radiation_intensity(pol_basis: PolarizationBasis = 'linear', tilt_angle: float | None = None)",
      "description": "Partial radiation intensity in the frequency domain as a function of angles theta and phi. The partial radiation intensities are computed in the `linear` or `circular` polarization bases. If `tilt_angle` is not `None`, the radiation intensity is computed in the linear polarization basis rotated by `tilt_angle` from the theta-axis. Radiation intensity is measured in units of Watts per unit solid angle."
    },
    {
      "name": "radiated_power",
      "kind": "attribute",
      "signature": "radiated_power: FreqDataArray",
      "description": "Total radiated power in the frequency domain with units of Watts."
    },
    {
      "name": "radiation_intensity",
      "kind": "attribute",
      "signature": "radiation_intensity: FieldProjectionAngleDataArray",
      "description": "Radiation intensity in the frequency domain as a function of angles theta and phi. Radiation intensity is measured in units of Watts per unit solid angle."
    },
    {
      "name": "right_polarization",
      "kind": "attribute",
      "signature": "right_polarization: FieldProjectionAngleDataArray",
      "description": "Electric far field for right-hand circular polarization (clockwise component) with an angle-based projection grid."
    }
  ],
  "group": "flex_rf.tidy3d"
}
