ttim.fit#

Classes#

Module Contents#

class ttim.fit.Calibrate(model)[source]#
model#
parameters#
seriesdict#
seriesinwelldict#
set_parameter(name=None, layers=None, initial=0, pmin=-np.inf, pmax=np.inf, inhoms=None)[source]#

Set parameter to be optimized.

Parameters:
  • name (str) – name can be ‘kaq’, ‘Saq’, ‘c’, ‘Sll’ or ‘kzoverkh’.

  • layers (int or list of ints) – layer number(s) for which the parameter is set. If an integer is passed, parameter is associated with a single layer. If a list of layers is passed, layers must be consecutive and parameter is set for each layer from min(layers) up to and including max(layers).

  • initial (float, optional) – initial value for the parameter (the default is 0)

  • pmin (float, optional) – lower bound for parameter value (the default is -np.inf)

  • pmax (float, optional) – upper bound for paramater value (the default is np.inf)

  • inhoms (str, list) – string with name of inhomogeneity, list with string names of inhomogeneities or list of inhomogeneities inhomogeneity(ies) for which the parameter is set. If a string is passed, parameter is associated with a single inhomogeneity. If a list of strings of inhomogeneities (or list of inhomogeneities) is passed, parameter is set for each inhomogeneity in the list. This allows linking of parameters across inhomogeneities.

set_parameter_by_reference(name=None, parameter=None, initial=0, pmin=-np.inf, pmax=np.inf)[source]#

Set parameter to be optimized.

Parameters:
  • name (str) – parameter name

  • parameter (np.array) – array reference containing the parameter to be optimized. must be specified as reference, i.e. w.rc[0:]

  • initial (float, optional) – initial value for the parameter (the default is 0)

  • pmin (float, optional) – lower bound for parameter value (the default is -np.inf)

  • pmax (float, optional) – upper bound for paramater value (the default is np.inf)

series(name, x, y, layer, t, h, weights=None)[source]#

Method to add observations to Calibration object.

Parameters:
  • name (str) – name of series

  • x (float) – x-coordinate

  • y (float) – y-coordinate

  • layer (int) – layer number, 0-indexed

  • t (np.array) – array containing timestamps of timeseries

  • h (np.array) – array containing timeseries values, i.e. head observations

seriesinwell(name, element, t, h)[source]#

Method to add observations to Calibration object.

Parameters:
  • name (str) – name of series

  • element (element object with headinside function)

  • t (np.array) – array containing timestamps of timeseries

  • h (np.array) – array containing timeseries values, i.e. head observations

residuals(p, printdot=False, weighted=True, layers=None, series=None)[source]#

Method to calculate residuals given certain parameters.

Parameters:
  • p (np.array) – array containing parameter values

  • printdot (bool, optional) – print dot for each function call

Returns:

array containing all residuals

Return type:

np.array

residuals_lmfit(lmfitparams, printdot=False)[source]#
fit_least_squares(report=True, diff_step=0.0001, xtol=1e-08, method='lm')[source]#
fit_lmfit(report=False, printdot=True, **kwargs)[source]#
residuals_leastsq(logparams, printdot=False)[source]#
fit_leastsq(report=True, diff_step=0.0001, xtol=1e-08)[source]#
fit(report=False, printdot=True, **kwargs)[source]#
rmse(weighted=True, layers=None)[source]#

Calculate root-mean-squared-error.

Returns:

return rmse value

Return type:

float

topview(ax=None, layers=None, labels=True)[source]#

Plot topview of model with calibration points.

Parameters:

ax (matplotlib.axes.Axes, optional) – axes to plot on (the default is None, which creates a new figure)

xsection(ax=None, labels=True)[source]#

Plot cross-section of model with calibration points.

Parameters:

ax (matplotlib.axes.Axes, optional) – axes to plot on (the default is None, which creates a new figure)

class ttim.fit.Series(x, y, layer, t, h, weights=None)[source]#
x#
y#
layer#
t#
h#
weights = None#
class ttim.fit.SeriesInWell(element, t, h)[source]#
element#
t#
h#