ADFWI.view

ADFWI.view.boundary_condition

ADFWI.view.boundary_condition.plot_bc()[source]
ADFWI.view.boundary_condition.plot_bcx_bcz(bcx, bcz, dx=-1, dz=-1, figsize=(10, 5), wspace=0.2, hspace=0.2, cmap='gray_r', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.1, cbar_height=0.05, show=True, save_path='', save_dpi=300)[source]

Plot boundary conditions along X and Z axes using matplotlib.

Parameters:
  • bcx (ndarray or Tensor) – The boundary condition along the X-axis.

  • bcz (ndarray or Tensor) – The boundary condition along the Z-axis.

  • dx (float, optional) – The spatial sampling interval along the X-axis. Default is -1.

  • dz (float, optional) – The spatial sampling interval along the Z-axis. Default is -1.

  • figsize (tuple, optional) – The size of the figure. Default is (10, 5).

  • wspace (float, optional) – The width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – The height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – The colormap used to map scalar data to colors. Default is ‘gray_r’.

  • tick_param (dict, optional) – The font parameters for tick labels. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – The font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – The font parameters for colorbar labels. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – The font parameters for plot titles. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – The padding interval between colorbar and main figure. Default is 0.1.

  • cbar_height (float, optional) – The height of the colorbar. Default is 0.05.

  • show (bool, optional) – If True, displays the plot. Default is True.

  • save_path (str, optional) – Path to save the figure. Default is an empty string, meaning no saving.

  • save_dpi (int, optional) – The resolution (DPI) of the saved figure. Default is 300.

ADFWI.view.boundary_condition.plot_damp(damp, dx=-1, dz=-1, figsize=(8, 8), wspace=0.2, hspace=0.2, cmap='gray_r', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.12, cbar_height=0.03, show=True, save_path='', save_dpi=300)[source]

Plots the ABL (Absorbing Boundary Layer) boundary condition.

This function visualizes the damping boundary condition in a 2D grid using either pcolormesh or imshow from matplotlib, with optional parameters to customize the appearance and save the plot.

Parameters:
  • damp (ndarray or Tensor) – The damping boundary condition to be visualized. Should be a 2D array representing the damping values.

  • dx (float, optional) – The spatial sampling interval along the x-axis in meters. Default is -1.

  • dz (float, optional) – The spatial sampling interval along the z-axis in meters. Default is -1.

  • figsize (tuple, optional) – The size of the figure in inches. Default is (8, 8).

  • wspace (float, optional) – The width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – The height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – The Colormap instance or registered colormap name used to map scalar data to colors. Default is ‘gray_r’.

  • tick_param (dict, optional) – The fontdict for ticks, e.g., {‘labelsize’: 15}.

  • label_param (dict, optional) – The fontdict for labels (x and y axes), e.g., {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – The fontdict for colorbar labels, e.g., {‘labelsize’: 15}.

  • title_param (dict, optional) – The fontdict for the title, e.g., {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – The padding interval for colorbar and main figure, default is 0.12.

  • cbar_height (float, optional) – The height of the colorbar, default is 0.03.

  • show (bool, optional) – If True, the figure will be shown. Default is True.

  • save_path (str, optional) – The file path to save the figure. If empty, the figure will not be saved. Default is an empty string.

  • save_dpi (int, optional) – The resolution (dots per inch) for saving the figure. Default is 300 dpi.

ADFWI.view.inverted_loss_model

ADFWI.view.inverted_loss_model.animate_inversion_process(iter_vp, vmin=None, vmax=None, save_path='', fps=10, interval=150)[source]

Create an animation of the inversion process.

Parameters:
  • iter_vp (list or np.array) – A list or array containing the velocity model at each iteration. The last element represents the final inverted model.

  • vmin (float, optional) – The minimum value for the color scale. If not provided, the minimum value of the inversion process is used.

  • vmax (float, optional) – The maximum value for the color scale. If not provided, the maximum value of the inversion process is used.

  • save_path (str, optional) – The file path where the animation will be saved. If not provided, the animation will not be saved.

  • fps (int, optional) – Frames per second for the animation. Default is 10.

  • interval (int, optional) – The time interval (in milliseconds) between frames in the animation. Default is 150.

ADFWI.view.inverted_loss_model.plot_initial_and_inverted(vp_init, iter_vp, save_path='', show=False, cmap='jet_r')[source]

Plot and save the initial model and inverted results.

Parameters:
  • vp_init (np.array) – The initial velocity model to be plotted. It is a 2D array representing the starting model.

  • iter_vp (list or np.array) – A list of inverted results, where the last element is the final inverted model. This is the data used to plot the inverted model.

  • save_path (str, optional) – The file path where the plot image will be saved. If not provided, the plot will not be saved.

  • show (bool, optional) – Flag to control whether to display the plot. If True, the plot will be shown. Default is False.

  • cmap (str or Colormap, optional) – The colormap to be used for visualizing the models. Default is ‘jet_r’.

ADFWI.view.inverted_loss_model.plot_misfit(iter_loss, save_path='', show=False)[source]

Plot and save the misfits over iterations.

This function generates a plot of the misfit values across iterations and provides options to save the plot to a specified path or display it.

Parameters:
  • iter_loss (list or np.array) – A sequence containing the misfits for each iteration. This is the primary data that will be visualized on the plot.

  • save_path (str, optional) – The file path where the plot image will be saved. If not provided, the plot will not be saved.

  • show (bool, optional) – Flag to control whether to display the plot. If True, the plot will be shown. Default is False.

ADFWI.view.observed_system

ADFWI.view.observed_system.add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs)[source]

Add a vertical color bar to an image plot.

ADFWI.view.survey

ADFWI.view.survey.plot_survey(src_x, src_z, rcv_x, rcv_z, vel_model, dx=-1, dz=-1, figsize=(8, 8), wspace=0.2, hspace=0.2, cmap='jet', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.12, cbar_height=0.03, show=True, save_path='', save_dpi=300)[source]

Plot the survey setup, including the velocity model, sources, and receivers.

Parameters:
  • src_x (array-like) – x-coordinates of the sources.

  • src_z (array-like) – z-coordinates of the sources.

  • rcv_x (array-like) – x-coordinates of the receivers.

  • rcv_z (array-like) – z-coordinates of the receivers.

  • vel_model (np.ndarray) – 2D array representing the velocity model.

  • dx (float, optional) – Horizontal spacing of the model, in meters. Default is -1.

  • dz (float, optional) – Vertical spacing of the model, in meters. Default is -1.

  • figsize (tuple, optional) – Size of the figure in inches. Default is (8, 8).

  • wspace (float, optional) – Horizontal space between subplots. Default is 0.2.

  • hspace (float, optional) – Vertical space between subplots. Default is 0.2.

  • cmap (str, optional) – Colormap for the velocity model plot. Default is ‘jet’.

  • tick_param (dict, optional) – Parameters for tick labels. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font parameters for the colorbar labels. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font parameters for the title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – Fraction of the colorbar height for padding. Default is 0.12.

  • cbar_height (float, optional) – Height of the colorbar. Default is 0.03.

  • show (bool, optional) – If True, display the plot. Default is True.

  • save_path (str, optional) – If provided, saves the figure to the specified path. Default is “” (no saving).

  • save_dpi (int, optional) – Dots per inch (DPI) for saving the figure. Default is 300.

ADFWI.view.survey.plot_wavelet(tlist, wavelet, figsize=(6, 4), color='k', linestyle='-', linewidth=1, tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, cbar_pad_fraction=0.12, cbar_height=0.03, show=True, save_path='', save_dpi=300)[source]

Plot the source wavelet.

Parameters:
  • tlist (array-like) – Time values for plotting the wavelet.

  • wavelet (array-like) – Amplitude values corresponding to the wavelet at each time point.

  • figsize (tuple, optional) – Size of the figure in inches. Default is (6, 4).

  • color (str, optional) – Color of the wavelet plot. Default is ‘k’ (black).

  • linestyle (str, optional) – Line style for the wavelet plot. Default is ‘-’ (solid line).

  • linewidth (float, optional) – Line width of the plot. Default is 1.

  • tick_param (dict, optional) – Parameters for tick labels. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font parameters for the colorbar labels. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font parameters for the title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • cbar_pad_fraction (float, optional) – Fraction of the colorbar height for padding. Default is 0.12.

  • cbar_height (float, optional) – Height of the colorbar. Default is 0.03.

  • show (bool, optional) – If True, display the plot. Default is True.

  • save_path (str, optional) – If provided, saves the figure to the specified path. Default is “” (no saving).

  • save_dpi (int, optional) – Dots per inch (DPI) for saving the figure. Default is 300.

ADFWI.view.velocity_model

ADFWI.view.velocity_model.plot_eps_delta_gamma(eps, delta, gamma, dx=-1, dz=-1, figsize=(14, 4), wspace=0.2, hspace=0.2, cmap='jet', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.1, cbar_height=0.05, show=True, save_path='', save_dpi=300)[source]

Plot epsilon, delta, and gamma data sections.

Parameters:
  • eps (ndarray or Tensor) – Anisotropic parameter epsilon.

  • delta (ndarray or Tensor) – Anisotropic parameter delta.

  • gamma (ndarray or Tensor) – Anisotropic parameter gamma.

  • dx (float, optional) – Spatial sampling interval along the x-axis in meters. Default is -1.

  • dz (float, optional) – Spatial sampling interval along the z-axis in meters. Default is -1.

  • figsize (tuple, optional) – Size of the figure. Default is (14, 4).

  • wspace (float, optional) – Width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – Height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – Colormap instance or registered colormap name used to map scalar data to colors. Default is ‘jet’.

  • tick_param (dict, optional) – Font properties for ticks. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font properties for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font properties for the colorbar. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font properties for titles. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – Padding fraction between the colorbar and the main plot. Default is 0.1.

  • cbar_height (float, optional) – Height of the colorbar. Default is 0.05.

  • show (bool, optional) – If True, display the plot. Default is True.

  • save_path (str, optional) – Path to save the figure. Default is an empty string, indicating the figure will not be saved.

  • save_dpi (int, optional) – Resolution of the saved figure in dots per inch. Default is 300.

ADFWI.view.velocity_model.plot_lam_mu(lam, mu, dx=-1, dz=-1, figsize=(10, 5), wspace=0.2, hspace=0.2, cmap='jet', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.1, cbar_height=0.05, show=True, save_path='', save_dpi=300)[source]

Plot lambda and mu.

Parameters:
  • lam (ndarray or Tensor) – The lambda constant parameter.

  • mu (ndarray or Tensor) – The mu constant parameter.

  • dx (float, optional) – The spatial sampling interval along the x-axis. Default is -1.

  • dz (float, optional) – The spatial sampling interval along the z-axis. Default is -1.

  • figsize (tuple, optional) – The size of the figure. Default is (10, 5).

  • wspace (float, optional) – The width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – The height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – The Colormap instance or registered colormap name used to map scalar data to colors. Default is ‘jet’.

  • tick_param (dict, optional) – Font parameters for ticks. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font parameters for colorbar. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font parameters for title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – The padding interval between the colorbar and the main figure. Default is 0.1.

  • cbar_height (float, optional) – The height of the colorbar. Default is 0.05.

  • show (bool, optional) – Whether to display the figure. Default is True.

  • save_path (str, optional) – The file path to save the figure. Default is an empty string (not saved).

  • save_dpi (int, optional) – The resolution of the saved figure. Default is 300 dpi.

ADFWI.view.velocity_model.plot_model(vel_model, title, dx=-1, dz=-1, figsize=(8, 8), wspace=0.2, hspace=0.2, cmap='jet', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.12, cbar_height=0.03, vmin=None, vmax=None, show=True, save_path='', save_dpi=300)[source]

Plot velocity model.

Parameters:
  • vel_model (ndarray or Tensor) – The velocity model to be plotted.

  • title (str) – The title of the plot.

  • dx (float, optional) – The spatial sampling interval along the x-axis. Default is -1.

  • dz (float, optional) – The spatial sampling interval along the z-axis. Default is -1.

  • figsize (tuple, optional) – The size of the figure. Default is (8, 8).

  • wspace (float, optional) – The width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – The height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – The Colormap instance or registered colormap name used to map scalar data to colors. Default is ‘jet’.

  • tick_param (dict, optional) – Font parameters for ticks. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font parameters for colorbar. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font parameters for title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – The padding interval between the colorbar and the main figure. Default is 0.12.

  • cbar_height (float, optional) – The height of the colorbar. Default is 0.03.

  • vmin (float, optional) – The minimum value for the colormap. Default is None.

  • vmax (float, optional) – The maximum value for the colormap. Default is None.

  • show (bool, optional) – Whether to display the figure. Default is True.

  • save_path (str, optional) – The file path to save the figure. Default is an empty string (not saved).

  • save_dpi (int, optional) – The resolution of the saved figure. Default is 300 dpi.

ADFWI.view.velocity_model.plot_vp_rho(vp, rho, dx=-1, dz=-1, figsize=(10, 5), wspace=0.2, hspace=0.2, cmap='jet', tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 15}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.1, cbar_height=0.05, show=True, save_path='', save_dpi=300)[source]

Plot P-wave velocity (vp) and density (rho) data sections.

Parameters:
  • vp (ndarray or Tensor) – P-wave velocity in meters per second.

  • rho (ndarray or Tensor) – Density in kilograms per cubic meter.

  • dx (float, optional) – Spatial sampling interval along the x-axis in meters. Default is -1.

  • dz (float, optional) – Spatial sampling interval along the z-axis in meters. Default is -1.

  • figsize (tuple, optional) – Size of the figure. Default is (10, 5).

  • wspace (float, optional) – The width of the padding between subplots, as a fraction of the average Axes width. Default is 0.2.

  • hspace (float, optional) – The height of the padding between subplots, as a fraction of the average Axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – Colormap instance or registered colormap name. Default is ‘jet’.

  • tick_param (dict, optional) – Font properties for ticks. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font properties for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font properties for colorbar. Default is {‘labelsize’: 15}.

  • title_param (dict, optional) – Font properties for titles. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – Padding fraction between colorbar and the main plot. Default is 0.1.

  • cbar_height (float, optional) – Height of the colorbar. Default is 0.05.

  • show (bool, optional) – If True, display the plot. Default is True.

  • save_path (str, optional) – Path to save the plot. If not provided, the plot will not be saved. Default is “”.

  • save_dpi (int, optional) – DPI for saving the plot. Default is 300.

ADFWI.view.velocity_model.plot_vp_vs_rho(vp, vs, rho, dx=-1, dz=-1, figsize=(14, 4), wspace=0.2, hspace=0.2, cmap='jet', title='', vp_min=None, vp_max=None, vs_min=None, vs_max=None, rho_min=None, rho_max=None, tick_param={'labelsize': 15}, label_param={'family': 'Times New Roman', 'size': 15, 'weight': 'normal'}, colorbar_param={'labelsize': 12}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, cbar_pad_fraction=0.1, cbar_height=0.05, show=True, save_path='', save_dpi=300)[source]

Plot P-wave velocity (vp), S-wave velocity (vs), and density (rho) sections.

Parameters:
  • vp (ndarray or Tensor) – P-wave velocity (m/s).

  • vs (ndarray or Tensor) – S-wave velocity (m/s).

  • rho (ndarray or Tensor) – Density (kg/m^3).

  • dx (float, optional) – Spatial sampling interval along the x-axis in meters. Default is -1.

  • dz (float, optional) – Spatial sampling interval along the z-axis in meters. Default is -1.

  • figsize (tuple, optional) – Size of the figure (width, height) in inches. Default is (14, 4).

  • wspace (float, optional) – Width of the padding between subplots as a fraction of the average axes width. Default is 0.2.

  • hspace (float, optional) – Height of the padding between subplots as a fraction of the average axes height. Default is 0.2.

  • cmap (str or Colormap, optional) – Colormap used to map scalar data to colors. Default is ‘jet’.

  • vp_min (float, optional) – Minimum value for the P-wave velocity color scale. Default is None.

  • vp_max (float, optional) – Maximum value for the P-wave velocity color scale. Default is None.

  • vs_min (float, optional) – Minimum value for the S-wave velocity color scale. Default is None.

  • vs_max (float, optional) – Maximum value for the S-wave velocity color scale. Default is None.

  • rho_min (float, optional) – Minimum value for the density color scale. Default is None.

  • rho_max (float, optional) – Maximum value for the density color scale. Default is None.

  • tick_param (dict, optional) – Font parameters for tick labels. Default is {‘labelsize’: 15}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 15}.

  • colorbar_param (dict, optional) – Font parameters for the colorbar labels. Default is {‘labelsize’: 12}.

  • title_param (dict, optional) – Font parameters for the title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • cbar_pad_fraction (float, optional) – Fraction of padding between the colorbar and the main figure. Default is 0.1.

  • cbar_height (float, optional) – Height of the colorbar. Default is 0.05.

  • show (bool, optional) – If True, displays the plot. Default is True.

  • save_path (str, optional) – If provided, saves the figure to the specified path. Default is “” (no saving).

  • save_dpi (int, optional) – DPI resolution for saving the figure. Default is 300.

ADFWI.view.waveform

ADFWI.view.waveform.insert_zeros(trace, tt=None)[source]

Insert zero locations in data trace and tt vector based on linear fit

ADFWI.view.waveform.norm_traces(data)[source]

Normalize seismic data to its maximum amplitude, trace by trace.

Parameters:

data (ndarray) – Seismic data of shape (num_traces, num_samples), where each row represents a trace.

Returns:

The normalized seismic data, where each trace is scaled by its maximum absolute amplitude.

Return type:

ndarray

ADFWI.view.waveform.plot_waveform2D(data, dt=None, dx=None, cmap='coolwarm', aspect='auto', clip=99.9, figsize=(10, 6), colorbar=False, type='section', norm=False, wiggle_scale=1, wiggle_interval=1, plot_fk=False, vel=None, fmin=1, fmax=20, kmin=-0.05, kmax=0.05, save_path='', show=False)[source]

Plot a 2D seismic data section.

Parameters:
  • data (ndarray or Tensor) – The seismic data to be plotted.

  • dt (float, optional) – The time sampling interval. If not provided, the x-axis will be labeled with sample numbers.

  • dx (float, optional) – The spatial sampling interval. If not provided, the y-axis will be labeled with trace numbers.

  • cmap (str, optional) – The colormap to be used. Default is ‘coolwarm’.

  • aspect (str, optional) – The aspect ratio of the plot. Default is ‘auto’.

  • clip (float, optional) – The percentile value for clipping the data. Default is 99.9.

  • figsize (tuple, optional) – The size of the figure. Default is (10, 6).

  • colorbar (bool, optional) – Whether to show the colorbar. Default is False.

  • type (str, optional) – The type of plot to generate. Can be either ‘section’ for an image plot or ‘wiggle’ for a wiggle plot.

  • norm (bool, optional) – Whether to normalize the data. Default is False.

  • wiggle_scale (float, optional) – Scaling factor for the wiggle plot. Default is 1.

  • wiggle_interval (int, optional) – The interval for plotting wiggles. Default is 1.

  • plot_fk (bool, optional) – Whether to plot a second subplot for fk filtering. Default is False.

  • vel (ndarray, optional) – The velocity model for fk filtering. Not currently used.

  • fmin (float, optional) – The minimum frequency for fk filtering. Default is 1 Hz.

  • fmax (float, optional) – The maximum frequency for fk filtering. Default is 20 Hz.

  • kmin (float, optional) – The minimum wavenumber for fk filtering. Default is -0.05.

  • kmax (float, optional) – The maximum wavenumber for fk filtering. Default is 0.05.

  • save_path (str, optional) – The file path to save the figure. Default is an empty string (no save).

  • show (bool, optional) – Whether to display the plot. Default is False (do not display).

ADFWI.view.waveform.plot_waveform_trace(data, shot=0, trace=0, dt=None, figsize=(12, 4), color='k', tick_param={'labelsize': 18}, label_param={'family': 'Times New Roman', 'size': 18, 'weight': 'normal'}, title_param={'family': 'Times New Roman', 'size': 20, 'weight': 'normal'}, show=True, save_path='', save_dpi=300)[source]

Plot a single trace waveform.

Parameters:
  • data (ndarray or Tensor) – 3D waveform data of shape (shots, time_samples, traces).

  • shot (int, optional) – The shot number to visualize. Default is 0.

  • trace (int, optional) – The trace number to visualize. Default is 0.

  • dt (float, optional) – The time step interval between samples. If provided, the x-axis will be labeled with time in seconds. If not provided, the x-axis will show time samples.

  • figsize (tuple, optional) – The size of the figure. Default is (12, 4).

  • color (str, optional) – The color of the waveform line. Default is ‘k’ (black).

  • tick_param (dict, optional) – Font parameters for ticks. Default is {‘labelsize’: 18}.

  • label_param (dict, optional) – Font parameters for axis labels. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 18}.

  • title_param (dict, optional) – Font parameters for the title. Default is {‘family’: ‘Times New Roman’, ‘weight’: ‘normal’, ‘size’: 20}.

  • show (bool, optional) – Whether to display the plot. Default is True.

  • save_path (str, optional) – The file path to save the figure. Default is an empty string (not saved).

  • save_dpi (int, optional) – The resolution of the saved figure. Default is 300 dpi.

ADFWI.view.waveform.plot_waveform_wiggle(data, tt=None, xx=None, color='k', sf=0.15, verbose=False, save_path='', show=False)[source]

Create a wiggle plot of a seismic data section.

Parameters:
  • data (ndarray or Tensor) – 2D waveform data to be plotted.

  • tt (ndarray or Tensor, optional) – Time list of the waveforms. If not provided, the function will default to the indices of the data.

  • xx (ndarray or Tensor, optional) – Offset list of the waveforms. If not provided, the function will default to the trace indices.

  • color (str, optional) – The color of the waveform traces. Defaults to ‘k’ (black).

  • sf (float, optional) – Stretch factor to scale the wiggle amplitude. Defaults to 0.15.

  • verbose (bool, optional) – If True, prints the offsets of the traces. Defaults to False.

  • save_path (str, optional) – The path where the figure will be saved. If not provided, the figure will not be saved.

  • show (bool, optional) – If True, displays the figure. Defaults to False.

Notes

The following color abbreviations are supported:

character

color

‘b’

blue

‘g’

green

‘r’

red

‘c’

cyan

‘m’

magenta

‘y’

yellow

‘k’

black

‘w’

white

ADFWI.view.waveform.wiggle_input_check(data, tt, xx, sf, verbose)[source]

Helper function for wiggle() and traces() to check input