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

Classes

class  Filter
 Unit Aware Filter. input spectra and output values have units to avoid mis-interpretation. More...
 
struct  filter_t
 Structure of the HDF5 filter record. More...
 
class  HDF5Library
 Storage of filters in HDF5 format. More...
 
class  LickIndex
 Define a Lick Index similarily to a Filter object. More...
 
class  LickLibrary
 Collection of Lick indices. More...
 
class  Sun
 Class that handles the Sun's spectrum and references. More...
 
class  Vega
 Interface to Vega reference data. More...
 

Typedefs

using DMatrix = xt::xarray< double, xt::layout_type::row_major >
 

Functions

std::ostream & operator<< (std::ostream &os, Filter &F)
 Nice representation of Filter objects. More...
 
Filter get_filter (votable::VOTable &vot)
 Get the filter object from VOTable object. More...
 
Filter get_filter (const std::string &vot_filename)
 Get the filter object from a VOTable file. More...
 
Filter download_svo_filter (const std::string &id)
 main interface to SVO data requests More...
 
std::string download_pyphot_hdf5library (const std::string &where="./pyphot_library.hdf5")
 Download the filter library from pyphot repository. More...
 
std::string get_str_attribute (const H5::DataSet &ds, const std::string &attribute_name)
 Get a string attribute from a dataset. More...
 
std::string get_str_attribute (const std::string &filename, const std::string &path, const std::string &attribute_name)
 Get a string attribute from a dataset. More...
 
HighFive::CompoundType create_compound_filter_t ()
 Create a compound filter t object. More...
 
Filter get_filter_from_hdf5_library (const std::string &library_filename, const std::string &filter_name)
 Get the filter from hdf5 library object. More...
 
std::ostream & operator<< (std::ostream &os, HDF5Library &l)
 Nice representation of Filter objects. More...
 
DMatrix reduce_resolution (const DMatrix &w, const DMatrix &flux, double fwhm0, double sigma_floor)
 Adapt the resolution of the spectra to match the lick definitions. More...
 
std::ostream & operator<< (std::ostream &os, LickIndex &index)
 Nice representation of Filter objects. More...
 
std::ostream & operator<< (std::ostream &os, LickLibrary &l)
 Nice representation of LickLibrary. More...
 
Vega vega_from_votable (const std::string &infile)
 Construct a new Vega object from a votable. More...
 

Typedef Documentation

◆ DMatrix

typedef xt::xarray< double, xt::layout_type::row_major > cphot::DMatrix

Definition at line 32 of file filter.hpp.

Function Documentation

◆ create_compound_filter_t()

HighFive::CompoundType cphot::create_compound_filter_t ( )

Create a compound filter t object.

Returns
HighFive::CompoundType

this needs HIGHFIVE_REGISTER_TYPE(filter_t, create_compound_filter_t);

Definition at line 81 of file library.hpp.

◆ get_filter_from_hdf5_library()

Filter cphot::get_filter_from_hdf5_library ( const std::string &  library_filename,
const std::string &  filter_name 
)

Get the filter from hdf5 library object.

Parameters
library_filenamewhere to find the hdf5 library
filter_namefilter normalized name (dataset group key)
Returns
Filter filter object

Definition at line 93 of file library.hpp.

◆ get_str_attribute() [1/2]

std::string cphot::get_str_attribute ( const H5::DataSet &  ds,
const std::string &  attribute_name 
)

Get a string attribute from a dataset.

Parameters
dsdataset object
attribute_nameattribute name
Returns
std::string content of the attribute

Definition at line 33 of file library.hpp.

◆ get_str_attribute() [2/2]

std::string cphot::get_str_attribute ( const std::string &  filename,
const std::string &  path,
const std::string &  attribute_name 
)

Get a string attribute from a dataset.

Parameters
filenamefile name
pathpath to the dataset
attribute_nameattribute name
Returns
std::string content of the attribute

Definition at line 54 of file library.hpp.

◆ operator<<() [1/4]

std::ostream& cphot::operator<< ( std::ostream &  os,
Filter F 
)

Nice representation of Filter objects.

Parameters
osstream to output the representation
FFilter object
Returns
std::ostream& same as os

Definition at line 165 of file filter.hpp.

◆ operator<<() [2/4]

std::ostream& cphot::operator<< ( std::ostream &  os,
HDF5Library l 
)

Nice representation of Filter objects.

Parameters
osstream to output the representation
FFilter object
Returns
std::ostream& same as os

Definition at line 227 of file library.hpp.

◆ operator<<() [3/4]

std::ostream& cphot::operator<< ( std::ostream &  os,
LickIndex index 
)

Nice representation of Filter objects.

Parameters
osstream to output the representation
FFilter object
Returns
std::ostream& same as os

Definition at line 238 of file licks.hpp.

◆ operator<<() [4/4]

std::ostream& cphot::operator<< ( std::ostream &  os,
LickLibrary l 
)

Nice representation of LickLibrary.

Parameters
osstream to output the representation
FFilter object
Returns
std::ostream& same as os

Definition at line 337 of file licks.hpp.