Required
wo| Type: | WavefieldOutput |
| Description: | The wavefield output object. |
def wavefield_output_enclosing_elements(
wo: WavefieldOutput,
points: tuple[npt.NDArray] | npt.NDArray | typing.Sequence[npt.ArrayLike],
) -> tuple[np.ndarray, np.ndarray]: ...| Type: | WavefieldOutput |
| Description: | The wavefield output object. |
| Type: | tuple[npt.NDArray] | npt.NDArray | typing.Sequence[npt.ArrayLike] |
| Description: | Either a list of numpy arrays, indicating a structured grid, or one array of shape (n_pnt, n_dim), indicating an unstructured collection of points. |
tuple[np.ndarray, np.ndarray]def wavefield_output_to_xarray(
wo: WavefieldOutput,
points: tuple[npt.NDArray] | npt.NDArray | typing.Sequence[npt.ArrayLike],
enclosing_elements: tuple[np.ndarray, np.ndarray] | tuple[()] = (),
mode: str = "batch",
verbose: bool = True,
) -> xr.DataArray: ...| Type: | WavefieldOutput |
| Description: | The wavefield output object; generally initialized directly from a SalvusCompute HDF5 volumetric output file. |
| Type: | tuple[npt.NDArray] | npt.NDArray | typing.Sequence[npt.ArrayLike] |
| Description: | A list of spatial points to interpolate onto. If a list of arrays is passed, it will be assumed that these arrays describe a structured grid in len(points) dimensions. If a single numpy array is passed, it will be assumed that these points represent an unstructured collection of points. |
| Type: | tuple[np.ndarray, np.ndarray] | tuple[()] |
| Default value: | () |
| Description: | A tuple of the enclosing element indices and interpolation coefficients can be passed in order to skip the potentially expensive enclosing element search if such values already exist. If an empty tuple is passed, the requisite quantities will be computed within this function. |
| Type: | str |
| Default value: | 'batch' |
| Description: | Either "sequential" or "batch". If "sequential", perform a tensor contraction only along the time axis, and operate element by element. If "batch", perform a tensor contraction along all axes to perform the interpolation. Batch is generally an optimal approach when the number of points is approximately equal or less to the number of elements; otherwise it may result in unacceptable memory usage. Defaults to "sequential". |
| Type: | bool |
| Default value: | True |
| Description: | Whether to print a progress bar for the enclosing element search and interpolation step. |
xr.DataArraydef xarray_to_vtk_image_data(
filename_prefix: pathlib.Path | str,
da: xr.DataArray,
filename_indexing: tuple[int, str] | None = None,
) -> None: ...| Type: | pathlib.Path | str |
| Description: | A full path, including a filename prefix, describing where the VTK files should be written. |
| Type: | xr.DataArray |
| Description: | The DataArray to write. Must have dimensions ("x", "y", and "t") (2-D) or ("x", "y", "z", "t") (3-D). |
| Type: | tuple[int, str] | None |
| Default value: | None |
| Description: | A tuple of (offset, format) to use when computing the filenames. If not provided, filenames will start at 0 and sequential names will be front-padded with an appropriate number of zeros so as all time step outputs will be lexicographically ordered. |
def xarray_to_vtk_rectilinear_grid(
filename_prefix: pathlib.Path | str,
da: xr.DataArray,
filename_indexing: tuple[int, str] | None = None,
) -> None: ...| Type: | pathlib.Path | str |
| Description: | A full path, including a filename prefix, describing where the VTK files should be written. |
| Type: | xr.DataArray |
| Description: | The DataArray to write. Must have dimensions ("x", "y", and "t") (2-D) or ("x", "y", "z", "t") (3-D). |
| Type: | tuple[int, str] | None |
| Default value: | None |
| Description: | A tuple of (offset, format) to use when computing the filenames. If not provided, filenames will start at 0 and sequential names will be front-padded with an appropriate number of zeros so as all time step outputs will be lexicographically ordered. |
class WavefieldOutput(builtins.object):
def __init__(
self,
conn: np.ndarray,
crds: np.ndarray,
data: np.ndarray,
start_time: float,
sampling_rate: float,
) -> None: ...| Type: | np.ndarray |
| Description: | The connectivity array. |
| Type: | np.ndarray |
| Description: | The coordinate array. |
| Type: | np.ndarray |
| Description: | The wavefield output data. |
| Type: | float |
| Description: | The start time of the encapsulated data (in seconds). |
| Type: | float |
| Description: | The sampling rate of the encapsulated data (in hertz). |
int)-Get the number of points per element (without padding).int)-Get the number of sub elements (for visualization).float)-Get the number of time steps stored.int)-Get the dimension of the stored wavefield.int)-Get the number of elements.float)-Get the sampling interval of the stored wavefield.int)-Get the polynomial order of the stored wavefield.def from_file(
filename: pathlib.Path | str,
field: str,
output_type: str,
time_steps: slice = slice(None, None, None),
) -> WavefieldOutput: ...| Type: | pathlib.Path | str |
| Description: | The output file to read from. |
| Type: | str |
| Description: | The field to read. |
| Type: | str |
| Description: | The output type of the field (surface or volume). |
| Type: | slice |
| Default value: | slice(None, None, None) |
| Description: | The time steps indices to read expressed as a python slice object. |
def drop_dimension(self, dim: int) -> WavefieldOutput: ...| Type: | int |
| Description: | The dimension to drop. Must be an integer in the range(0, n_dim). |
def get_element_centroid(self) -> np.ndarray: ...def get_element_nodes(self) -> np.ndarray: ...def sizes(
filename: pathlib.Path | str, field: str, output_type: str
) -> tuple[int, ...]: ...| Type: | pathlib.Path | str |
| Description: | The path to the HDF5 file. |
| Type: | str |
| Description: | The field to query. |
| Type: | str |
| Description: | The output type (volume or surface). |