ttim.fit ======== .. py:module:: ttim.fit Classes ------- .. autoapisummary:: ttim.fit.Calibrate ttim.fit.Series ttim.fit.SeriesInWell Module Contents --------------- .. py:class:: Calibrate(model) .. py:attribute:: model .. py:attribute:: parameters .. py:attribute:: seriesdict .. py:attribute:: seriesinwelldict .. py:method:: set_parameter(name=None, layers=None, initial=0, pmin=-np.inf, pmax=np.inf, inhoms=None) Set parameter to be optimized. :param name: name can be 'kaq', 'Saq', 'c', 'Sll' or 'kzoverkh'. :type name: str :param layers: 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). :type layers: int or list of ints :param initial: initial value for the parameter (the default is 0) :type initial: float, optional :param pmin: lower bound for parameter value (the default is -np.inf) :type pmin: float, optional :param pmax: upper bound for paramater value (the default is np.inf) :type pmax: float, optional :param inhoms: 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. :type inhoms: str, list .. !! processed by numpydoc !! .. py:method:: set_parameter_by_reference(name=None, parameter=None, initial=0, pmin=-np.inf, pmax=np.inf) Set parameter to be optimized. :param name: parameter name :type name: str :param parameter: array reference containing the parameter to be optimized. must be specified as reference, i.e. w.rc[0:] :type parameter: np.array :param initial: initial value for the parameter (the default is 0) :type initial: float, optional :param pmin: lower bound for parameter value (the default is -np.inf) :type pmin: float, optional :param pmax: upper bound for paramater value (the default is np.inf) :type pmax: float, optional .. !! processed by numpydoc !! .. py:method:: series(name, x, y, layer, t, h, weights=None) Method to add observations to Calibration object. :param name: name of series :type name: str :param x: x-coordinate :type x: float :param y: y-coordinate :type y: float :param layer: layer number, 0-indexed :type layer: int :param t: array containing timestamps of timeseries :type t: np.array :param h: array containing timeseries values, i.e. head observations :type h: np.array .. !! processed by numpydoc !! .. py:method:: seriesinwell(name, element, t, h) Method to add observations to Calibration object. :param name: name of series :type name: str :param element: :type element: element object with headinside function :param t: array containing timestamps of timeseries :type t: np.array :param h: array containing timeseries values, i.e. head observations :type h: np.array .. !! processed by numpydoc !! .. py:method:: residuals(p, printdot=False, weighted=True, layers=None, series=None) Method to calculate residuals given certain parameters. :param p: array containing parameter values :type p: np.array :param printdot: print dot for each function call :type printdot: bool, optional :returns: array containing all residuals :rtype: np.array .. !! processed by numpydoc !! .. py:method:: residuals_lmfit(lmfitparams, printdot=False) .. py:method:: fit_least_squares(report=True, diff_step=0.0001, xtol=1e-08, method='lm') .. py:method:: fit_lmfit(report=False, printdot=True, **kwargs) .. py:method:: residuals_leastsq(logparams, printdot=False) .. py:method:: fit_leastsq(report=True, diff_step=0.0001, xtol=1e-08) .. py:method:: fit(report=False, printdot=True, **kwargs) .. py:method:: rmse(weighted=True, layers=None) Calculate root-mean-squared-error. :returns: return rmse value :rtype: float .. !! processed by numpydoc !! .. py:method:: topview(ax=None, layers=None, labels=True) Plot topview of model with calibration points. :param ax: axes to plot on (the default is None, which creates a new figure) :type ax: matplotlib.axes.Axes, optional .. !! processed by numpydoc !! .. py:method:: xsection(ax=None, labels=True) Plot cross-section of model with calibration points. :param ax: axes to plot on (the default is None, which creates a new figure) :type ax: matplotlib.axes.Axes, optional .. !! processed by numpydoc !! .. py:class:: Series(x, y, layer, t, h, weights=None) .. py:attribute:: x .. py:attribute:: y .. py:attribute:: layer .. py:attribute:: t .. py:attribute:: h .. py:attribute:: weights :value: None .. py:class:: SeriesInWell(element, t, h) .. py:attribute:: element .. py:attribute:: t .. py:attribute:: h