cphot 0.1
A C++ tool for computing photometry from spectra.
cphot_dev.cpp
Go to the documentation of this file.
1 /**
2  * @file cphot_dev.cpp
3  * @brief developping cphot
4  * @version 0.1
5  *
6  */
7 #include <iostream>
8 #include <cphot/io.hpp>
9 #include <cphot/rquantities.hpp>
10 #include <cphot/votable.hpp>
11 #include <cphot/vega.hpp>
12 #include <cphot/sun.hpp>
13 #include <cphot/licks.hpp>
14 
15 
16 
17 int main(){
18  // std::string filter_id = "2MASS/2MASS.H";
19  std::string filter_id = "Gaia/Gaia3.G";
20  cphot::Filter filt = cphot::download_svo_filter(filter_id);
21  filt.info();
22 
26  nm, flam);
27 
28  double flux_flam_v2 = filt.get_flux(v2.get_wavelength(nm), v2.get_flux(flam), nm, flam).to(flam);
29  std::cout << "Vega zero points for filter: " << filter_id << "\n"
30  << flux_flam_v2 << " flam\n"
31  << -2.5 * std::log10(flux_flam_v2) << " mag\n"
32  << -2.5 * std::log10(flux_flam_v2) - filt.get_Vega_zero_mag() << " vega mag\n";
33 
34  auto s = cphot::Sun();
35  std::cout << s.get_wavelength(angstrom) << " angstrom\n"
36  << s.get_flux() << " flam\n";
37 
38  s = cphot::Sun(10 * parsec);
39  std::cout << s.get_wavelength(angstrom) << " angstrom\n"
40  << s.get_flux(flam) << " flam\n";
41 
43  std::cout << lib.get_content() << "\n";
44 
45 }
cphot_vega::wavelength_nm
const std::vector< double > wavelength_nm
Definition: vega_data.hpp:14
licks.hpp
rquantities.hpp
cphot::Filter::get_flux
QSpectralFluxDensity get_flux(const DMatrix &wavelength, const DMatrix &flux, const QLength &wavelength_unit, const QSpectralFluxDensity &flux_unit)
Integrate the flux within the filter and return the integrated energy/flux.
Definition: filter.hpp:402
cphot::Vega::get_flux
DMatrix get_flux()
Get the internal flux in flam.
Definition: vega.hpp:146
cphot::Filter::get_Vega_zero_mag
double get_Vega_zero_mag()
Vega magnitude zero point.
Definition: filter.hpp:345
io.hpp
cphot::Filter
Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation.
Definition: filter.hpp:43
parsec
constexpr QLength parsec
Definition: rquantities.hpp:347
cphot::LickLibrary::get_content
std::vector< std::string > get_content()
returns the list of lick indices registered
Definition: licks.hpp:280
cphot::Vega::get_wavelength
DMatrix get_wavelength()
Get the internal wavelength in nm.
Definition: vega.hpp:127
cphot::Filter::info
void info()
Display some information on cout.
Definition: filter.hpp:467
angstrom
constexpr QLength angstrom
Definition: rquantities.hpp:274
cphot::Vega
Interface to Vega reference data.
Definition: vega.hpp:32
cphot::download_svo_filter
Filter download_svo_filter(const std::string &id)
main interface to SVO data requests
Definition: io.hpp:79
vega.hpp
cphot_vega::flux_flam
const std::vector< double > flux_flam
Definition: vega_data.hpp:16
cphot::Sun
Class that handles the Sun's spectrum and references.
Definition: sun.hpp:43
cphot::LickLibrary
Collection of Lick indices.
Definition: licks.hpp:249
nm
constexpr QLength nm
Definition: rquantities.hpp:273
flam
constexpr QSpectralFluxDensity flam
Definition: rquantities.hpp:361
sun.hpp
votable.hpp
main
int main()
Definition: cphot_dev.cpp:17