Domain

class stride.problem.domain.Space(shape=None, spacing=None, extra=None, absorbing=None)[source]

Bases: object

This defines the spatial grid over which the problem is defined.

The spatial grid consists of an inner domain defined by shape and an external padding defined by extra. Within this extra region, a further sub-region is defined as absorbing for boundary purposes as defined by absorbing.

The spacing defines the axis-wise spacing of the grid.

Parameters:
  • shape (tuple) – Shape of the inner domain.

  • spacing (tuple or float) – Axis-wise spacing of the grid, in metres.

  • extra (tuple) – Amount of axis-wise extra space around the inner domain.

  • absorbing (tuple) – Portion of the extra space that corresponds to absorbing boundaries.

extended_grid

Spatial points corresponding to the grid of the extended domain, as a tuple of 1d-arrays.

extended_indices

Indices corresponding to the grid of the extended domain, as a tuple of 1d-arrays.

extended_mesh

Create the mesh of spatial locations the full, extended domain, as a tuple of ndarray.

extended_mesh_indices

Create the mesh of indices in the extended domain, as a tuple of ndarray.

property extended_size

Alias for the extended domain limit.

grid

Spatial points corresponding to the grid of the inner domain, as a tuple of 1d-arrays.

indices

Indices corresponding to the grid of the inner domain, as a tuple of 1d-arrays.

property inner

Slices defining the inner domain, as a tuple of slices.

property inner_mask

Tensor of the shape of the space grid with gridpoints wihtin inner domain set to 1 and those outside set to 0, as an ndarray.

mesh

Create the mesh of spatial locations in the inner domain, as a tuple of ndarray.

mesh_indices

Create the mesh of indices in the inner domain, as a tuple of ndarray.

resample(spacing, extra=None, absorbing=None)[source]
property size

Alias for the domain limit.

class stride.problem.domain.Time(start=None, step=None, num=None, stop=None)[source]

Bases: object

This defines the temporal grid over which the problem is defined

A time grid is fully defined by three of its arguments: start, stop, step or num.

The time grid can be extended with a certain amount of padding, generating an inner domain and an extended domain, similar to that seen in the Space.

Parameters:
  • start (float, optional) – Point at which time starts, in seconds.

  • step (float, optional) – Step between time points, in seconds.

  • num (int, optional) – Number of time points in the grid.

  • stop (float, optional) – Point at which time ends, in seconds.

extend(extra)[source]
extended_grid

Time points corresponding to the grid of the extended domain, as a 1d-array.

grid

Time points corresponding to the grid of the inner domain, as a 1d-array.

property inner

Slice defining the inner domain.

resample(new_step, new_num)[source]

Resample a trace.

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

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

class stride.problem.domain.SlowTime(frame_rate=None, acq_rate=None, frame_step=None, acq_step=None, num_frame=None, num_acq=None)[source]

Bases: object

This defines the slow temporal grid over which the problem is defined

Parameters:
  • frame_rate (float, optional) – Sampling frequency between frames, in Hz.

  • acq_rate (float, optional) – Sampling frequency between acquisitions, in Hz.

  • frame_step (float, optional) – Time step between frames, in seconds.

  • acq_step (float, optional) – Time step between frames, in seconds.

  • num_frame (int, optional) – Number of frames in the grid.

  • num_acq (int, optional) – Number of acquisitions per frame.

property extended_num

Total number of steps.

grid

Time points corresponding to the grid, as a 1d-array.

property inner

Slice defining the inner domain.

property num

Total number of steps.

resample()[source]