tidy3d.components.data.dataset.AbstractFieldDataset#
- class AbstractFieldDataset[source]#
Bases:
Dataset,ABCCollection of scalar fields with some symmetry properties.
Attributes
Maps the field components to their associated data.
Maps field components to the string key of their grid locations on the yee lattice.
Per-axis bounds where solver field data is physically valid.
Maps field components to their (positive) symmetry eigenvalues.
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().
- abstract property field_components#
Maps the field components to their associated data.
- property solver_field_bounds#
Per-axis bounds where solver field data is physically valid.
Returns
Noneby default. Subclasses that produce zero-padded output grids (e.g. mode-solver data) override this to return actual bounds so that colocation clips to the valid region.
- 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.