mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::astro::basicSpectrum< _units > Struct Template Reference

template<typename _units>
struct mx::astro::basicSpectrum< _units >

A basic spectrum.

Definition at line 24 of file astroSpectra.hpp.

#include <astro/astroSpectra.hpp>

Public Types

typedef std::string paramsT
 The parameter is a string name. More...
 

Static Public Member Functions

static std::string fileName (const paramsT &name)
 This function should calculate the file name (without the path) for the spectrum parameters. More...
 
static int readSpectrum (std::vector< realT > &rawLambda, std::vector< realT > &rawSpectrum, const std::string &path, const paramsT &params)
 This function reads the spectrum, returning its raw wavelength and spectrum points. More...
 

Static Public Attributes

static constexpr realT wavelengthUnits = static_cast<realT>(1)
 Specify how to convert to SI wavelength units. No conversions are performed in the basic spectrum. More...
 
static constexpr realT fluxUnits = static_cast<realT>(1)
 Specify how to convert to SI flux units. No conversions are performed in the basic spectrum. More...
 
static constexpr const char * dataDirEnvVar = 0
 The data directory environment variable name. More...
 

Member Typedef Documentation

◆ paramsT

template<typename _units >
typedef std::string mx::astro::basicSpectrum< _units >::paramsT

The parameter is a string name.

Definition at line 31 of file astroSpectra.hpp.

Member Function Documentation

◆ fileName()

template<typename _units >
static std::string mx::astro::basicSpectrum< _units >::fileName ( const paramsT name)
inlinestatic

This function should calculate the file name (without the path) for the spectrum parameters.

Parameters
[in]nameThe parameters of the spectrum, in this case just its file name.

Definition at line 43 of file astroSpectra.hpp.

◆ readSpectrum()

template<typename _units >
static int mx::astro::basicSpectrum< _units >::readSpectrum ( std::vector< realT > &  rawLambda,
std::vector< realT > &  rawSpectrum,
const std::string &  path,
const paramsT params 
)
inlinestatic

This function reads the spectrum, returning its raw wavelength and spectrum points.

No unit conversions or interpolations should take place.

Parameters
[out]rawLambdathe raw wavelength vector. This should be an empty vector on input.
[out]rawSpectrumthe raw spectrum. This should be an empty vector on input.
[in]paththe full path to the file.
[in]paramsthe parameters are passed in case needed to construct the spectrum

Definition at line 51 of file astroSpectra.hpp.

References mx::ioutils::readColumns().

Member Data Documentation

◆ dataDirEnvVar

template<typename _units >
constexpr const char* mx::astro::basicSpectrum< _units >::dataDirEnvVar = 0
staticconstexpr

The data directory environment variable name.

Definition at line 40 of file astroSpectra.hpp.

◆ fluxUnits

template<typename _units >
constexpr realT mx::astro::basicSpectrum< _units >::fluxUnits = static_cast<realT>(1)
staticconstexpr

Specify how to convert to SI flux units. No conversions are performed in the basic spectrum.

Definition at line 37 of file astroSpectra.hpp.

◆ wavelengthUnits

template<typename _units >
constexpr realT mx::astro::basicSpectrum< _units >::wavelengthUnits = static_cast<realT>(1)
staticconstexpr

Specify how to convert to SI wavelength units. No conversions are performed in the basic spectrum.

Definition at line 34 of file astroSpectra.hpp.


The documentation for this struct was generated from the following file: