welltestpy.tools

welltestpy subpackage providing miscellaneous tools.

Included functions

The following functions are provided for point triangulation

triangulate(distances, prec[, all_pos]) Triangulate points by given distances.
sym(A) Get the symmetrized version of a lower or upper triangle-matrix A.

The following plotting routines are provided

campaign_plot(campaign[, select_test, fig, …]) Plot an overview of the tests within the campaign.
fadeline(ax, x, y[, label, color, steps]) Fading line for matplotlib.
plot_well_pos(well_const[, names, title, …]) Plot all well constellations and label the points with the names.
campaign_well_plot(campaign[, plot_tests, …]) Plot of the well constellation within the campaign.
plotfit_transient(setup, data, para, rad, …) Plot of transient estimation fitting.
plotfit_steady(setup, data, para, rad, …) Plot of steady estimation fitting.
plotparainteract(result, paranames[, …]) Plot of parameter interaction.
plotparatrace(result[, parameternames, …]) Plot of parameter trace.
plotsensitivity(paralabels, sensitivities[, …]) Plot of sensitivity results.
triangulate(distances, prec, all_pos=False)[source]

Triangulate points by given distances.

try to triangulate points by given distances within a symmetric matrix ‘distances’ with distances[i,j] = |pi-pj|

thereby p0 will be set to the origin (0,0) and p1 to (|p0-p1|,0)

Parameters:
  • distances (numpy.ndarray) –

    Given distances among the point to be triangulated. It hat to be a symmetric matrix with a vanishing diagonal and

    distances[i,j] = |pi-pj|

    If a distance is unknown, you can set it to -1.

  • prec (float) – Given Precision to be used within the algorithm. This can be used to smooth away messure errors
  • all_pos (bool, optional) – If True all possible constellations will be calculated. Otherwise, the first possibility will be returned. Default: False
sym(A)[source]

Get the symmetrized version of a lower or upper triangle-matrix A.

campaign_plot(campaign, select_test=None, fig=None, style='WTP', **kwargs)[source]

Plot an overview of the tests within the campaign.

Parameters:
  • campaign (Campaign) – The campaign to be plotted.
  • select_test (dict, optional) – The selected tests to be added to the plot. The default is None.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
  • **kwargs (TYPE) – Keyword arguments forwarded to the tests plotting routines.
Returns:

fig – The created matplotlib figure.

Return type:

Figure

fadeline(ax, x, y, label=None, color=None, steps=20, **kwargs)[source]

Fading line for matplotlib.

This is a workaround to produce a fading line.

Parameters:
  • ax (axis) – Axis to plot on.
  • x (list) – start and end value of x components of the line
  • y (list) – start and end value of y components of the line
  • label (str, optional) – label for the legend. Default: None
  • color (MPL color, optional) – color of the line Default: None
  • steps (int, optional) – steps of fading Default: 20
  • **kwargs – keyword arguments that are forwarded to plt.plot
plot_well_pos(well_const, names=None, title='', filename=None, plot_well_names=True, ticks_set='auto', fig=None, style='WTP')[source]

Plot all well constellations and label the points with the names.

Parameters:
  • well_const (list) – List of well constellations.
  • names (list of str, optional) – Names for the wells. The default is None.
  • title (str, optional) – Plot title. The default is “”.
  • filename (str, optional) – Filename if the result should be saved. The default is None.
  • plot_well_names (bool, optional) – Whether to plot the well-names. The default is True.
  • ticks_set (int or str, optional) – Tick spacing in the plot. The default is “auto”.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
Returns:

fig – The created matplotlib figure.

Return type:

Figure

campaign_well_plot(campaign, plot_tests=True, plot_well_names=True, fig=None, style='WTP')[source]

Plot of the well constellation within the campaign.

Parameters:
  • campaign (Campaign) – The campaign to be plotted.
  • plot_tests (bool, optional) – DESCRIPTION. The default is True.
  • plot_well_names (TYPE, optional) – DESCRIPTION. The default is True.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
Returns:

ax – The created matplotlib axes.

Return type:

Axes

plotfit_transient(setup, data, para, rad, time, radnames, extra, plotname=None, fig=None, ax=None, style='WTP')[source]

Plot of transient estimation fitting.

plotfit_steady(setup, data, para, rad, radnames, extra, plotname=None, ax_ins=True, fig=None, ax=None, style='WTP')[source]

Plot of steady estimation fitting.

plotparainteract(result, paranames, plotname=None, fig=None, style='WTP')[source]

Plot of parameter interaction.

plotparatrace(result, parameternames=None, parameterlabels=None, xticks=None, stdvalues=None, plotname=None, fig=None, style='WTP')[source]

Plot of parameter trace.

plotsensitivity(paralabels, sensitivities, plotname=None, fig=None, ax=None, style='WTP')[source]

Plot of sensitivity results.