tidy3d.Near2FarCartesianData#

class tidy3d.Near2FarCartesianData#

Data associated with a Near2FarCartesianMonitor: components of radiation vectors.

Parameters
  • monitor (Near2FarCartesianMonitor) – Ntheta : Optional[Near2FarCartesianDataArray] = None Spatial distribution of the theta-component of the N radiation vector.

  • Nphi (Optional[Near2FarCartesianDataArray] = None) – Spatial distribution of the phi-component of the N radiation vector.

  • Ltheta (Optional[Near2FarCartesianDataArray] = None) – Spatial distribution of the theta-component of the L radiation vector.

  • Lphi (Optional[Near2FarCartesianDataArray] = None) – Spatial distribution of the phi-component of the L radiation vector.

Example

>>> f = np.linspace(1e14, 2e14, 10)
>>> x = np.linspace(0, 5, 10)
>>> y = np.linspace(0, 10, 20)
>>> coords = dict(f=f, x=x, y=y)
>>> values = (1+1j) * np.random.random((len(x), len(y), len(f)))
>>> scalar_field = Near2FarCartesianDataArray(values, coords=coords)
>>> monitor = Near2FarCartesianMonitor(
...     center=(1,2,3), size=(2,2,2), freqs=f, name='n2f_monitor', x=x, y=y,
...     plane_axis=2, plane_distance=50
...     )
>>> data = Near2FarCartesianData(
...     monitor=monitor, Ntheta=scalar_field, Nphi=scalar_field,
...     Ltheta=scalar_field, Lphi=scalar_field
...     )

Show JSON schema
{
   "title": "Near2FarCartesianData",
   "description": "Data associated with a :class:`.Near2FarCartesianMonitor`: components of radiation vectors.\n\nParameters\n----------\nmonitor : Near2FarCartesianMonitor\n        Ntheta : Optional[Near2FarCartesianDataArray] = None\n    Spatial distribution of the theta-component of the N radiation vector.\nNphi : Optional[Near2FarCartesianDataArray] = None\n    Spatial distribution of the phi-component of the N radiation vector.\nLtheta : Optional[Near2FarCartesianDataArray] = None\n    Spatial distribution of the theta-component of the L radiation vector.\nLphi : Optional[Near2FarCartesianDataArray] = None\n    Spatial distribution of the phi-component of the L radiation vector.\n\nExample\n-------\n>>> f = np.linspace(1e14, 2e14, 10)\n>>> x = np.linspace(0, 5, 10)\n>>> y = np.linspace(0, 10, 20)\n>>> coords = dict(f=f, x=x, y=y)\n>>> values = (1+1j) * np.random.random((len(x), len(y), len(f)))\n>>> scalar_field = Near2FarCartesianDataArray(values, coords=coords)\n>>> monitor = Near2FarCartesianMonitor(\n...     center=(1,2,3), size=(2,2,2), freqs=f, name='n2f_monitor', x=x, y=y,\n...     plane_axis=2, plane_distance=50\n...     )\n>>> data = Near2FarCartesianData(\n...     monitor=monitor, Ntheta=scalar_field, Nphi=scalar_field,\n...     Ltheta=scalar_field, Lphi=scalar_field\n...     )",
   "type": "object",
   "properties": {
      "monitor": {
         "$ref": "#/definitions/Near2FarCartesianMonitor"
      },
      "type": {
         "title": "Type",
         "default": "Near2FarCartesianData",
         "enum": [
            "Near2FarCartesianData"
         ],
         "type": "string"
      },
      "Ntheta": {
         "title": "DataArray",
         "description": "Spatial distribution of the theta-component of the N radiation vector.",
         "type": "xr.DataArray",
         "properties": {
            "__slots__": {
               "title": "__slots__",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "__slots__"
         ]
      },
      "Nphi": {
         "title": "DataArray",
         "description": "Spatial distribution of the phi-component of the N radiation vector.",
         "type": "xr.DataArray",
         "properties": {
            "__slots__": {
               "title": "__slots__",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "__slots__"
         ]
      },
      "Ltheta": {
         "title": "DataArray",
         "description": "Spatial distribution of the theta-component of the L radiation vector.",
         "type": "xr.DataArray",
         "properties": {
            "__slots__": {
               "title": "__slots__",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "__slots__"
         ]
      },
      "Lphi": {
         "title": "DataArray",
         "description": "Spatial distribution of the phi-component of the L radiation vector.",
         "type": "xr.DataArray",
         "properties": {
            "__slots__": {
               "title": "__slots__",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "__slots__"
         ]
      }
   },
   "required": [
      "monitor"
   ],
   "additionalProperties": false,
   "definitions": {
      "Medium": {
         "title": "Medium",
         "description": "Dispersionless medium.\n\nParameters\n----------\nname : Optional[str] = None\n    Optional unique name for medium.\nfrequency_range : Optional[Tuple[float, float]] = None\n    [units = (Hz, Hz)].  Optional range of validity for the medium.\npermittivity : ConstrainedFloatValue = 1.0\n    [units = None (relative permittivity)].  Relative permittivity.\nconductivity : ConstrainedFloatValue = 0.0\n    [units = S/m].  Electric conductivity.  Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.\n\nExample\n-------\n>>> dielectric = Medium(permittivity=4.0, name='my_medium')\n>>> eps = dielectric.eps_model(200e12)",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "description": "Optional unique name for medium.",
               "type": "string"
            },
            "frequency_range": {
               "title": "Frequency Range",
               "description": "Optional range of validity for the medium.",
               "units": [
                  "Hz",
                  "Hz"
               ],
               "type": "array",
               "minItems": 2,
               "maxItems": 2,
               "items": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "number"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "Medium",
               "enum": [
                  "Medium"
               ],
               "type": "string"
            },
            "permittivity": {
               "title": "Permittivity",
               "description": "Relative permittivity.",
               "default": 1.0,
               "minimum": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "conductivity": {
               "title": "Conductivity",
               "description": "Electric conductivity.  Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.",
               "default": 0.0,
               "minimum": 0.0,
               "units": "S/m",
               "type": "number"
            }
         },
         "additionalProperties": false
      },
      "Near2FarCartesianMonitor": {
         "title": "Near2FarCartesianMonitor",
         "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand invokes the computation of far fields on a Cartesian observation plane.\nThe far-field approximation is used, so results projected to points close to\nthe monitor's position, compared to its size, may not be accurate.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n    [units = um].  Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\n    [units = um].  Size in x, y, and z directions.\nname : ConstrainedStrValue\n    Unique name for monitor.\nfreqs : Union[Tuple[float, ...], Array]\n    [units = Hz].  Array or list of frequencies stored by the field monitor.\nnormal_dir : Optional[Literal['+', '-']] = None\n    Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.\nexclude_surfaces : Optional[Tuple[Literal['x-', 'x+', 'y-', 'y+', 'z-', 'z+'], ...]] = None\n    Surfaces to exclude in the integration, if a volume monitor.\nfields : Tuple[Literal['Ntheta', 'Nphi', 'Ltheta', 'Lphi'], ...] = ['Ntheta', 'Nphi', 'Ltheta', 'Lphi']\n    Collection of radiation vector components to store in the monitor.\ncustom_origin : Optional[Tuple[float, float, float]] = None\n    [units = um].  Local origin used for defining observation points. If ``None``, uses the monitor's center.\nmedium : Medium = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)\n    Background medium in which to radiate near fields to far fields. If not provided, uses free space.\nplane_axis : Literal[0, 1, 2]\n    Axis along which the observation plane is oriented.\nplane_distance : float\n    Signed distance of the observation plane along ``plane_axis`` w.r.t. ``local_origin``\nx : Union[Tuple[float, ...], Array]\n    [units = um].  Local x observation coordinates w.r.t. ``local_origin`` and ``plane_axis``. When ``plane_axis`` is 0, this corresponds to the global y axis. When ``plane_axis`` is 1, this corresponds to the global x axis. When ``plane_axis`` is 2, this corresponds to the global x axis. \ny : Union[Tuple[float, ...], Array]\n    [units = um].  Local y observation coordinates w.r.t. ``local_origin`` and ``plane_axis``. When ``plane_axis`` is 0, this corresponds to the global z axis. When ``plane_axis`` is 1, this corresponds to the global z axis. When ``plane_axis`` is 2, this corresponds to the global y axis. \n\nExample\n-------\n>>> monitor = Near2FarCartesianMonitor(\n...     center=(1,2,3),\n...     size=(2,2,2),\n...     freqs=[250e12, 300e12],\n...     name='n2f_monitor',\n...     custom_origin=(1,2,3),\n...     x=[-1, 0, 1],\n...     y=[-2, -1, 0, 1, 2],\n...     plane_axis=2,\n...     plane_distance=5\n...     )",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "default": "Near2FarCartesianMonitor",
               "enum": [
                  "Near2FarCartesianMonitor"
               ],
               "type": "string"
            },
            "center": {
               "title": "Center",
               "description": "Center of object in x, y, and z.",
               "default": [
                  0.0,
                  0.0,
                  0.0
               ],
               "units": "um",
               "type": "array",
               "minItems": 3,
               "maxItems": 3,
               "items": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "number"
                  }
               ]
            },
            "size": {
               "title": "Size",
               "description": "Size in x, y, and z directions.",
               "units": "um",
               "type": "array",
               "minItems": 3,
               "maxItems": 3,
               "items": [
                  {
                     "type": "number",
                     "minimum": 0
                  },
                  {
                     "type": "number",
                     "minimum": 0
                  },
                  {
                     "type": "number",
                     "minimum": 0
                  }
               ]
            },
            "name": {
               "title": "Name",
               "description": "Unique name for monitor.",
               "minLength": 1,
               "type": "string"
            },
            "freqs": {
               "title": "Frequencies",
               "description": "Array or list of frequencies stored by the field monitor.",
               "units": "Hz",
               "anyOf": [
                  {
                     "type": "array",
                     "items": {
                        "type": "number"
                     }
                  },
                  {
                     "title": "Array Like",
                     "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
                     "type": "tuple",
                     "properties": {},
                     "required": []
                  }
               ]
            },
            "normal_dir": {
               "title": "Normal vector orientation",
               "description": "Direction of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of ``'+'`` or ``'-'``. Applies to surface monitors only, and defaults to ``'+'`` if not provided.",
               "enum": [
                  "+",
                  "-"
               ],
               "type": "string"
            },
            "exclude_surfaces": {
               "title": "Excluded surfaces",
               "description": "Surfaces to exclude in the integration, if a volume monitor.",
               "type": "array",
               "items": {
                  "enum": [
                     "x-",
                     "x+",
                     "y-",
                     "y+",
                     "z-",
                     "z+"
                  ],
                  "type": "string"
               }
            },
            "fields": {
               "title": "Field Components",
               "description": "Collection of radiation vector components to store in the monitor.",
               "default": [
                  "Ntheta",
                  "Nphi",
                  "Ltheta",
                  "Lphi"
               ],
               "type": "array",
               "items": {
                  "enum": [
                     "Ntheta",
                     "Nphi",
                     "Ltheta",
                     "Lphi"
                  ],
                  "type": "string"
               }
            },
            "custom_origin": {
               "title": "Local origin",
               "description": "Local origin used for defining observation points. If ``None``, uses the monitor's center.",
               "units": "um",
               "type": "array",
               "minItems": 3,
               "maxItems": 3,
               "items": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "number"
                  }
               ]
            },
            "medium": {
               "title": "Background medium",
               "description": "Background medium in which to radiate near fields to far fields. If not provided, uses free space.",
               "default": {
                  "name": null,
                  "frequency_range": null,
                  "type": "Medium",
                  "permittivity": 1.0,
                  "conductivity": 0.0
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  }
               ]
            },
            "plane_axis": {
               "title": "Observation plane axis",
               "description": "Axis along which the observation plane is oriented.",
               "enum": [
                  0,
                  1,
                  2
               ],
               "type": "integer"
            },
            "plane_distance": {
               "title": "Observation plane signed distance",
               "description": "Signed distance of the observation plane along ``plane_axis`` w.r.t. ``local_origin``",
               "type": "number"
            },
            "x": {
               "title": "Local x observation coordinates",
               "description": "Local x observation coordinates w.r.t. ``local_origin`` and ``plane_axis``. When ``plane_axis`` is 0, this corresponds to the global y axis. When ``plane_axis`` is 1, this corresponds to the global x axis. When ``plane_axis`` is 2, this corresponds to the global x axis. ",
               "units": "um",
               "anyOf": [
                  {
                     "type": "array",
                     "items": {
                        "type": "number"
                     }
                  },
                  {
                     "title": "Array Like",
                     "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
                     "type": "tuple",
                     "properties": {},
                     "required": []
                  }
               ]
            },
            "y": {
               "title": "Local y observation coordinates",
               "description": "Local y observation coordinates w.r.t. ``local_origin`` and ``plane_axis``. When ``plane_axis`` is 0, this corresponds to the global z axis. When ``plane_axis`` is 1, this corresponds to the global z axis. When ``plane_axis`` is 2, this corresponds to the global y axis. ",
               "units": "um",
               "anyOf": [
                  {
                     "type": "array",
                     "items": {
                        "type": "number"
                     }
                  },
                  {
                     "title": "Array Like",
                     "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
                     "type": "tuple",
                     "properties": {},
                     "required": []
                  }
               ]
            }
         },
         "required": [
            "size",
            "name",
            "freqs",
            "plane_axis",
            "plane_distance",
            "x",
            "y"
         ],
         "additionalProperties": false
      }
   }
}

Fields
  • Lphi (tidy3d.components.data.data_array.Near2FarCartesianDataArray)

  • Ltheta (tidy3d.components.data.data_array.Near2FarCartesianDataArray)

  • Nphi (tidy3d.components.data.data_array.Near2FarCartesianDataArray)

  • Ntheta (tidy3d.components.data.data_array.Near2FarCartesianDataArray)

  • monitor (tidy3d.components.monitor.Near2FarCartesianMonitor)

attribute Lphi: tidy3d.components.data.data_array.Near2FarCartesianDataArray = None#

Spatial distribution of the phi-component of the L radiation vector.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘__slots__’: {‘title’: ‘__slots__’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘__slots__’]

Validated by
  • _contains_fields

attribute Ltheta: tidy3d.components.data.data_array.Near2FarCartesianDataArray = None#

Spatial distribution of the theta-component of the L radiation vector.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘__slots__’: {‘title’: ‘__slots__’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘__slots__’]

Validated by
  • _contains_fields

attribute Nphi: tidy3d.components.data.data_array.Near2FarCartesianDataArray = None#

Spatial distribution of the phi-component of the N radiation vector.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘__slots__’: {‘title’: ‘__slots__’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘__slots__’]

Validated by
  • _contains_fields

attribute Ntheta: tidy3d.components.data.data_array.Near2FarCartesianDataArray = None#

Spatial distribution of the theta-component of the N radiation vector.

Constraints
  • title = DataArray

  • type = xr.DataArray

  • properties = {‘__slots__’: {‘title’: ‘__slots__’, ‘type’: ‘Tuple[str, …]’}}

  • required = [‘__slots__’]

Validated by
  • _contains_fields

attribute monitor: tidy3d.components.monitor.Near2FarCartesianMonitor [Required]#
Validated by
  • _contains_fields

fields(medium: tidy3d.components.medium.Medium = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)) xarray.core.dataset.Dataset#

Get fields on a cartesian plane at a distance relative to monitor center along a given axis.

Parameters

medium (Medium) – Background medium in which to radiate near fields to far fields. Default: free space.

Returns

xarray dataset containing (Ex, Ey, Ez), (Hx, Hy, Hz) in cartesian coordinates.

Return type

xarray.Dataset

power(medium: tidy3d.components.medium.Medium = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)) xarray.core.dataset.Dataset#

Get power on the observation grid defined in Cartesian coordinates.

Parameters

medium (Medium) – Background medium in which to radiate near fields to far fields. Default: free space.

Returns

Power at points relative to the local origin.

Return type

xarray.DataArray