Closed stestoll closed 1 year ago
One idea is to introduce a more general unit conversion function unitconvert
:
unitconvert(1e-4,'cm^-1->K')
unitconvert(1e-4,'cm^-1->MHz')
unitconvert(350,'mT->MHz')
unitconvert(350,'mT->MHz',2.1)
unitconvert(350,'mT->MHz','1H')
unitconvert(3500,'G->mT')
unitconvert(350,'mT->MHz')
mt2mhz(350)
unitconvert(350,'mT->MHz')
mt2mhz(350,2.1)
unitconvert(350,'mT->MHz',2.1)
The unit string should probably be interpreted in a case-insensitive manner, i.e. mT->MHz
and mt->mhz
should both be understood.
Note that Matlab has a unitconv
function as well as a unitConvert
function (Symbolic Math toolbox).
larmorfrq
should be kept separate, since it's such a fundamental notion in magnetic resonance.
Implemented by https://github.com/StollLab/EasySpin/pull/294
The names of these two functions are based on units rather than the associated quantities and therefore not ideally named.
field2freq
andfreq2field
would be better.Also, there is a bit of overlap (or a chance for a merger?) between
field2freq
andlarmorfrq
.eprconvert
is related.