cphot 0.1
A C++ tool for computing photometry from spectra.
unit module

This module defines usual units and convenient ways to convert between them. More...

Classes

class  RQuantity< MassDim, LengthDim, TimeDim, AngleDim, CurrentDim, LumDim, SubDim, TempDim >
 prototype template container class, that just holds a double value. More...
 

Detailed Description

This module defines usual units and convenient ways to convert between them.

a Quantity is defined as a double with a Unit attached. A unit combines the following 8 dimensions to some powers:

  1. MassDim mass
  2. LengthDim length
  3. TimeDim time
  4. AngleDim angular
  5. CurrentDim current (electric)
  6. LumDim luninosity
  7. SubDim Substance (chemical)
  8. TempDim temperature

for example,

Below are listed the base definitions:

We predefined units as constexpr which are optimized at compilation time.

Note
All units only apply to double values. (eventually will extend to vectors etc)