Package qubx :: Module fit :: Class BaseCurve
[hide private]
[frames] | no frames]

Class BaseCurve

source code

object --+
         |
        BaseCurve
Known Subclasses:

Defines the interface of a curve object; curves need not subclass, but they must behave like it. Including optional first constructor argument "expr"

Instance Methods [hide private]
 
__init__(self, expr='0.0', locals={})
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
eval(self, param_vals, xx, vvv=[])
Returns yy = f[param_vals](xx, *vvv).
source code
 
set_vars(self, var_names)
Prepares the curve to eval() with extra named data series.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  can_fit
list of bool: True to include this param in fitting
  can_resample
True unless resampling for display is a bad idea
  expr
str visible to user, hopefully python-evaluable
  hi
list of parameter maximum values, or UNSET_VALUE
  lo
list of parameter minimum values, or UNSET_VALUE
  name
index (string) in Curves
  param_defaults
list of parameter default values, or empty list
  params
list of parameter names
  pool
multiprocessing.pool or None, possibly assigned by controlling thread
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, expr='0.0', locals={})
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • expr - optional string to further specify curve
  • locals - optional dict of names available in expr
Overrides: object.__init__

eval(self, param_vals, xx, vvv=[])

source code 

Returns yy = f[param_vals](xx, *vvv). For vvv, you should previously have set_vars(v_names).

Parameters:
  • param_vals - list of float, corresponding to self.params
  • xx - numpy.array of x values
  • vvv - variable series corresponding to set_vars; list of numpy.array
Returns:
numpy.array of y values

set_vars(self, var_names)

source code 

Prepares the curve to eval() with extra named data series.

Parameters:
  • var_names - list of str; named vars available for eqn, corresponding to vvv