27 #ifndef GMODELSPECTRALTABLE_HPP
28 #define GMODELSPECTRALTABLE_HPP
72 virtual void clear(
void);
74 virtual std::string
classname(
void)
const;
75 virtual std::string
type(
void)
const;
78 const bool& gradients =
false)
const;
96 double norm(
void)
const;
97 void norm(
const double& norm);
101 const bool& clobber =
false)
const;
117 int par_index(
const std::string& name)
const;
159 return (
"GModelSpectralTable");
173 return (
"TableModel");
GModelSpectralTable(void)
Void constructor.
std::vector< double > m_mc_max
Upper boundary for MC.
double norm(const GVector &vector)
Computes vector norm.
GFitsBinTable create_spec_table(void) const
Create SPECTRA FITS table.
std::vector< double > m_mc_exp
Exponent for MC.
Abstract spectral model base class.
GModelPar m_norm
Normalization factor.
GModelSpectralTablePars m_table_pars
Table model parameters.
GEnergy m_mc_emax
Maximum energy.
virtual void read(const GXmlElement &xml)
Read model from XML element.
GNdarray m_lin_values
Function values and grad's.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns MC energy between [emin, emax].
const GEbounds & ebounds(void) const
Return reference to energy boundaries.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between emin, emax
Random number generator class.
void free_members(void)
Delete class members.
virtual ~GModelSpectralTable(void)
Destructor.
double norm(void) const
Return normalization factor.
void set_energy_nodes(void)
Set energy nodes from energy boundaries.
void update_mc(const GEnergy &emin, const GEnergy &emax) const
Update MC cache.
GNodeArray m_log_nodes
log10(Energy) nodes of function
std::vector< double > m_epivot
Power-law pivot energies.
std::vector< double > m_flux
Photon fluxes.
void init_members(void)
Initialise class members.
Spectral table model parameter container class.
std::vector< double > m_prefactor
Power-law normalisations.
void update_flux(void) const
Update flux cache.
void set_par_pointers(void)
Set parameter pointers.
Model parameter class interface definition.
std::vector< double > m_mc_cum
Cumulative distribution.
void load(const GFilename &filename)
Load table from file.
void load_eng(const GFits &fits)
Load data from ENERGIES extension.
virtual std::string classname(void) const
Return class name.
GFitsBinTable create_eng_table(void) const
Create ENERGIES FITS table.
void copy_members(const GModelSpectralTable &model)
Copy class members.
Node array class interface definition.
GNodeArray m_lin_nodes
Energy nodes of function.
const GFilename & filename(void) const
Return file name.
Energy boundaries container class.
std::vector< double > m_last_values
Last parameter values.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate spectral table model.
N-dimensional array class interface definition.
virtual void clear(void)
Clear table model.
GNdarray m_spectra
Spectra.
int m_nebins
Number of energy bins.
GFilename m_filename
Filename of table.
std::vector< double > m_gamma
Power-law indices.
Spectral table model class.
GEbounds m_ebounds
Energy boundaries.
GModelSpectralTablePar & table_par(const int &index)
Return reference to table parameter.
int par_index(const std::string &name) const
Return index for parameter name.
std::vector< double > m_mc_min
Lower boundary for MC.
N-dimensional array class.
void load_par(const GFits &fits)
Load data from PARAMETERS extension.
virtual GModelSpectralTable * clone(void) const
Clone table model.
Abstract spectral model base class interface definition.
virtual std::string type(void) const
Return model type.
Spectral table model parameter container class definition.
GNdarray m_log_values
log10(Function) values and grad's
int m_npars
Number of parameters.
double value(void) const
Return parameter value.
std::vector< double > m_eflux
Energy fluxes.
Energy boundaries class interface definition.
void save(const GFilename &filename, const bool &clobber=false) const
Save table into file.
GEnergy m_mc_emin
Minimum energy.
GFitsBinTable create_par_table(void) const
Create PARAMETERS FITS table.
void update(void) const
Update cache for spectral table model computation.
virtual GModelSpectralTable & operator=(const GModelSpectralTable &model)
Assignment operator.
Spectral table model parameter class.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void load_spec(const GFits &fits)
Load data from SPECTRA extension.
Filename class interface definition.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print table model information.
Class that handles energies in a unit independent way.