tidy3d.components.data.dataset.FieldDataset#
- class FieldDataset[source]#
Bases:
ElectromagneticFieldDatasetDataset storing a collection of the scalar components of E and H fields in the freq. domain
- 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,
attrsare mutable. For example, the following is allowed for setting anattrobj.attrs['foo'] = bar. Also note that Tidy3D` will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare serializable by callingobj.json().Ex (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the x-component of the electric field.
Ey (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the y-component of the electric field.
Ez (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the z-component of the electric field.
Hx (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the x-component of the magnetic field.
Hy (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the y-component of the magnetic field.
Hz (Optional[ScalarFieldDataArray] = None) β Spatial distribution of the z-component of the magnetic field.
Example
>>> x = [-1,1] >>> y = [-2,0,2] >>> z = [-3,-1,1,3] >>> f = [2e14, 3e14] >>> coords = dict(x=x, y=y, z=z, f=f) >>> scalar_field = ScalarFieldDataArray((1+1j) * np.random.random((2,3,4,2)), coords=coords) >>> data = FieldDataset(Ex=scalar_field, Hz=scalar_field)
Attributes
Methods
from_zbf(dim1,Β dim2)Creates a
FieldDatasetfrom a Zemax Beam File (.zbf).Inherited Common Usage
- Ex#
- Ey#
- Ez#
- Hx#
- Hy#
- Hz#
- from_zbf(dim1, dim2)[source]#
Creates a
FieldDatasetfrom a Zemax Beam File (.zbf).- Parameters:
filename (str) β The file name of the .zbf file to read.
dim1 (xyz) β Tangential field component to map the x-dimension of the zbf data to. eg.
dim1 = "z"setsFieldDataset.EztoExof the zbf data.dim2 (xyz) β Tangential field component to map the y-dimension of the zbf data to. eg.
dim2 = "z"setsFieldDataset.EztoEyof the zbf data.
- Returns:
A
FieldDatasetobject with two tangential E field components populated by zbf data.- Return type:
See also
ZBFDataA class containing data read in from a
.zbffile.
- __hash__()#
Hash method.