welltest_pta.deconvolve

welltest_pta.deconvolve(events, rate_history=None, default_q=None, nu=1e-2, n_response_nodes=60, t_response_min=1e-3, t_response_max=None, p_initial=None, fit_p_initial=True, max_iter=200, verbose=False)[source]

Recover the unit-rate constant-rate response from multi-rate data.

Implements the encoded vSH04 formulation. Suitable for merging two or more buildups/drawdowns into a single equivalent buildup whose log–log derivative is the diagnostic “master plot” of the entire test.

Parameters:
  • events – Iterable of Event (or EventCollection). Both drawdowns and buildups are used. Each event must carry rate information (ev.rate in STB/D — or set default_q).

  • rate_history (DataFrame | dict | None) – Optional pre-built rate history. DataFrame with columns t_hr, q (rate at each step). If None, derived from events.

  • default_q (Optional[float]) – Fallback flow rate (STB/D) for drawdowns without an explicit ev.rate. Buildups always get q=0.

  • nu (float) – Regularisation weight for curvature of \(z\). Larger ⇒ smoother response (more bias). Smaller ⇒ noisier (more variance). Typical \(10^{-3}\) (low noise) to \(10^{-1}\) (high noise).

  • n_response_nodes (int) – Number of log-spaced nodes on the recovered response grid.

  • t_response_min (float) – Time range (hr) of the recovered response. t_response_max defaults to the maximum observation time.

  • t_response_max (Optional[float]) – Time range (hr) of the recovered response. t_response_max defaults to the maximum observation time.

  • p_initial (Optional[float]) – Initial reservoir pressure (psi). If None and fit_p_initial=True, it is solved as an additional unknown.

  • fit_p_initial (bool) – Whether to recover \(p_i\) simultaneously with \(z\).

  • max_iter (int) – Maximum solver iterations (Levenberg–Marquardt).

  • verbose (bool) – Print solver progress.

Return type:

DeconvolutionResult

Notes

For best results: include both a long buildup and the immediately preceding drawdown; clean buildup tails (V8.1 detector does this); use consistent rate units throughout (typically STB/D).