Grids#
2D#
- class fteikpy.TraveltimeGrid2D(grid, gridsize, origin, source, gradient, vzero)[source]#
2D traveltime grid class.
- Parameters:
grid (array_like) – Traveltime grid array.
gridsize (array_like) – Grid size (dz, dx).
origin (array_like) – Grid origin coordinates.
source (array_like) – Source coordinates.
gradient (array_like) – Gradient grid.
vzero (scalar) – Slowness at the source.
- __call__(points, fill_value=nan)[source]#
Bilinear apparent velocity interpolation.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
fill_value (scalar, optional, default nan) – Returned value for out-of-bound query points.
- Returns:
Interpolated traveltime(s).
- Return type:
scalar or
np.ndarray
- property gradient#
Return Z and X gradient grids as a list of
fteikpy.Grid2D
.
- property grid#
Return grid.
- property gridsize#
Return grid size.
- property ndim#
Return grid number of dimensions.
- property origin#
Return grid origin coordinates.
- raytrace(points, stepsize=None, max_step=None, honor_grid=False)[source]#
2D a posteriori ray-tracing.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
stepsize (scalar or None, optional, default None) – Unit length of ray. stepsize is ignored if honor_grid is True.
max_step (scalar or None, optional, default None) – Maximum number of steps.
honor_grid (bool, optional, default False) – If True, coordinates of raypaths are calculated with respect to traveltime grid discretization.
- Returns:
Raypath(s).
- Return type:
np.ndarray
or list ofnp.ndarray
- resample(new_shape, method='linear')#
Resample grid.
- Parameters:
new_shape (array_like) – New grid shape (nz, nx).
method (str ('linear' or 'nearest'), optional, default 'linear') – Interpolation method.
- property shape#
Return grid shape.
- property size#
Return grid size.
- smooth(sigma)#
Smooth grid.
- Parameters:
sigma (scalar or array_like) – Standard deviation in meters for Gaussian kernel.
- property source#
Return source coordinates.
- property xaxis#
Return grid X axis.
- property zaxis#
Return grid Z axis.
- class fteikpy.Grid2D(*args, **kwargs)[source]#
2D grid class.
- Parameters:
grid (array_like) – Grid array.
gridsize (array_like) – Grid size (dz, dx).
origin (array_like) – Grid origin coordinates.
- __call__(points, fill_value=nan)#
Bilinear interpolation.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
fill_value (scalar, optional, default nan) – Returned value for out-of-bound query points.
- Returns:
Interpolated value(s).
- Return type:
scalar or
np.ndarray
- property grid#
Return grid.
- property gridsize#
Return grid size.
- property ndim#
Return grid number of dimensions.
- property origin#
Return grid origin coordinates.
- resample(new_shape, method='linear')#
Resample grid.
- Parameters:
new_shape (array_like) – New grid shape (nz, nx).
method (str ('linear' or 'nearest'), optional, default 'linear') – Interpolation method.
- property shape#
Return grid shape.
- property size#
Return grid size.
- smooth(sigma)#
Smooth grid.
- Parameters:
sigma (scalar or array_like) – Standard deviation in meters for Gaussian kernel.
- property xaxis#
Return grid X axis.
- property zaxis#
Return grid Z axis.
3D#
- class fteikpy.TraveltimeGrid3D(grid, gridsize, origin, source, gradient, vzero)[source]#
3D traveltime grid class.
- Parameters:
grid (array_like) – Traveltime grid array.
gridsize (array_like) – Grid size (dz, dx, dy).
origin (array_like) – Grid origin coordinates.
source (array_like) – Source coordinates.
gradient (array_like) – Gradient grid.
vzero (scalar) – Slowness at the source.
- __call__(points, fill_value=nan)[source]#
Trilinear apparent velocity interpolation.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
fill_value (scalar, optional, default nan) – Returned value for out-of-bound query points.
- Returns:
Interpolated traveltime(s).
- Return type:
scalar or
np.ndarray
- property gradient#
Return Z, X and Y gradient grids as a list of
fteikpy.Grid3D
.
- property grid#
Return grid.
- property gridsize#
Return grid size.
- property ndim#
Return grid number of dimensions.
- property origin#
Return grid origin coordinates.
- raytrace(points, stepsize=None, max_step=None, honor_grid=False)[source]#
3D a posteriori ray-tracing.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
stepsize (scalar or None, optional, default None) – Unit length of ray. stepsize is ignored if honor_grid is True.
max_step (scalar or None, optional, default None) – Maximum number of steps.
honor_grid (bool, optional, default False) – If True, coordinates of raypaths are calculated with respect to traveltime grid discretization.
- Returns:
Raypath(s).
- Return type:
np.ndarray
or list ofnp.ndarray
- resample(new_shape, method='linear')#
Resample grid.
- Parameters:
new_shape (array_like) – New grid shape (nz, nx, ny).
method (str ('linear' or 'nearest'), optional, default 'linear') – Interpolation method.
- property shape#
Return grid shape.
- property size#
Return grid size.
- smooth(sigma)#
Smooth grid.
- Parameters:
sigma (scalar or array_like) – Standard deviation in meters for Gaussian kernel.
- property source#
Return source coordinates.
- property xaxis#
Return grid X axis.
- property yaxis#
Return grid Y axis.
- property zaxis#
Return grid Z axis.
- class fteikpy.Grid3D(*args, **kwargs)[source]#
3D grid class.
- Parameters:
grid (array_like) – Grid array.
gridsize (array_like) – Grid size (dz, dx, dy).
origin (array_like) – Grid origin coordinates.
- __call__(points, fill_value=nan)#
Trilinear interpolaton.
- Parameters:
points (array_like) – Query point coordinates or list of point coordinates.
fill_value (scalar, optional, default nan) – Returned value for out-of-bound query points.
- Returns:
Interpolated value(s).
- Return type:
scalar or
np.ndarray
- property grid#
Return grid.
- property gridsize#
Return grid size.
- property ndim#
Return grid number of dimensions.
- property origin#
Return grid origin coordinates.
- resample(new_shape, method='linear')#
Resample grid.
- Parameters:
new_shape (array_like) – New grid shape (nz, nx, ny).
method (str ('linear' or 'nearest'), optional, default 'linear') – Interpolation method.
- property shape#
Return grid shape.
- property size#
Return grid size.
- smooth(sigma)#
Smooth grid.
- Parameters:
sigma (scalar or array_like) – Standard deviation in meters for Gaussian kernel.
- property xaxis#
Return grid X axis.
- property yaxis#
Return grid Y axis.
- property zaxis#
Return grid Z axis.