Gradient estimation

WavePropagator.gradient(res, show=False, parameterization='dv')

gradient estimates the gradient using adjoint-state method.

Parameters:
  • res (dict) – The adjoint of the derivative of ost function with respect to wavefield

  • show (bool, optional) – True if you desire to see the backward wave propagation, by default False

  • parameterization (str, optional) – Specify the parameterization for output, by default ‘dv’

Returns:

Gradient

Return type:

dict

Full-waveform inversion

class PyFWI.fwi.FWI(d_obs, inpa, src, rec_loc, model_shape, components, chpr, n_well_rec=0, param_functions=None)

FWI perform full-waveform inversion

Parameters:
  • d_obs (dict) – Observed data

  • inpa (dict) – Input parameters

  • src (Class) – Source object

  • rec_loc (float) – Receiver location

  • model_size (tuple) – Shape of the model

  • n_well_rec (int) – Number of receivers in the well

  • chpr (float (percentage)) – Percentage for check point

  • components (int) – Type of output

  • param_functions (dict, optional) – List of functions required in case of inversion with different parameterization than dv, by default None

__call__(m0, method: str, iter: List[int], freqs: List[float], n_params, k_0, k_end)

Calling this object performs the FWI

Parameters:
  • m0 (dict) – The initial model

  • method (str) – The optimization method. Either should be cg for congugate gradient or lbfgs for l-BFGS.

  • iter (List[int]) – An array of iteration for each frequency

  • freqs (List[float]) – Frequencies for multi-scale inversion.

  • n_params (int) – Number of parameter to invert for in each time

  • k_0 (int) – The first parameter of interest

  • k_end (int) – The last parameter of interest

Returns:

  • m_est (dictionary) – The estimated model

  • rms (ndarray) – The rms error

Time-lapse full-waveform inversion

class PyFWI.tl_fwi.TimeLapse(b_dobs, m_dobs, inpa, src, rec_loc, model_shape, components, chpr, n_well_rec=0, param_functions=None)

TimeLapse is a class to perform time-lapse FWI.

Parameters:
  • b_dobs (dict) – Observed data from baseline

  • m_dobs (dict) – Observed data from monitor vintage

  • inpa (dict) – Dictionary of required parameters for FWI

  • src (obj) – Source function

  • rec_loc (ndarray) – Location of receivers

  • model_size (tuple) – Shape pf model

  • n_well_rec (int) – Number of receivers on the surface

  • chpr (int) – Checkpoint percentage

  • components (int) – Code for components to be recorded

  • param_functions (dict, optional) – Required functions to switch the gradient

__call__(b_m0, iter, freqs, tl_method, n_params, k_0, k_end)

Calling this class will run time-lapse FWI and return the result of FWI and TL-FWI

Parameters:
  • b_m0 (dict) – Initial model in form of dictionary

  • iter (list) – List of iteration for each frequency

  • freqs (list) – Frequencies for multiscale inversion

  • tl_method (str) –

    Name of time-lapse method (‘cc’: Cascaded, ‘sim’: Simultaneous, ‘wa’: Weighted average,

    ’cj’: Cascaded joint, ‘cd’: Central difference, ‘cu’: Cross updating)

  • n_params (int) – Number of parameters to invert

  • k_0 (int) – Index of th first parameter to invert (considering a b_m0 with three parameters (vp, vs, rho), if we can set k_0 as 2 to start the inversion for vs.)

  • k_end (int) – Index of th first parameter to invert (considering a b_m0 with three parameters (vp, vs, rho), if we can set k_end as 2 to doesn’t invert rho.)

Returns:

  • m (dict) – A dictionary containing the result of FWI and TL-FWI

  • rms (adarray) – rms error