Skip to content

flex_rf.tidy3d.Coords

Type: class Base(s): Tidy3dBaseModel

Holds data about a set of x,y,z positions on a grid.

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)
x [Coords1D]

1-dimensional array of x coordinates.

y [Coords1D]

1-dimensional array of y coordinates.

z [Coords1D]

1-dimensional array of z coordinates.

to_dict [dict[str, Any]]

Return a dict of the three Coord1D objects as numpy arrays.

to_list [list[NDArray]]

Return a list of the three Coord1D objects as numpy arrays.

cell_size_meshgrid()

Returns an N-dimensional grid where N is the number of coordinate arrays that have more than one element. Each grid element corresponds to the size of the mesh cell in N-dimensions and 1 for N=0.

cell_sizes()

Returns the sizes of the cells in each coordinate array as a dictionary.

get_bounding_indices(coordinate: Coordinate, side: Literal['left', 'right'], buffer: int = 0)

Find the bounding indices up to a buffer corresponding to the supplied coordinate. For x, y, z values supplied in coordinate, look for index into the x, y, and z coordinate arrays such that the value at that index bounds the supplied coordinate entry on either the ‘right’ or ‘left’ side specified by the side parameter. An optional buffer of number of indices can be specified with the default 0. All indices are bound by 0 and the length of each coordinate array so that they can be directly used to index into the coordinate arrays without going out of bounds.

get_bounding_values(coordinate: Coordinate, side: Literal['left', 'right'], buffer: int = 0)

Find the bounding values corresponding to the supplied coordinate. The bounding values extract the values out of the coordinate arrays for the indices found in get_bounding_indices.

spatial_interp(array: SpatialDataArray | ScalarFieldDataArray | UnstructuredGridDatasetType, interp_method: InterpMethod, fill_value: Literal['extrapolate'] | float = 'extrapolate')

Similar to xarrray.DataArray.interp with 2 enhancements: