tidy3d.CustomFieldSource#
- class CustomFieldSource[source]#
Bases:
FieldSource,PlanarSourceImplements a source corresponding to an input dataset containing
EandHfields, using the equivalence principle to define the actual injected currents.- Parameters:
name (Attribute:
name) –TypeOptional[str]
Default= None
DescriptionOptional name for the source.
center (Attribute:
center) –TypeTuple[float, float, float]
Default= (0.0, 0.0, 0.0)
Unitsum
DescriptionCenter of object in x, y, and z.
size (Attribute:
size) –TypeTuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]
DefaultUnitsum
DescriptionSize in x, y, and z directions.
source_time (Attribute:
source_time) –TypeUnion[GaussianPulse, ContinuousWave, CustomSourceTime]
DefaultDescriptionSpecification of the source time-dependence.
field_dataset –
TypeOptional[FieldDataset]
DefaultDescriptionFieldDatasetcontaining the desired frequency-domain fields patterns to inject. At least one tangential field component must be specified.
Example
>>> from tidy3d import ScalarFieldDataArray >>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12) >>> x = np.linspace(-1, 1, 101) >>> y = np.linspace(-1, 1, 101) >>> z = np.array([0]) >>> f = [2e14] >>> coords = dict(x=x, y=y, z=z, f=f) >>> scalar_field = ScalarFieldDataArray(np.ones((101, 101, 1, 1)), coords=coords) >>> dataset = FieldDataset(Ex=scalar_field) >>> custom_source = CustomFieldSource( ... center=(1, 1, 1), ... size=(2, 2, 0), ... source_time=pulse, ... field_dataset=dataset)
See also
- Notebooks
Attributes
Methods
- field_dataset#
- __hash__()#
Hash method.