cphot 0.1
A C++ tool for computing photometry from spectra.
|
|
Go to the documentation of this file.
25 std::string filter_name = std::regex_replace(
26 vot.
params[
"filterID"].value,
31 std::string detector_type = (parseString<int>(vot.
params[
"DetectorType"].value) == 0) ?
35 const std::vector<std::string> AA_str {
"Angstrom",
"AA",
"angstrom"};
36 const std::vector<std::string> nm_str {
"Nanometer",
"nanometer",
"nm"};
37 const auto & wave = vot.
get<
double>(
"Wavelength");
43 const auto & transmit = vot.
get<
double>(
"Transmission");
46 std::vector<std::size_t> shape = { wave.data.size() };
47 DMatrix xt_wave = xt::adapt(wave.data, shape);
48 DMatrix xt_transmit = xt::adapt(transmit.data, shape);
50 return Filter(xt_wave, xt_transmit,
80 cpr::Response r = cpr::Get(cpr::Url{
"http://svo2.cab.inta-csic.es/theory/fps/fps.php"},
81 cpr::Parameters{{
"ID",
id}});
98 const std::string pyphot_url =
"https://raw.githubusercontent.com/mfouesneau/pyphot/master/pyphot/libs/new_filters.hd5";
99 cpr::Response r = cpr::Get(cpr::Url{pyphot_url});
100 std::ofstream libout(where);
bool contains(const std::vector< std::string > &v, const std::string &other)
Check if a vector contains an item.
Class defining a very simple parser of XML VOTable.
xt::xarray< double, xt::layout_type::row_major > DMatrix
Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation.
constexpr QLength angstrom
std::string download_pyphot_hdf5library(const std::string &where="./pyphot_library.hdf5")
Download the filter library from pyphot repository.
Filter download_svo_filter(const std::string &id)
main interface to SVO data requests
Filter get_filter(votable::VOTable &vot)
Get the filter object from VOTable object.
const QLength wavelength_unit
std::map< std::string, Param > params
Table parameters.
void from_content(const std::string &content)
Constructor.
VOField< T > get(std::string field_name)
Retrieve field data.