tidy3d.FieldGrid#
- class FieldGrid[source]#
Bases:
Tidy3dBaseModel
Holds the grid data for a single field.
- Parameters:
attrs (dict = {}) β Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.x (Coords) β x,y,z coordinates of the locations of the x-component of a vector field.
y (Coords) β x,y,z coordinates of the locations of the y-component of a vector field.
z (Coords) β x,y,z coordinates of the locations of the z-component of a vector field.
Example
>>> x = np.linspace(-1, 1, 10) >>> y = np.linspace(-1, 1, 11) >>> z = np.linspace(-1, 1, 12) >>> coords = Coords(x=x, y=y, z=z) >>> field_grid = FieldGrid(x=coords, y=coords, z=coords)
Attributes
Methods
Inherited Common Usage
- x#
- y#
- z#
- __hash__()#
Hash method.