corrct.physics.units
Units and conversion.
Module Contents
Classes
Conversion factors between orders of magnitude of the metric units. |
|
Conversion factors between orders of magnitude of the energy units. |
Functions
Convert from energy to wavelength. |
|
Convert wavelength to energy. |
API
- class corrct.physics.units.ConversionMetric[source]
Conversion factors between orders of magnitude of the metric units.
- str_to_order
None
- order_to_str
None
- class corrct.physics.units.ConversionEnergy[source]
Conversion factors between orders of magnitude of the energy units.
- str_to_order
None
- order_to_str
None
- corrct.physics.units.energy_to_wlength(energy: Union[float, numpy.typing.NDArray], unit_wl: str = 'm', unit_en: str = 'keV') Union[float, numpy.typing.NDArray] [source]
Convert from energy to wavelength.
Parameters
energy : float | NDArray The energy unit_wl : str, optional The chosen unit for the output wavelength. The default is “m” unit_en : str, optional The chosen unit for the input energy. The default is “keV”
Returns
float | NDArray The wavelength in the chosen unit
- corrct.physics.units.wlength_to_energy(w_length: Union[float, numpy.typing.NDArray], unit_wl: str = 'm', unit_en: str = 'keV') Union[float, numpy.typing.NDArray] [source]
Convert wavelength to energy.
Parameters
w_length : float | NDArray The wavelength in the chosen unit unit : str, optional The chosen unit for the input wavelength. The default is “m” unit_en : str, optional The chosen unit for the output energy. The default is “keV”
Returns
float | NDArray The energy in the chosen unit