estimate_parameters#

torchspin.estimate_parameters(B, spc, mwFreq, nSpecies=1, prominence=0.1)[source]#

Automatically estimate initial parameters from EPR spectrum.

This function analyzes a derivative EPR spectrum to extract: - g-values from peak positions - Linewidths from peak widths - Suggested field range for simulation

Parameters:
  • B (ndarray) – Magnetic field axis (mT)

  • spc (ndarray) – Spectrum intensity (derivative)

  • mwFreq (float) – Microwave frequency (GHz)

  • nSpecies (int, optional) – Expected number of species (default: 1)

  • prominence (float, optional) – Minimum peak prominence as fraction of max signal (default: 0.1)

Returns:

params (dict) – Dictionary containing: - ‘g’: Estimated g-tensor (sorted high to low) - ‘lwpp’: Estimated linewidth [Gaussian, Lorentzian] in mT - ‘Range’: Suggested field range [min, max] in mT - ‘CenterSweep’: Suggested [center, sweep] in mT - ‘giso’: Isotropic g-value - ‘peaks’: Dictionary with peak analysis details

Return type:

Dict

Examples

>>> B, spc, params = eprload('mydata.DTA')
>>> B = B / 10.0  # Convert Gauss to mT
>>> est = estimate_parameters(B, spc, params['MWFQ']/1e9)
>>> print(f"Estimated g: {est['g']}")
>>> print(f"Estimated linewidth: {est['lwpp']} mT")

Notes

  • Works best for well-resolved derivative spectra

  • For overlapping lines, may underestimate number of features

  • Linewidth estimates assume Gaussian broadening