ADFWI.survey

ADFWI.survey.source

class ADFWI.survey.source.Source(nt: int, dt: float, f0: float)[source]

Bases: object

Seismic Source class

add_encoded_sources(src_x: array, src_z: array, src_wavelet: ndarray, src_type: str | None = 'mt', src_mt: ndarray | None = array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])) None[source]

source encoded

add_source(src_x: int, src_z: int, src_wavelet: ndarray, src_type: str | None = 'mt', src_mt: ndarray | None = array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])) None[source]

Append single source

add_sources(src_x: array, src_z: array, src_wavelet: ndarray, src_type: str | None = 'mt', src_mt: ndarray | None = array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])) None[source]

add multiple sources with same wavelet

get_loc()[source]

Return the source location

get_moment_tensor()[source]

Return the source wavelets

get_type(unique=False) List[str][source]

Return the source type

get_wavelet()[source]

Return the source wavelets

plot_wavelet(index=0, src_idx=None, **kwargs)[source]

ADFWI.survey.receiver

class ADFWI.survey.receiver.Receiver(nt: int, dt: float)[source]

Bases: object

Seismic Receiver class for handling receiver locations and seismic data.

Parameters:
  • (int) (nt) –

  • (float) (dt) –

  • Notes

  • -------------

  • (i.e. (3. The receiver locations are assumed to be the same for all shots) –

  • 0). (t =) –

  • method. (2. The receiver locations are added using the add_receiver) –

  • (i.e.

  • shape (the receiver positions are not shot-dependent). This assumption is based on the efficiency of handling regular data (with) –

add_receiver(rcv_x: int, rcv_z: int, rcv_type: str) None[source]

Append single receiver

add_receivers(rcv_x: array, rcv_z: array, rcv_type: str) None[source]

add multiple receiver with same type

get_loc()[source]

Return the source location

get_type(unique=False) List[str][source]

Return the source type

ADFWI.survey.data

class ADFWI.survey.data.SeismicData(survey: Survey)[source]

Bases: object

A class to handle and process seismic data collected during a survey.

Parameters:
  • survey (Survey) – The Survey object containing information about sources and receivers.

  • src_num (int) – Number of sources in the survey.

  • rcv_num (int) – Number of receivers in the survey.

  • src_loc (np.ndarray) – Locations of the sources.

  • rcv_loc (np.ndarray) – Locations of the receivers.

  • src_type (str) – Type of sources (e.g., ‘point’, ‘line’).

  • rcv_type (str) – Type of receivers (e.g., ‘pressure’).

  • nt (int) – Number of time samples.

  • dt (float) – Time step size.

  • t (np.ndarray) – Array of time steps.

  • data (dict) – Seismic data (pressure, velocity, etc.).

  • data_masks (dict) – Masks for the seismic data.

load(path: str)[source]

Load the shot gather data

normalize_and_mask(array)[source]

Normalize the seismic data array by dividing by its maximum value along the time axis, and create a mask for invalid data (time sum == 0).

parse_acoustic_data(normalize=False)[source]

Parse acoustic data (pressure and velocity components) from the seismic data.

parse_elastic_data(normalize=False)[source]

Parse elastic data (stress and velocity components) from the seismic data.

plot_waveform2D(i_shot, rcv_type='pressure', acoustic_or_elastic='acoustic', normalize=True, **kwargs)[source]
plot_waveform_trace(i_shot, i_trace, rcv_type='pressure', acoustic_or_elastic='acoustic', normalize=True, **kwargs)[source]
plot_waveform_wiggle(i_shot, rcv_type='pressure', acoustic_or_elastic='acoustic', normalize=True, **kwargs)[source]
record_data(data: dict)[source]

Add the shot gather data to the class

save(path: str)[source]

Save the seismic data to a .npz file.

ADFWI.survey.survey

class ADFWI.survey.survey.Survey(source: Source, receiver: Receiver, receiver_masks=None, receiver_masks_obs=True)[source]

Bases: object

Survey class describes the seismic acquisition geometry (2D). Assumes that all sources share the same receivers, time samples, and time interval.

Parameters:
  • source (Source) – Source object containing the source information.

  • receiver (Receiver) – Receiver object containing the receiver information.

  • receiver_masks (numpy.ndarray, optional) – The index of useful receivers at each shot, of shape [shot number, receiver number]. By default, None. This parameter is useful for designing special observation systems where only certain receivers are active (e.g., line one-side).

  • receiver_masks_obs (bool, optional) – Indicates whether the observation waveforms need to be masked or not. By default, True.

plot(model_data: ndarray, **kwargs) None[source]

Plots the entire survey including all sources and receivers with associated model data.

plot_single_shot(model_data: ndarray, src_idx: int, **kwargs) None[source]

Plots a single shot’s survey with associated model data.

set_receiver_masks(receiver_masks: ndarray) None[source]

Set the receiver masks for the survey. Masks specify which receivers are useful for each shot.

Parameters:

receiver_masks (numpy.ndarray) – The receiver mask array with shape [number of shots, number of receivers].