unitconvert#
- torchspin.unitconvert(value, units, g=GFREE)[source]#
Convert EPR-relevant energy/field quantities between units.
Supported units:
cm^-1,eV,K,mT,MHz. Use the form'unit_a->unit_b'.- Parameters:
- Returns:
out (ndarray) – Converted value(s) in the target unit.
- Return type:
np.ndarray
Examples
>>> unitconvert(1.0, 'cm^-1->MHz') # 29979.2458 MHz >>> unitconvert(340.0, 'mT->MHz', g=2.0) # ≈ 9520 MHz