Gaussian units
Function to convert back and forth between SI and Gaussian units. The constants \(4 \pi \epsilon_0\) is equal to 1.
- unitconvert.gaussian.factorGaussian(q)
Find the conversion factor that is used to convert the given quantity q to and from CGS Gaussian units and SI units
- Args :
q (astropy quantity) : the quantity for which unit conversion must be done
- Returns :
(dictionary) : the conversion factor in terms of \(4\pi\epsilon_0\)
- Example :
>>> from unitconvert.gaussian import factorGaussian >>> from astropy import units as u >>> factorGaussian(1*u.A) {'4 pi eps0' : 0.5 }
- unitconvert.gaussian.fromGaussian(q, finalUnits)
Convert the given astropy quantity q in gaussian units to SI units
- Args :
q (astropy quantity) : the quantity which needs to be converted
finalUnits (astropy quantity) : the base units to which quantity needs to be converted back.
- Returns :
(astropy quantity) : the input quantity q in SI units
- Example :
>>> from unitconvert.gaussian import fromGaussian >>> from astropy import units as u >>> fromGaussian(2.99792458e9 * u.Fr / u.s) <Quantity 1. A>
- unitconvert.gaussian.toGaussian(q)
Convert the given astropy quantity q in SI units to Gaussian units
- Args :
q (astropy quantity) : the quantity which needs to be converted
- Returns :
(astropy quantity) : the input quantity q in gaussian units
- Example :
>>> from unitconvert.gaussian import toGaussian >>> from astropy import units as u >>> toGaussian(1*u.A) <Quantity 2.99792458e+09 Fr / s>