tidy3d.FieldProjectionCartesianData#

class tidy3d.FieldProjectionCartesianData#

Bases: tidy3d.components.data.monitor_data.AbstractFieldProjectionData

Data associated with a FieldProjectionCartesianMonitor: components of projected fields.

Parameters

Example

>>> from tidy3d import FieldProjectionCartesianDataArray
>>> f = np.linspace(1e14, 2e14, 10)
>>> x = np.linspace(0, 5, 10)
>>> y = np.linspace(0, 10, 20)
>>> z = np.atleast_1d(5)
>>> coords = dict(x=x, y=y, z=z, f=f)
>>> values = (1+1j) * np.random.random((len(x), len(y), len(z), len(f)))
>>> scalar_field = FieldProjectionCartesianDataArray(values, coords=coords)
>>> monitor = FieldProjectionCartesianMonitor(
...     center=(1,2,3), size=(2,2,2), freqs=f, name='n2f_monitor', x=x, y=y,
...     proj_axis=2, proj_distance=50
...     )
>>> data = FieldProjectionCartesianData(
...     monitor=monitor, Er=scalar_field, Etheta=scalar_field, Ephi=scalar_field,
...     Hr=scalar_field, Htheta=scalar_field, Hphi=scalar_field,
...     projection_surfaces=monitor.projection_surfaces,
...     )

Show JSON schema
{
   "title": "FieldProjectionCartesianData",
   "description": "Data associated with a :class:`.FieldProjectionCartesianMonitor`: components of\nprojected fields.\n\nParameters\n----------\nmonitor : FieldProjectionCartesianMonitor\n    Field projection monitor with a Cartesian projection grid.\nEr : FieldProjectionCartesianDataArray\n    Spatial distribution of r-component of the electric field.\nEtheta : FieldProjectionCartesianDataArray\n    Spatial distribution of the theta-component of the electric field.\nEphi : FieldProjectionCartesianDataArray\n    Spatial distribution of phi-component of the electric field.\nHr : FieldProjectionCartesianDataArray\n    Spatial distribution of r-component of the magnetic field.\nHtheta : FieldProjectionCartesianDataArray\n    Spatial distribution of theta-component of the magnetic field.\nHphi : FieldProjectionCartesianDataArray\n    Spatial distribution of phi-component of the magnetic field.\nmedium : Union[Medium, CustomMedium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)\n    Background medium through which to project fields.\nprojection_surfaces : Tuple[FieldProjectionSurface, ...]\n    Surfaces of the monitor where near fields were recorded for projection\n\nExample\n-------\n>>> from tidy3d import FieldProjectionCartesianDataArray\n>>> f = np.linspace(1e14, 2e14, 10)\n>>> x = np.linspace(0, 5, 10)\n>>> y = np.linspace(0, 10, 20)\n>>> z = np.atleast_1d(5)\n>>> coords = dict(x=x, y=y, z=z, f=f)\n>>> values = (1+1j) * np.random.random((len(x), len(y), len(z), len(f)))\n>>> scalar_field = FieldProjectionCartesianDataArray(values, coords=coords)\n>>> monitor = FieldProjectionCartesianMonitor(\n...     center=(1,2,3), size=(2,2,2), freqs=f, name='n2f_monitor', x=x, y=y,\n...     proj_axis=2, proj_distance=50\n...     )\n>>> data = FieldProjectionCartesianData(\n...     monitor=monitor, Er=scalar_field, Etheta=scalar_field, Ephi=scalar_field,\n...     Hr=scalar_field, Htheta=scalar_field, Hphi=scalar_field,\n...     projection_surfaces=monitor.projection_surfaces,\n...     )",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "FieldProjectionCartesianData",
         "enum": [
            "FieldProjectionCartesianData"
         ],
         "type": "string"
      },
      "monitor": {
         "title": "Projection monitor",
         "description": "Field projection monitor with a Cartesian projection grid.",
         "allOf": [
            {
               "$ref": "#/definitions/FieldProjectionCartesianMonitor"
            }
         ]
      },
      "Er": {
         "title": "DataArray",
         "description": "Spatial distribution of r-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Etheta": {
         "title": "DataArray",
         "description": "Spatial distribution of the theta-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Ephi": {
         "title": "DataArray",
         "description": "Spatial distribution of phi-component of the electric field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Hr": {
         "title": "DataArray",
         "description": "Spatial distribution of r-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Htheta": {
         "title": "DataArray",
         "description": "Spatial distribution of theta-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "Hphi": {
         "title": "DataArray",
         "description": "Spatial distribution of phi-component of the magnetic field.",
         "type": "xr.DataArray",
         "properties": {
            "_dims": {
               "title": "_dims",
               "type": "Tuple[str, ...]"
            }
         },
         "required": [
            "_dims"
         ]
      },
      "medium": {
         "title": "Background Medium",
         "description": "Background medium through which to project fields.",
         "default": {
            "name": null,
            "frequency_range": null,
            "type": "Medium",
            "permittivity": 1.0,
            "conductivity": 0.0
         },
         "anyOf": [
            {
               "$ref": "#/definitions/Medium"
            },
            {
               "$ref": "#/definitions/CustomMedium"
            },
            {
               "$ref": "#/definitions/AnisotropicMedium"
            },
            {
               "$ref": "#/definitions/PECMedium"
            },
            {
               "$ref": "#/definitions/PoleResidue"
            },
            {
               "$ref": "#/definitions/Sellmeier"
            },
            {
               "$ref": "#/definitions/Lorentz"
            },
            {
               "$ref": "#/definitions/Debye"
            },
            {
               "$ref": "#/definitions/Drude"
            }
         ]
      },
      "projection_surfaces": {
         "title": "Projection surfaces",
         "description": "Surfaces of the monitor where near fields were recorded for projection",
         "type": "array",
         "items": {
            "$ref": "#/definitions/FieldProjectionSurface"
         }
      }
   },
   "required": [
      "monitor",
      "Er",
      "Etheta",
      "Ephi",
      "Hr",
      "Htheta",
      "Hphi",
      "projection_surfaces"
   ],
   "additionalProperties": false,
   "definitions": {
      "ApodizationSpec": {
         "title": "ApodizationSpec",
         "description": "Stores specifications for the apodizaton of frequency-domain monitors.\n\nParameters\n----------\nstart : Optional[NonNegativeFloat] = None\n    [units = sec].  Defines the time at which the start apodization ends.\nend : Optional[NonNegativeFloat] = None\n    [units = sec].  Defines the time at which the end apodization begins.\nwidth : Optional[PositiveFloat] = None\n    [units = sec].  Characteristic decay length of the apodization function.\n\nExample\n-------\n>>> apod_spec = ApodizationSpec(start=1, end=2, width=0.5)",
         "type": "object",
         "properties": {
            "start": {
               "title": "Start Interval",
               "description": "Defines the time at which the start apodization ends.",
               "units": "sec",
               "minimum": 0,
               "type": "number"
            },
            "end": {
               "title": "End Interval",
               "description": "Defines the time at which the end apodization begins.",
               "units": "sec",
               "minimum": 0,
               "type": "number"
            },
            "width": {
               "title": "Apodization Width",
               "description": "Characteristic decay length of the apodization function.",
               "units": "sec",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "type": {
               "title": "Type",
               "default": "ApodizationSpec",
               "enum": [
                  "ApodizationSpec"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      },
      "FieldProjectionCartesianMonitor": {
         "title": "FieldProjectionCartesianMonitor",
         "description": ":class:`Monitor` that samples electromagnetic near fields in the frequency domain\nand projects them on a Cartesian observation plane.\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.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n    Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\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.\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.\nfar_field_approx : bool = True\n    Whether to enable the far field approximation when projecting fields.\nproj_axis : Literal[0, 1, 2]\n    Axis along which the observation plane is oriented.\nproj_distance : float = 1000000.0\n    [units = um].  Signed distance of the projection plane along ``proj_axis``. from the plane containing ``local_origin``.\nx : Union[Tuple[float, ...], Array]\n    [units = um].  Local x observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global y axis. When ``proj_axis`` is 1, this corresponds to the global x axis. When ``proj_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 ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global z axis. When ``proj_axis`` is 1, this corresponds to the global z axis. When ``proj_axis`` is 2, this corresponds to the global y axis. \n\nExample\n-------\n>>> monitor = FieldProjectionCartesianMonitor(\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...     proj_axis=2,\n...     proj_distance=5\n...     )",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "default": "FieldProjectionCartesianMonitor",
               "enum": [
                  "FieldProjectionCartesianMonitor"
               ],
               "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": []
                  }
               ]
            },
            "apodization": {
               "title": "Apodization Specification",
               "description": "Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.",
               "default": {
                  "start": null,
                  "end": null,
                  "width": null,
                  "type": "ApodizationSpec"
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/ApodizationSpec"
                  }
               ]
            },
            "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"
               }
            },
            "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"
                  }
               ]
            },
            "far_field_approx": {
               "title": "Far field approximation",
               "description": "Whether to enable the far field approximation when projecting fields.",
               "default": true,
               "type": "boolean"
            },
            "proj_axis": {
               "title": "Projection plane axis",
               "description": "Axis along which the observation plane is oriented.",
               "enum": [
                  0,
                  1,
                  2
               ],
               "type": "integer"
            },
            "proj_distance": {
               "title": "Projection distance",
               "description": "Signed distance of the projection plane along ``proj_axis``. from the plane containing ``local_origin``.",
               "default": 1000000.0,
               "units": "um",
               "type": "number"
            },
            "x": {
               "title": "Local x observation coordinates",
               "description": "Local x observation coordinates w.r.t. ``local_origin`` and ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global y axis. When ``proj_axis`` is 1, this corresponds to the global x axis. When ``proj_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 ``proj_axis``. When ``proj_axis`` is 0, this corresponds to the global z axis. When ``proj_axis`` is 1, this corresponds to the global z axis. When ``proj_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",
            "proj_axis",
            "x",
            "y"
         ],
         "additionalProperties": false
      },
      "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/um].  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/um",
               "type": "number"
            }
         },
         "additionalProperties": false
      },
      "PermittivityDataset": {
         "title": "PermittivityDataset",
         "description": "Dataset storing the diagonal components of the permittivity tensor.\n\nParameters\n----------\neps_xx : ScalarFieldDataArray\n    Spatial distribution of the xx-component of the relative permittivity.\neps_yy : ScalarFieldDataArray\n    Spatial distribution of the yy-component of the relative permittivity.\neps_zz : ScalarFieldDataArray\n    Spatial distribution of the zz-component of the relative permittivity.\n\nExample\n-------\n>>> x = [-1,1]\n>>> y = [-2,0,2]\n>>> z = [-3,-1,1,3]\n>>> f = [2e14, 3e14]\n>>> coords = dict(x=x, y=y, z=z, f=f)\n>>> sclr_fld = ScalarFieldDataArray((1+1j) * np.random.random((2,3,4,2)), coords=coords)\n>>> data = PermittivityDataset(eps_xx=sclr_fld, eps_yy=sclr_fld, eps_zz=sclr_fld)",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "default": "PermittivityDataset",
               "enum": [
                  "PermittivityDataset"
               ],
               "type": "string"
            },
            "eps_xx": {
               "title": "DataArray",
               "description": "Spatial distribution of the xx-component of the relative permittivity.",
               "type": "xr.DataArray",
               "properties": {
                  "_dims": {
                     "title": "_dims",
                     "type": "Tuple[str, ...]"
                  }
               },
               "required": [
                  "_dims"
               ]
            },
            "eps_yy": {
               "title": "DataArray",
               "description": "Spatial distribution of the yy-component of the relative permittivity.",
               "type": "xr.DataArray",
               "properties": {
                  "_dims": {
                     "title": "_dims",
                     "type": "Tuple[str, ...]"
                  }
               },
               "required": [
                  "_dims"
               ]
            },
            "eps_zz": {
               "title": "DataArray",
               "description": "Spatial distribution of the zz-component of the relative permittivity.",
               "type": "xr.DataArray",
               "properties": {
                  "_dims": {
                     "title": "_dims",
                     "type": "Tuple[str, ...]"
                  }
               },
               "required": [
                  "_dims"
               ]
            }
         },
         "required": [
            "eps_xx",
            "eps_yy",
            "eps_zz"
         ],
         "additionalProperties": false
      },
      "CustomMedium": {
         "title": "CustomMedium",
         "description": ":class:`.Medium` with user-supplied permittivity distribution.\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.\neps_dataset : PermittivityDataset\n    User-supplied dataset containing complex-valued permittivity as a function of space. Permittivity distribution over the Yee-grid will be interpolated based on ``interp_method``.\ninterp_method : Literal['nearest', 'linear'] = nearest\n    Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.\n\nExample\n-------\n>>> Nx, Ny, Nz = 10, 9, 8\n>>> X = np.linspace(-1, 1, Nx)\n>>> Y = np.linspace(-1, 1, Ny)\n>>> Z = np.linspace(-1, 1, Nz)\n>>> freqs = [2e14]\n>>> data = np.ones((Nx, Ny, Nz, 1))\n>>> eps_diagonal_data = ScalarFieldDataArray(data, coords=dict(x=X, y=Y, z=Z, f=freqs))\n>>> eps_components = {f\"eps_{d}{d}\": eps_diagonal_data for d in \"xyz\"}\n>>> eps_dataset = PermittivityDataset(**eps_components)\n>>> dielectric = CustomMedium(eps_dataset=eps_dataset, 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": "CustomMedium",
               "enum": [
                  "CustomMedium"
               ],
               "type": "string"
            },
            "eps_dataset": {
               "title": "Permittivity Dataset",
               "description": "User-supplied dataset containing complex-valued permittivity as a function of space. Permittivity distribution over the Yee-grid will be interpolated based on ``interp_method``.",
               "allOf": [
                  {
                     "$ref": "#/definitions/PermittivityDataset"
                  }
               ]
            },
            "interp_method": {
               "title": "Interpolation method",
               "description": "Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.",
               "default": "nearest",
               "enum": [
                  "nearest",
                  "linear"
               ],
               "type": "string"
            }
         },
         "required": [
            "eps_dataset"
         ],
         "additionalProperties": false
      },
      "ComplexNumber": {
         "title": "ComplexNumber",
         "description": "Complex number with a well defined schema.",
         "type": "object",
         "properties": {
            "real": {
               "title": "Real",
               "type": "number"
            },
            "imag": {
               "title": "Imag",
               "type": "number"
            }
         },
         "required": [
            "real",
            "imag"
         ]
      },
      "PoleResidue": {
         "title": "PoleResidue",
         "description": "A dispersive medium described by the pole-residue pair model.\nThe frequency-dependence of the complex-valued permittivity is described by:\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.\neps_inf : float = 1.0\n    [units = None (relative permittivity)].  Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\npoles : Tuple[Tuple[Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber], Union[tidy3d.components.types.tidycomplex, tidy3d.components.types.ComplexNumber]], ...] = ()\n    [units = (rad/sec, rad/sec)].  Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.\n\nNote\n----\n.. math::\n\n    \\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n    \\left[\\frac{c_i}{j \\omega + a_i} +\n    \\frac{c_i^*}{j \\omega + a_i^*}\\right]\n\nExample\n-------\n>>> pole_res = PoleResidue(eps_inf=2.0, poles=[((1+2j), (3+4j)), ((5+6j), (7+8j))])\n>>> eps = pole_res.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": "PoleResidue",
               "enum": [
                  "PoleResidue"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "poles": {
               "title": "Poles",
               "description": "Tuple of complex-valued (:math:`a_i, c_i`) poles for the model.",
               "default": [],
               "units": [
                  "rad/sec",
                  "rad/sec"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "anyOf": [
                           {
                              "title": "ComplexNumber",
                              "description": "Complex number with a well defined schema.",
                              "type": "object",
                              "properties": {
                                 "real": {
                                    "title": "Real",
                                    "type": "number"
                                 },
                                 "imag": {
                                    "title": "Imag",
                                    "type": "number"
                                 }
                              },
                              "required": [
                                 "real",
                                 "imag"
                              ]
                           },
                           {
                              "$ref": "#/definitions/ComplexNumber"
                           }
                        ]
                     },
                     {
                        "anyOf": [
                           {
                              "title": "ComplexNumber",
                              "description": "Complex number with a well defined schema.",
                              "type": "object",
                              "properties": {
                                 "real": {
                                    "title": "Real",
                                    "type": "number"
                                 },
                                 "imag": {
                                    "title": "Imag",
                                    "type": "number"
                                 }
                              },
                              "required": [
                                 "real",
                                 "imag"
                              ]
                           },
                           {
                              "$ref": "#/definitions/ComplexNumber"
                           }
                        ]
                     }
                  ]
               }
            }
         },
         "additionalProperties": false
      },
      "Sellmeier": {
         "title": "Sellmeier",
         "description": "A dispersive medium described by the Sellmeier model.\nThe frequency-dependence of the refractive index is described by:\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.\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n    [units = (None, um^2)].  List of Sellmeier (:math:`B_i, C_i`) coefficients.\n\nNote\n----\n.. math::\n\n    n(\\lambda)^2 = 1 + \\sum_i \\frac{B_i \\lambda^2}{\\lambda^2 - C_i}\n\nExample\n-------\n>>> sellmeier_medium = Sellmeier(coeffs=[(1,2), (3,4)])\n>>> eps = sellmeier_medium.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": "Sellmeier",
               "enum": [
                  "Sellmeier"
               ],
               "type": "string"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of Sellmeier (:math:`B_i, C_i`) coefficients.",
               "units": [
                  null,
                  "um^2"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "Lorentz": {
         "title": "Lorentz",
         "description": "A dispersive medium described by the Lorentz model.\nThe frequency-dependence of the complex-valued permittivity is described by:\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.\neps_inf : float = 1.0\n    [units = None (relative permittivity)].  Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, float, float], ...]\n    [units = (None (relative permittivity), Hz, Hz)].  List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n    \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n    \\frac{\\Delta\\epsilon_i f_i^2}{f_i^2 - 2jf\\delta_i - f^2}\n\nExample\n-------\n>>> lorentz_medium = Lorentz(eps_inf=2.0, coeffs=[(1,2,3), (4,5,6)])\n>>> eps = lorentz_medium.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": "Lorentz",
               "enum": [
                  "Lorentz"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of (:math:`\\Delta\\epsilon_i, f_i, \\delta_i`) values for model.",
               "units": [
                  "None (relative permittivity)",
                  "Hz",
                  "Hz"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 3,
                  "maxItems": 3,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number"
                     },
                     {
                        "type": "number"
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "Debye": {
         "title": "Debye",
         "description": "A dispersive medium described by the Debye model.\nThe frequency-dependence of the complex-valued permittivity is described by:\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.\neps_inf : float = 1.0\n    [units = None (relative permittivity)].  Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n    [units = (None (relative permittivity), sec)].  List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.\n\nNote\n----\n.. math::\n\n    \\epsilon(f) = \\epsilon_\\infty + \\sum_i\n    \\frac{\\Delta\\epsilon_i}{1 - jf\\tau_i}\n\nExample\n-------\n>>> debye_medium = Debye(eps_inf=2.0, coeffs=[(1,2),(3,4)])\n>>> eps = debye_medium.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": "Debye",
               "enum": [
                  "Debye"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of (:math:`\\Delta\\epsilon_i, \\tau_i`) values for model.",
               "units": [
                  "None (relative permittivity)",
                  "sec"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "Drude": {
         "title": "Drude",
         "description": "A dispersive medium described by the Drude model.\nThe frequency-dependence of the complex-valued permittivity is described by:\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.\neps_inf : float = 1.0\n    [units = None (relative permittivity)].  Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).\ncoeffs : Tuple[Tuple[float, pydantic.types.PositiveFloat], ...]\n    [units = (Hz, Hz)].  List of (:math:`f_i, \\delta_i`) values for model.\n\nNote\n----\n.. math::\n\n    \\epsilon(f) = \\epsilon_\\infty - \\sum_i\n    \\frac{ f_i^2}{f^2 + jf\\delta_i}\n\nExample\n-------\n>>> drude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\n>>> eps = drude_medium.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": "Drude",
               "enum": [
                  "Drude"
               ],
               "type": "string"
            },
            "eps_inf": {
               "title": "Epsilon at Infinity",
               "description": "Relative permittivity at infinite frequency (:math:`\\epsilon_\\infty`).",
               "default": 1.0,
               "units": "None (relative permittivity)",
               "type": "number"
            },
            "coeffs": {
               "title": "Coefficients",
               "description": "List of (:math:`f_i, \\delta_i`) values for model.",
               "units": [
                  "Hz",
                  "Hz"
               ],
               "type": "array",
               "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": [
                     {
                        "type": "number"
                     },
                     {
                        "type": "number",
                        "exclusiveMinimum": 0
                     }
                  ]
               }
            }
         },
         "required": [
            "coeffs"
         ],
         "additionalProperties": false
      },
      "AnisotropicMedium": {
         "title": "AnisotropicMedium",
         "description": "Diagonally anisotropic 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.\nxx : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n    Medium describing the xx-component of the diagonal permittivity tensor.\nyy : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n    Medium describing the yy-component of the diagonal permittivity tensor.\nzz : Union[Medium, PoleResidue, Sellmeier, Lorentz, Debye, Drude]\n    Medium describing the zz-component of the diagonal permittivity tensor.\n\nNote\n----\nOnly diagonal anisotropy is currently supported.\n\nExample\n-------\n>>> medium_xx = Medium(permittivity=4.0)\n>>> medium_yy = Medium(permittivity=4.1)\n>>> medium_zz = Medium(permittivity=3.9)\n>>> anisotropic_dielectric = AnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)",
         "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": "AnisotropicMedium",
               "enum": [
                  "AnisotropicMedium"
               ],
               "type": "string"
            },
            "xx": {
               "title": "XX Component",
               "description": "Medium describing the xx-component of the diagonal permittivity tensor.",
               "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                     "Medium": "#/definitions/Medium",
                     "PoleResidue": "#/definitions/PoleResidue",
                     "Sellmeier": "#/definitions/Sellmeier",
                     "Lorentz": "#/definitions/Lorentz",
                     "Debye": "#/definitions/Debye",
                     "Drude": "#/definitions/Drude"
                  }
               },
               "oneOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  },
                  {
                     "$ref": "#/definitions/PoleResidue"
                  },
                  {
                     "$ref": "#/definitions/Sellmeier"
                  },
                  {
                     "$ref": "#/definitions/Lorentz"
                  },
                  {
                     "$ref": "#/definitions/Debye"
                  },
                  {
                     "$ref": "#/definitions/Drude"
                  }
               ]
            },
            "yy": {
               "title": "YY Component",
               "description": "Medium describing the yy-component of the diagonal permittivity tensor.",
               "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                     "Medium": "#/definitions/Medium",
                     "PoleResidue": "#/definitions/PoleResidue",
                     "Sellmeier": "#/definitions/Sellmeier",
                     "Lorentz": "#/definitions/Lorentz",
                     "Debye": "#/definitions/Debye",
                     "Drude": "#/definitions/Drude"
                  }
               },
               "oneOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  },
                  {
                     "$ref": "#/definitions/PoleResidue"
                  },
                  {
                     "$ref": "#/definitions/Sellmeier"
                  },
                  {
                     "$ref": "#/definitions/Lorentz"
                  },
                  {
                     "$ref": "#/definitions/Debye"
                  },
                  {
                     "$ref": "#/definitions/Drude"
                  }
               ]
            },
            "zz": {
               "title": "ZZ Component",
               "description": "Medium describing the zz-component of the diagonal permittivity tensor.",
               "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                     "Medium": "#/definitions/Medium",
                     "PoleResidue": "#/definitions/PoleResidue",
                     "Sellmeier": "#/definitions/Sellmeier",
                     "Lorentz": "#/definitions/Lorentz",
                     "Debye": "#/definitions/Debye",
                     "Drude": "#/definitions/Drude"
                  }
               },
               "oneOf": [
                  {
                     "$ref": "#/definitions/Medium"
                  },
                  {
                     "$ref": "#/definitions/PoleResidue"
                  },
                  {
                     "$ref": "#/definitions/Sellmeier"
                  },
                  {
                     "$ref": "#/definitions/Lorentz"
                  },
                  {
                     "$ref": "#/definitions/Debye"
                  },
                  {
                     "$ref": "#/definitions/Drude"
                  }
               ]
            }
         },
         "required": [
            "xx",
            "yy",
            "zz"
         ],
         "additionalProperties": false
      },
      "PECMedium": {
         "title": "PECMedium",
         "description": "Perfect electrical conductor class.\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.\n\nNote\n----\nTo avoid confusion from duplicate PECs, should import ``tidy3d.PEC`` instance directly.",
         "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": "PECMedium",
               "enum": [
                  "PECMedium"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      },
      "FieldMonitor": {
         "title": "FieldMonitor",
         "description": ":class:`Monitor` that records electromagnetic fields in the frequency domain.\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.\napodization : ApodizationSpec = ApodizationSpec(start=None, end=None, width=None, type='ApodizationSpec')\n    Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n    Collection of field components to store in the monitor.\ninterval_space : Tuple[PositiveInt, PositiveInt, PositiveInt] = (1, 1, 1)\n    Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.\ncolocate : Optional[bool] = None\n    Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.\n\nExample\n-------\n>>> monitor = FieldMonitor(\n...     center=(1,2,3),\n...     size=(2,2,2),\n...     fields=['Hx'],\n...     freqs=[250e12, 300e12],\n...     name='steady_state_monitor')",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "default": "FieldMonitor",
               "enum": [
                  "FieldMonitor"
               ],
               "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": []
                  }
               ]
            },
            "apodization": {
               "title": "Apodization Specification",
               "description": "Sets parameters of (optional) apodization. Apodization applies a windowing function to the Fourier transform of the time-domain fields into frequency-domain ones, and can be used to truncate the beginning and/or end of the time signal, for example to eliminate the source pulse when studying the eigenmodes of a system. Note: apodization affects the normalization of the frequency-domain fields.",
               "default": {
                  "start": null,
                  "end": null,
                  "width": null,
                  "type": "ApodizationSpec"
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/ApodizationSpec"
                  }
               ]
            },
            "fields": {
               "title": "Field Components",
               "description": "Collection of field components to store in the monitor.",
               "default": [
                  "Ex",
                  "Ey",
                  "Ez",
                  "Hx",
                  "Hy",
                  "Hz"
               ],
               "type": "array",
               "items": {
                  "enum": [
                     "Ex",
                     "Ey",
                     "Ez",
                     "Hx",
                     "Hy",
                     "Hz"
                  ],
                  "type": "string"
               }
            },
            "interval_space": {
               "title": "Spatial interval",
               "description": "Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, fields will be downsampled and automatically colocated.",
               "default": [
                  1,
                  1,
                  1
               ],
               "type": "array",
               "minItems": 3,
               "maxItems": 3,
               "items": [
                  {
                     "type": "integer",
                     "exclusiveMinimum": 0
                  },
                  {
                     "type": "integer",
                     "exclusiveMinimum": 0
                  },
                  {
                     "type": "integer",
                     "exclusiveMinimum": 0
                  }
               ]
            },
            "colocate": {
               "title": "Colocate fields",
               "description": "Toggle whether fields should be colocated to grid cell centers. Default: ``False`` if ``interval_space`` is 1 in each direction, ``True`` if ``interval_space`` is greater than one in any direction.",
               "type": "boolean"
            }
         },
         "required": [
            "size",
            "name",
            "freqs"
         ],
         "additionalProperties": false
      },
      "FieldProjectionSurface": {
         "title": "FieldProjectionSurface",
         "description": "Data structure to store surface monitors where near fields are recorded for\nfield projections.\n\nParameters\n----------\nmonitor : FieldMonitor\n    :class:`.FieldMonitor` on which near fields will be sampled and integrated.\nnormal_dir : Literal['+', '-']\n    :class:`.Direction` of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of '+' or '-'.",
         "type": "object",
         "properties": {
            "monitor": {
               "title": "Field monitor",
               "description": ":class:`.FieldMonitor` on which near fields will be sampled and integrated.",
               "allOf": [
                  {
                     "$ref": "#/definitions/FieldMonitor"
                  }
               ]
            },
            "normal_dir": {
               "title": "Normal vector orientation",
               "description": ":class:`.Direction` of the surface monitor's normal vector w.r.t. the positive x, y or z unit vectors. Must be one of '+' or '-'.",
               "enum": [
                  "+",
                  "-"
               ],
               "type": "string"
            },
            "type": {
               "title": "Type",
               "default": "FieldProjectionSurface",
               "enum": [
                  "FieldProjectionSurface"
               ],
               "type": "string"
            }
         },
         "required": [
            "monitor",
            "normal_dir"
         ],
         "additionalProperties": false
      }
   }
}

attribute Ephi: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of phi-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute Er: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of r-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute Etheta: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of the theta-component of the electric field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute Hphi: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of phi-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute Hr: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of r-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute Htheta: tidy3d.components.data.data_array.FieldProjectionCartesianDataArray [Required]#

Spatial distribution of theta-component of the magnetic field.

Constraints
  • title = DataArray

  • type = xr.DataArray

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

  • required = [‘_dims’]

attribute medium: Union[tidy3d.components.medium.Medium, tidy3d.components.medium.CustomMedium, tidy3d.components.medium.AnisotropicMedium, tidy3d.components.medium.PECMedium, tidy3d.components.medium.PoleResidue, tidy3d.components.medium.Sellmeier, tidy3d.components.medium.Lorentz, tidy3d.components.medium.Debye, tidy3d.components.medium.Drude] = Medium(name=None, frequency_range=None, type='Medium', permittivity=1.0, conductivity=0.0)#

Background medium through which to project fields.

attribute monitor: tidy3d.components.monitor.FieldProjectionCartesianMonitor [Required]#

Field projection monitor with a Cartesian projection grid.

attribute projection_surfaces: Tuple[tidy3d.components.monitor.FieldProjectionSurface, ...] [Required]#

Surfaces of the monitor where near fields were recorded for projection

classmethod add_type_field() None#

Automatically place “type” field with model name in the model field dictionary.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(**kwargs) tidy3d.components.base.Tidy3dBaseModel#

Copy a Tidy3dBaseModel. With deep=True as default.

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod dict_from_file(fname: str, group_path: Optional[str] = None) dict#

Loads a dictionary containing the model from a .yaml, .json, or .hdf5 file.

Parameters
  • fname (str) – Full path to the .yaml or .json file to load the Tidy3dBaseModel from.

  • group_path (str, optional) – Path to a group inside the file to use as the base level.

Returns

A dictionary containing the model.

Return type

dict

Example

>>> simulation = Simulation.from_file(fname='folder/sim.json') 
classmethod dict_from_hdf5(fname: str, group_path: str = '') dict#

Loads a dictionary containing the model contents from a .hdf5 file.

Parameters
  • fname (str) – Full path to the .hdf5 file to load the Tidy3dBaseModel from.

  • group_path (str, optional) – Path to a group inside the file to selectively load a sub-element of the model only.

Returns

Dictionary containing the model.

Return type

dict

Example

>>> sim_dict = Simulation.dict_from_hdf5(fname='folder/sim.hdf5') 
classmethod dict_from_json(fname: str) dict#

Load dictionary of the model from a .json file.

Parameters

fname (str) – Full path to the .json file to load the Tidy3dBaseModel from.

Returns

A dictionary containing the model.

Return type

dict

Example

>>> sim_dict = Simulation.dict_from_json(fname='folder/sim.json') 
classmethod dict_from_yaml(fname: str) dict#

Load dictionary of the model from a .yaml file.

Parameters

fname (str) – Full path to the .yaml file to load the Tidy3dBaseModel from.

Returns

A dictionary containing the model.

Return type

dict

Example

>>> sim_dict = Simulation.dict_from_yaml(fname='folder/sim.yaml') 
classmethod from_file(fname: str, group_path: Optional[str] = None, **parse_obj_kwargs) tidy3d.components.base.Tidy3dBaseModel#

Loads a Tidy3dBaseModel from .yaml, .json, or .hdf5 file.

Parameters
  • fname (str) – Full path to the .yaml or .json file to load the Tidy3dBaseModel from.

  • group_path (str, optional) – Path to a group inside the file to use as the base level. Only for .hdf5 files. Starting / is optional.

  • **parse_obj_kwargs – Keyword arguments passed to either pydantic’s parse_obj function when loading model.

Returns

An instance of the component class calling load.

Return type

Tidy3dBaseModel

Example

>>> simulation = Simulation.from_file(fname='folder/sim.json') 
classmethod from_hdf5(fname: str, group_path: str = '', **parse_obj_kwargs) tidy3d.components.base.Tidy3dBaseModel#

Loads Tidy3dBaseModel instance to .hdf5 file.

Parameters
  • fname (str) – Full path to the .hdf5 file to load the Tidy3dBaseModel from.

  • group_path (str, optional) – Path to a group inside the file to selectively load a sub-element of the model only. Starting / is optional.

  • **parse_obj_kwargs – Keyword arguments passed to pydantic’s parse_obj method.

Example

>>> simulation.to_hdf5(fname='folder/sim.hdf5') 
classmethod from_json(fname: str, **parse_obj_kwargs) tidy3d.components.base.Tidy3dBaseModel#

Load a Tidy3dBaseModel from .json file.

Parameters

fname (str) – Full path to the .json file to load the Tidy3dBaseModel from.

Returns

  • Tidy3dBaseModel – An instance of the component class calling load.

  • **parse_obj_kwargs – Keyword arguments passed to pydantic’s parse_obj method.

Example

>>> simulation = Simulation.from_json(fname='folder/sim.json') 
classmethod from_orm(obj: Any) Model#
classmethod from_yaml(fname: str, **parse_obj_kwargs) tidy3d.components.base.Tidy3dBaseModel#

Loads Tidy3dBaseModel from .yaml file.

Parameters
  • fname (str) – Full path to the .yaml file to load the Tidy3dBaseModel from.

  • **parse_obj_kwargs – Keyword arguments passed to pydantic’s parse_obj method.

Returns

An instance of the component class calling from_yaml.

Return type

Tidy3dBaseModel

Example

>>> simulation = Simulation.from_yaml(fname='folder/sim.yaml') 
classmethod generate_docstring() str#

Generates a docstring for a Tidy3D mode and saves it to the __doc__ of the class.

classmethod get_sub_model(group_path: str, model_dict: dict | list) dict#

Get the sub model for a given group path.

static get_tuple_group_name(index: int) str#

Get the group name of a tuple element.

static get_tuple_index(key_name: str) int#

Get the index into the tuple based on its group name.

help(methods: bool = False) None#

Prints message describing the fields and methods of a Tidy3dBaseModel.

Parameters

methods (bool = False) – Whether to also print out information about object’s methods.

Example

>>> simulation.help(methods=True) 
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

make_data_array(data: numpy.ndarray) xarray.core.dataarray.DataArray#

Make an xr.DataArray with data and same coords and dims as fields of self.

make_dataset(keys: Tuple[str, ...], vals: Tuple[numpy.ndarray, ...]) xarray.core.dataset.Dataset#

Make an xr.Dataset with keys and data with same coords and dims as fields.

make_renormalized_data(phase: numpy.ndarray, proj_distance: float) tidy3d.components.data.monitor_data.AbstractFieldProjectionData#

Helper to apply the re-projection phase to a copied dataset.

normalize(source_spectrum_fn: Callable[[float], complex]) tidy3d.components.data.monitor_data.AbstractFieldProjectionData#

Return copy of self after normalization is applied using source spectrum function.

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
static propagation_phase(dist: Optional[float], k: complex) complex#

Phase associated with propagation of a distance with a given wavenumber.

renormalize_fields(proj_distance: float) tidy3d.components.data.monitor_data.FieldProjectionCartesianData#

Return a FieldProjectionCartesianData with fields re-normalized to a new projection distance, by applying a phase factor based on proj_distance.

Parameters

proj_distance (float = None) – (micron) new plane distance relative to the monitor’s local origin.

Returns

Copy of this FieldProjectionCartesianData with fields re-projected to proj_distance.

Return type

FieldProjectionCartesianData

classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_file(fname: str) None#

Exports Tidy3dBaseModel instance to .yaml, .json, or .hdf5 file

Parameters

fname (str) – Full path to the .yaml or .json file to save the Tidy3dBaseModel to.

Example

>>> simulation.to_file(fname='folder/sim.json') 
to_hdf5(fname: str) None#

Exports Tidy3dBaseModel instance to .hdf5 file.

Parameters

fname (str) – Full path to the .hdf5 file to save the Tidy3dBaseModel to.

Example

>>> simulation.to_hdf5(fname='folder/sim.hdf5') 
to_json(fname: str) None#

Exports Tidy3dBaseModel instance to .json file

Parameters

fname (str) – Full path to the .json file to save the Tidy3dBaseModel to.

Example

>>> simulation.to_json(fname='folder/sim.json') 
to_yaml(fname: str) None#

Exports Tidy3dBaseModel instance to .yaml file.

Parameters

fname (str) – Full path to the .yaml file to save the Tidy3dBaseModel to.

Example

>>> simulation.to_yaml(fname='folder/sim.yaml') 
classmethod tuple_to_dict(tuple_values: tuple) dict#

How we generate a dictionary mapping new keys to tuple values for hdf5.

classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

updated_copy(**kwargs) tidy3d.components.base.Tidy3dBaseModel#

Make copy of a component instance with **kwargs indicating updated field values.

classmethod validate(value: Any) Model#
static wavenumber(medium: Union[tidy3d.components.medium.Medium, tidy3d.components.medium.CustomMedium, tidy3d.components.medium.AnisotropicMedium, tidy3d.components.medium.PECMedium, tidy3d.components.medium.PoleResidue, tidy3d.components.medium.Sellmeier, tidy3d.components.medium.Lorentz, tidy3d.components.medium.Debye, tidy3d.components.medium.Drude], frequency: float) complex#

Complex valued wavenumber associated with a frequency.

property coords: Dict[str, numpy.ndarray]#

Coordinates of the fields contained.

property coords_spherical: Dict[str, numpy.ndarray]#

Coordinates grid for the fields in the spherical system.

property dims: Tuple[str, ...]#

Dimensions of the radiation vectors contained.

property eta: complex#

Returns the complex wave impedance associated with the background medium.

property f: numpy.ndarray#

Frequencies.

property field_components: Dict[str, tidy3d.components.data.data_array.DataArray]#

Maps the field components to their associated data.

property fields_cartesian: xarray.core.dataset.Dataset#

Get all field components in Cartesian coordinates relative to the monitor’s local origin for all projection grid points and frequencies specified in the AbstractFieldProjectionMonitor.

Returns

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

Return type

xarray.Dataset

property fields_spherical: xarray.core.dataset.Dataset#

Get all field components in spherical coordinates relative to the monitor’s local origin for all projection grid points and frequencies specified in the AbstractFieldProjectionMonitor.

Returns

xarray dataset containing (Er, Etheta, Ephi, Hr, Htheta, Hphi) in spherical coordinates.

Return type

xarray.Dataset

property k: complex#

Returns the complex wave number associated with the background medium.

property nk: Tuple[float, float]#

Returns the real and imaginary parts of the background medium’s refractive index.

property power: xarray.core.dataarray.DataArray#

Get power measured on the projection grid relative to the monitor’s local origin.

Returns

Power at points relative to the local origin.

Return type

xarray.DataArray

property radar_cross_section: xarray.core.dataarray.DataArray#

Radar cross section in units of incident power.

property symmetry_expanded_copy: tidy3d.components.data.monitor_data.MonitorData#

Return copy of self with symmetry applied.

property x: numpy.ndarray#

X positions.

property y: numpy.ndarray#

Y positions.

property z: numpy.ndarray#

Z positions.