util

Utility functions.

pleasant.util.get_spectral_diffusion_rates(_df, verbose=False)

Compute time-normalized spectral jumps of the fitted resonance frequency.

They make up the single data points of what is referred here as the spectral diffusion rate. Can only be determined if two consecutive scans have a fit. Back- and forward scans (retrace and trace) are treated separately, i.e. the jump from one forward (backward) to the next forward (backward) scan is computed.

Parameters:
  • _df (DataFrame) – data frame containing scan fit results in the format as retrieved from a Measurement object

  • verbose (bool) – print statistics

Return type:

ndarray

Returns:

two-column array of time-normalized spectral jumps (value and error)

pleasant.util.inv_variance_weighting(a)

Calculate inverse variance weighted average and standard deviation.

Parameters:

a (ndarray) – two-column array containing values in the first and errors in the second column

Return type:

tuple[float, float]

Returns:

average value, standard deviation