cphot 0.1
A C++ tool for computing photometry from spectra.
|
|
Go to the documentation of this file.
15 #include <xtensor/xadapt.hpp>
16 #include <xtensor/xarray.hpp>
21 using DMatrix = xt::xarray<double, xt::layout_type::row_major>;
39 const std::vector<double>&
flux,
62 this->wavelength_nm = xt_wave;
63 this->flux_flam = xt_flux;
91 const std::vector<double>&
flux,
95 std::vector<std::size_t> shape = {
wavelength.size() };
113 const auto & wave = vega.
get<
double>(
"WAVELENGTH");
114 const auto &
flux = vega.
get<
double>(
"FLUX");
128 return this->wavelength_nm;
138 return this->wavelength_nm *
nm.to(in);
147 return this->flux_flam;
157 return this->flux_flam *
flam.to(in);
const std::vector< double > wavelength_nm
Vega vega_from_votable(const std::string &infile)
Construct a new Vega object from a votable.
const std::vector< double > wavelength
const std::vector< double > flux
Class defining a very simple parser of XML VOTable.
const QSpectralFluxDensity flux_unit
xt::xarray< double, xt::layout_type::row_major > DMatrix
DMatrix get_flux()
Get the internal flux in flam.
QSpectralFluxDensity parse_spectralflux(const std::string &str)
find length units from a string
DMatrix get_wavelength()
Get the internal wavelength in nm.
Interface to Vega reference data.
const std::vector< double > flux_flam
Vega()
Construct a new Vega object from hardcoded data.
const QLength wavelength_unit
constexpr QSpectralFluxDensity flam
QLength parse_length(const std::string &str)
find length units from a string
VOField< T > get(std::string field_name)
Retrieve field data.