tidy3d.CustomDoping

tidy3d.CustomDoping#

class CustomDoping[source]#

Bases: AbstractDopingBox

Sets a custom doping profile in the specified box.

Parameters:
  • center (tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.

  • size (tuple[Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box]] = (inf, inf, inf)) – [units = um]. Size in x, y, and z directions.

  • concentration (SpatialDataArray) – [units = 1/cm^3]. Doping concentration data array.

:param CustomDoping wraps a SpatialDataArray as an additive doping box so: :param arbitrary spatial doping profiles can be summed with other doping boxes in N_a and: :param N_d.:

Example

>>> import tidy3d as td
>>> import numpy as np
>>> box_coords = [
...     [-1, -1, -1],
...     [1, 1, 1]
... ]
>>> x = np.linspace(-1, 1, 5)
>>> y = np.linspace(-1, 1, 5)
>>> z = np.linspace(-1, 1, 5)
>>> data = np.random.rand(5, 5, 5)*1e18
>>> concentration = td.SpatialDataArray(
...     data=data,
...     coords={'x': x, 'y': y, 'z': z},
... )
>>> custom_box1 = td.CustomDoping(
...     center=(0, 0, 0),
...     size=(2, 2, 2),
...     concentration=concentration
... )
>>> custom_box2 = td.CustomDoping.from_bounds(
...     rmin=box_coords[0],
...     rmax=box_coords[1],
...     concentration=concentration
... )

Attributes

concentration

size

center

concentration#