seisflows.tools.array

Tools useful for array manipulation in Seisflows

Functions

sortrows(a[, return_index, return_inverse])

Sorts the rows of a numpy array. By default returns only the sorted array

uniquerows(a[, sort_array, return_index])

Finds unique rows of numpy array

gridsmooth(Z, span)

Smooths values on 2D rectangular grid

meshsmooth(v, mesh, span)

Smooths values on 2D unstructured mesh

mesh2grid(v, mesh)

Interpolates from an unstructured coordinates (mesh) to a structured

grid2mesh(V, grid, mesh)

Interpolates from structured coordinates (grid) to unstructured

Module Contents

seisflows.tools.array.sortrows(a, return_index=False, return_inverse=False)

Sorts the rows of a numpy array. By default returns only the sorted array

Parameters:
  • a (np.array) – array to sort

  • return_index (bool) – return the indices and the sorted array

  • return_inverse (bool) – returns the inverse sorted array as well

seisflows.tools.array.uniquerows(a, sort_array=False, return_index=False)

Finds unique rows of numpy array

Parameters:
  • a (np.array) – array to find rows of

  • sort_array (bool) – sort the rows before findingunique rows

  • return_index (bool) – return indices as well as the unique rows

seisflows.tools.array.gridsmooth(Z, span)

Smooths values on 2D rectangular grid

Note:

‘grid’: set of structured coordinates, ‘mesh’: set of unstructured coordinates

Parameters:
  • Z (np.array) – array to smooth

  • span (float) – span to smooth along

Return type:

np.array

Returns:

smoothed array

seisflows.tools.array.meshsmooth(v, mesh, span)

Smooths values on 2D unstructured mesh

Note:

‘grid’: set of structured coordinates, ‘mesh’: set of unstructured coordinates

seisflows.tools.array.mesh2grid(v, mesh)

Interpolates from an unstructured coordinates (mesh) to a structured coordinates (grid)

seisflows.tools.array.grid2mesh(V, grid, mesh)

Interpolates from structured coordinates (grid) to unstructured coordinates (mesh)