Problem

class stride.problem.problem.Problem(name, *args, **kwargs)[source]

Bases: Gridded

The Problem is the object that fully defines the setting in which Stride works.

The problem defines a medium with a set of fields (such as Vp or density), some transducers (such as a series of scalar point transducers), a geometry where those transducers are located in space, and the acquisitions that happen given that geometry.

The problem also defines a problem type, which determines the physics of interest, such as the second-order isotropic acoustic wave equation. And a numerical implementation of those physics, such as through the finite-difference library Devito.

Parameters:
  • name (str) – Name of the problem.

  • grid (Grid or any of Space or Time) – Grid on which the Problem is defined

  • input_folder (str, optional) – Default folder from which files should be read, defaults to current working directory.

  • output_folder (str, optional) – Default folder to which files should be written, defaults to current working directory.

  • medium (Medium, optional) – Predefined Medium of the problem.

  • transducers (Transducers, optional) – Predefined Transducers of the problem.

  • geometry (Geometry, optional) – Predefined Geometry of the problem.

  • acquisitions (Acquisitions, optional) – Predefined Acquisitions of the problem.

dump(*args, **kwargs)[source]

Dump all elements in the Problem.

See HDF5 for more information on the parameters of this method.

load(*args, **kwargs)[source]

Load all elements in the Problem.

See HDF5 for more information on the parameters of this method.

plot(**kwargs)[source]

Plot all elements in the Problem.

Parameters:

kwargs – Arguments for plotting the fields.

sub_problem(shot_id)[source]

Create a subset object for a certain shot.

A SubProblem contains everything that is needed to fully determine how to run a particular shot. This method takes care of selecting creating a SubProblem instance and populating it appropriately.

Parameters:

shot_id (int) – ID of the shot for which this sub-problem will be generated.

Returns:

Newly created SubProblem instance.

Return type:

SubProblem

time_resample(new_step, new_num=None, **kwargs)[source]

In-place operatin to resample the wavelets and data into a grid with new time-spacing. Sinc interpolation is used.

Parameters:
  • new_step (float) – The time spacing for the interpolated grid

  • new_num (int, optional) – The number of time-points, default is calculated to match input pulse length in [s]

class stride.problem.problem.SubProblem(name, *args, **kwargs)[source]

Bases: Gridded

The SubProblem is the object that fully defines how a specific Shot is to be run. The SubProblem resembles the Problem from which ir originates, but takes from it only those parts that are relevant for this particular Shot.

The SubProblem defines a medium with a set of fields (such as Vp or density), some transducers (such as a series of scalar point transducers), a geometry where those transducers are located in space, and the acquisitions that happen given that geometry.

The SubProblem also defines a problem type, which determines the physics of interest, such as the second-order isotropic acoustic wave equation. And a numerical implementation of those physics, such as through the finite-difference library Devito.

Parameters:
  • name (str) – Name of the problem.

  • grid (Grid or any of Space or Time) – Grid on which the Problem is defined

  • input_folder (str, optional) – Default folder from which files should be read, defaults to current working directory.

  • output_folder (str, optional) – Default folder to which files should be written, defaults to current working directory.

  • transducers (Transducers, optional) – Predefined Transducers of the problem.

  • geometry (Geometry, optional) – Predefined Geometry of the problem.

  • acquisitions (Acquisitions, optional) – Predefined Acquisitions of the problem.