tidy3d.components.data.dataset.AbstractFieldDataset#

class AbstractFieldDataset[source]#

Bases: Dataset, ABC

Collection of scalar fields with some symmetry properties.

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 an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

Attributes

field_components

Maps the field components to their associated data.

grid_locations

Maps field components to the string key of their grid locations on the yee lattice.

symmetry_eigenvalues

Maps field components to their (positive) symmetry eigenvalues.

attrs

Methods

apply_phase(phase)

Create a copy where all elements are phase-shifted by a value (in radians).

colocate([x, y, z])

Colocate all of the data at a set of x, y, z coordinates.

package_colocate_results(centered_fields)

How to package the dictionary of fields computed via self.colocate().

Inherited Common Usage

abstract property field_components#

Maps the field components to their associated data.

apply_phase(phase)[source]#

Create a copy where all elements are phase-shifted by a value (in radians).

abstract property grid_locations#

Maps field components to the string key of their grid locations on the yee lattice.

abstract property symmetry_eigenvalues#

Maps field components to their (positive) symmetry eigenvalues.

package_colocate_results(centered_fields)[source]#

How to package the dictionary of fields computed via self.colocate().

colocate(x=None, y=None, z=None)[source]#

Colocate all of the data at a set of x, y, z coordinates.

Parameters:
  • x (Optional[array-like] = None) – x coordinates of locations. If not supplied, does not try to colocate on this dimension.

  • y (Optional[array-like] = None) – y coordinates of locations. If not supplied, does not try to colocate on this dimension.

  • z (Optional[array-like] = None) – z coordinates of locations. If not supplied, does not try to colocate on this dimension.

Returns:

Dataset containing all fields at the same spatial locations. For more details refer to xarray’s Documentation.

Return type:

xr.Dataset

Note

For many operations (such as flux calculations and plotting), it is important that the fields are colocated at the same spatial locations. Be sure to apply this method to your field data in those cases.

__hash__()#

Hash method.