BGlib.be.analysis.be_relax_fit.BERelaxFit

class BGlib.be.analysis.be_relax_fit.BERelaxFit(h5_main, variables=None, fit_method='Exponential', sens=1, phase_off=0, starts_with='write', **kwargs)[source]

Bases: Process

This instantiation reads and calculates parameters in the data file necessary for reading, writing, analyzing, and visualizing the data. It writes these parameters to attributes to be referenced.

Parameters:
  • h5_main – h5py.Dataset object from pycroscopy.analysis.BESHOfitter

  • variables – list(string), Default [‘Frequency’]

Lists of attributes that h5_main should possess so that it may be analyzed by Model. :param fit_method: fit_method for berelaxfit fit, can be ‘Exponential’, ‘Double_Exp’, ‘Str_Exp’ or ‘Logistic’ :param sens: tip sensitivity in pm/V. Default: 1, the data are not scaled :param phase_off: to apply to phase data. Default: 0, the data are not offset. :param starts_with: ‘write’ or ‘read’ , depending on whether the first step is a read or write step. Default: ‘write’

**Currently, the BE software does not consistently encode whether spectra start with a read or write step

Methods

compute

Creates placeholders for the results, applies the _unit_computation() to chunks of the dataset

test

This function manipulates the data within one pixel as defined by _map_function.

use_partial_computation

Extracts the necessary parameters from the provided h5 group to resume computation

Attributes

parms_dict

The name of the HDF5 dataset that should be present to signify which positions have already been computed This is NOT a fully private variable so that multiple processes can be run within a single group - Eg Fitter In the case of Fitter - this name can be changed from 'completed_guesses' to 'completed_fits' check_for_duplicates will be called by the Child class where they have the opportunity to change this variable before checking for duplicates

compute(override=False, *args, **kwargs)

Creates placeholders for the results, applies the _unit_computation() to chunks of the dataset

Parameters:
  • override (bool, optional. default = False) – By default, compute will simply return duplicate results to avoid recomputing or resume computation on a group with partial results. Set to True to force fresh computation.

  • args (list) – arguments to the mapped function in the correct order

  • kwargs (dict) – keyword arguments to the mapped function

Returns:

h5_results_grp – Group containing all the results

Return type:

h5py.Group

parms_dict

The name of the HDF5 dataset that should be present to signify which positions have already been computed This is NOT a fully private variable so that multiple processes can be run within a single group - Eg Fitter In the case of Fitter - this name can be changed from ‘completed_guesses’ to ‘completed_fits’ check_for_duplicates will be called by the Child class where they have the opportunity to change this variable before checking for duplicates

test(pixel_ind)[source]

This function manipulates the data within one pixel as defined by _map_function. :param pixel_ind: pixel index of the data we wish to test :return: array from fit of data to self.fit_method

use_partial_computation(h5_partial_group=None)

Extracts the necessary parameters from the provided h5 group to resume computation

Parameters:

h5_partial_group (h5py.Group) – Group containing partially computed results