cphot 0.1
A C++ tool for computing photometry from spectra.
units Namespace Reference

Convenient shortcuts. More...

Functions

QLength parse_length (const std::string &str)
 find length units from a string More...
 
QSpectralFluxDensity parse_spectralflux (const std::string &str)
 find length units from a string More...
 

Variables

const std::map< std::string, QLength > length_mapper
 str aliases to length units More...
 
const std::map< std::string, QSpectralFluxDensity > spectralflux_mapper
 str aliases to spectral flux density units More...
 

Detailed Description

Convenient shortcuts.

Function Documentation

◆ parse_length()

QLength units::parse_length ( const std::string &  str)

find length units from a string

Returns
QLength unit

Definition at line 629 of file rquantities.hpp.

◆ parse_spectralflux()

QSpectralFluxDensity units::parse_spectralflux ( const std::string &  str)

find length units from a string

Returns
QLength unit

Definition at line 638 of file rquantities.hpp.

Variable Documentation

◆ length_mapper

const std::map<std::string, QLength> units::length_mapper
Initial value:
{
{"Angstrom", angstrom},
{"AA", angstrom},
{"angstrom", angstrom},
{"Nanometer", nm},
{"nanometer", nm},
{"nm", nm},
{"meter", meter},
{"metre", meter},
{"m", meter},
{"cm", centimetre},
{"centimeter", centimetre},
{"mm", millimetre},
{"millimeter", millimetre},
{"km", kilometre},
{"kilometer", kilometre},
{"micrometer", micrometre},
{"micron", micrometre},
{"um", micrometre},
{"pc", parsec},
{"parsec", parsec}
}

str aliases to length units

Definition at line 588 of file rquantities.hpp.

◆ spectralflux_mapper

const std::map<std::string, QSpectralFluxDensity> units::spectralflux_mapper
Initial value:
{
{"flam", flam},
{"erg/second/centimetre2/angstrom", flam},
{"erg/second/centimetre**2/angstrom", flam},
{"erg/second/centimetre^2/angstrom", flam},
{"Jy", Jy},
{"jansky", Jy},
}

str aliases to spectral flux density units

Definition at line 615 of file rquantities.hpp.

parsec
constexpr QLength parsec
Definition: rquantities.hpp:347
angstrom
constexpr QLength angstrom
Definition: rquantities.hpp:274
millimetre
constexpr QLength millimetre
Definition: rquantities.hpp:269
Jy
constexpr QSpectralFluxDensity Jy
Definition: rquantities.hpp:364
meter
constexpr QLength meter
Definition: rquantities.hpp:266
kilometre
constexpr QLength kilometre
Definition: rquantities.hpp:275
nm
constexpr QLength nm
Definition: rquantities.hpp:273
flam
constexpr QSpectralFluxDensity flam
Definition: rquantities.hpp:361
micrometre
constexpr QLength micrometre
Definition: rquantities.hpp:270
centimetre
constexpr QLength centimetre
Definition: rquantities.hpp:268