BGlib.gmode.analysis.giv_bayesian.GIVBayesian

class BGlib.gmode.analysis.giv_bayesian.GIVBayesian(h5_main, ex_freq, gain, num_x_steps=250, r_extra=110, **kwargs)[source]

Bases: Process

A class that performs Bayesian inference to decouple spurious hysteresis signals from current-voltage spectroscopy signals in General mode I-V data

Applies Bayesian Inference to General Mode IV (G-IV) data to extract the true current

Parameters:
  • h5_main (h5py.Dataset object) – Dataset to process

  • ex_freq (float) – Frequency of the excitation waveform

  • gain (uint) – Gain setting on current amplifier (typically 7-9)

  • num_x_steps (uint (Optional, default = 250)) – Number of steps for the inferred results. Note: this may be end up being slightly different from specified.

  • r_extra (float (Optional, default = 110 [Ohms])) – Extra resistance in the RC circuit that will provide correct current and resistance values

  • h5_target_group (h5py.Group, optional. Default = None) – Location where to look for existing results and to place newly computed results. Use this kwarg if the results need to be written to a different HDF5 file. By default, this value is set to the parent group containing h5_main

  • kwargs (dict) – Other parameters specific to the Process class and nuanced bayesian_inference parameters

Methods

compute

Creates placeholders for the results, applies the inference to the data, and writes the output to the file.

test

Tests the inference on a single pixel (randomly chosen unless manually specified) worth of data.

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)[source]

Creates placeholders for the results, applies the inference to the data, and writes the output to the file. Consider calling test() before this function to make sure that the parameters are appropriate.

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) – Not used

  • kwargs (dictionary) – Not used

Returns:

h5_results_grp – Datagroup containing all the results

Return type:

h5py.Datagroup object

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(pix_ind=None, show_plots=True)[source]

Tests the inference on a single pixel (randomly chosen unless manually specified) worth of data.

Parameters:
  • pix_ind (int, optional. default = random) – Index of the pixel whose data will be used for inference

  • show_plots (bool, optional. default = True) – Whether or not to show plots

Return type:

fig, axes

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