Qudi
Public Member Functions | Public Attributes | List of all members
fit_logic.FitLogic Class Reference

UNSTABLE:Jochen Scheuer. More...

Inheritance diagram for fit_logic.FitLogic:
Inheritance graph
[legend]
Collaboration diagram for fit_logic.FitLogic:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, kwargs)
 
def on_activate (self)
 Initialisation performed during activation of the module.
 
def on_deactivate (self)
 
def validate_load_fits (self, fits)
 Take fit names and estimators from a dict and check if they are valid. More...
 
def prepare_save_fits (self, fits)
 Convert fit dictionary into a storable form. More...
 
def load_fits (self, filename)
 Load collection of fits from YAML file. More...
 
def save_fits (self, filename, fits)
 Save a collection of configured fits to YAML file. More...
 
def make_fit_container (self, container_name, dimension)
 Creare a fit container object. More...
 

Public Attributes

 lock
 
 fit_list
 

Detailed Description

UNSTABLE:Jochen Scheuer.

Documentation to add a new fit model/estimator/funciton can be found in documentation/how_to_use_fitting.md or in the online documentation at http://qosvn.physik.uni-ulm.de/qudi-docs/fit_logic.html

This is the fitting class where fit functions are defined and methods are implemented to process the data.

For clarity reasons the fit function are imported from different files seperated by function type, e.g. gaussianlikemethods, sinemethods, generalmethods

Member Function Documentation

◆ load_fits()

def fit_logic.FitLogic.load_fits (   self,
  filename 
)

Load collection of fits from YAML file.

Parameters
filenamestr: path of file containing fits in YAML format
Returns
dict: validated fit dictionary with function references and parameter objects

◆ make_fit_container()

def fit_logic.FitLogic.make_fit_container (   self,
  container_name,
  dimension 
)

Creare a fit container object.

Parameters
container_namestr: user-fiendly name for configurable fit
dimensionstr: dimension of fit input data ('1d', '2d' od '3d')
Returns
FitContainer: fit container object

This is a convenience function so you do not have to mess with an extra import in modules using FitLogic.

◆ on_deactivate()

def fit_logic.FitLogic.on_deactivate (   self)
 

◆ prepare_save_fits()

def fit_logic.FitLogic.prepare_save_fits (   self,
  fits 
)

Convert fit dictionary into a storable form.

Parameters
fitsdict: fit dictionary with function references and parameter objects
Returns
dict: storable fits description dictionary

For the format of this dictionary, ess validate_load_fits.

◆ save_fits()

def fit_logic.FitLogic.save_fits (   self,
  filename,
  fits 
)

Save a collection of configured fits to YAML file.

Parameters
fitsdict: dictionay with fits, function references and parameter objects
Returns
dict: storable dictionary with fit description

◆ validate_load_fits()

def fit_logic.FitLogic.validate_load_fits (   self,
  fits 
)

Take fit names and estimators from a dict and check if they are valid.

Parameters
fitsdict: dictionary conatining fit and estimator description
Returns
dict: checked dictionary with references to fit, model and estimator

The stored dictionary must have the following format. There can be a parameter settings string included at the deepest level.

Example
'1d': 'Two Lorentzian dips': 'fit_function': 'doublelorentzoffset' 'estimator': 'dip'

The returned dictionary has the following format (example): '1d': 'Two Lorentzian dips': 'fit_name': 'doublelorentzoffset' 'est_name': 'dip' 'make_fit': function reference to fit function 'make_model': function reference to model function 'estimator': function reference to estimator function 'parameters': lmfit.parameter.Parameters object


The documentation for this class was generated from the following file: