paramagpy.fit.svd_calc_metal_from_pcs_offset

paramagpy.fit.svd_calc_metal_from_pcs_offset(pos, pcs, idx, errors)[source]

Solve PCS equation by single value decomposition with offset. An offset arising from referencing errors between diamagnetic and paramagnetic datasets can be accounted for using this method. This function is generally called by higher methods like <svd_gridsearch_fit_metal_from_pcs>

NOTE: the factor of 1E26 is required for floating point error mitigation

Parameters
  • pos (array of [x,y,z] floats) – the atomic positions in meters

  • pcs (array of floats) – the PCS values in ppm. Note these should be weighted by the experimental uncertainties.

  • idx (array of ints) – an index assigned to each atom. Common indices determine summation between models for ensemble averaging.

  • errors (array of floats) – the standard deviation representing experimental uncertainty in the measured value

Returns

  • calc (array of floats) – the calculated PCS values from the fitted tensor

  • sol (array of floats) – solution to the linearised PCS equation and consists of the tensor 5 matrix elements and offset values