table()
table(const table& a)
table(const string infilename, bool loadAll = true)
table(const string modName, const string modUnits,
const Integer nInt, const Integer nAdd, const bool isz,
const bool isAdd, const string eUnits, const Real lowElim,
const Real highElim, const string filename,
const RealVector& energies = RealVector(),
const std::vector<tableParameter>& paramObjects
= std::vector<tableParameter>(),
const std::vector<tableSpectrum>& spectrumObjects
= std::vector<tableSpectrum>(),
const bool isEscale = false, const bool isErr = false)
Constructors. The first is the default constructor and the
others are constructor versions of the copy, read, and
load methods described below.
~table()
Default destructor.
void load(const string modName, const string modUnits, const Integer nInt,
const Integer nAdd, const bool isz, const bool isAdd,
const string eUnits,
const Real lowElim, const Real highElim,
const string filename,
const RealVector& energies = RealVector(),
const std::vector<tableParameter>& paramObjects
= std::vector<tableParameter>(),
const std::vector<tableSpectrum>& spectrumObjects
= std::vector<tableSpectrum>(),
const bool isEscale = false, const bool isErr = false)
Loads required information into the table object.
Integer read(const string filename, bool loadAll = true)
Read the table model object from filename. If loadAll is
false then don't actually read in the Spectra but set up
the objects.
template <class T> Integer readSpectra(T& spectrumList)
Read in the listed Spectra if they have not already been.
The class T can be IntegerVector, std::valarrayInteger,
std::vectorsize_t, or std::valarraysize_t.
void pushParameter(tableParameter paramObject)
Push a table Parameter object
void pushSpectrum(tableSpectrum spectrumObject)
Push a table spectrum object
tableParameter getParameter(const Integer Number) const
Get a table Parameter object
tableSpectrum getSpectrum(const Integer Number) const
Get a table Spectrum object
table& copy(const table& a)
table& operator= (const table& a)
Deep copy.
string disp() const
Display information about the table - return as a string.
void clear()
void clearParameters()
void clearSpectra()
Clear contents of the table, clear the parameters only,
and clear the spectra only.
string check() const
Check completeness and consistency of information in table,
if there is a problem then return diagnostic in string.
Integer convertUnits()
Convert the table to standard units (keV and ph/cm/s).
The original units should be set using setEnergyUnits and
setModelUnits. The allowed model units are: ph/cm/s/X,
where X is one of MeV, GeV, Hz, A, cm, um, nm; ergs/cm/s;
ergs/cm/s/X, where X is one of Hz, A, cm, um, nm;
Jy. The allowed energy units are keV, GeV, Hz, angstrom,
cm, micron or nm.
void reverseRows()
Reverse the spectra if energies are not increasing (this
can occur after using convertUnits to convert from wavelength).
write(string filename)
Write to a FITS file
template <class T> Integer getValues(const T& parameterValues,
const Real minEnergy,
const Real maxEnergy,
T& tableEnergyBins,
T& tableValues,
T& tableErrors)
Interpolate on the table using the input parameters in
parameterValues and return the resulting spectrum between
the input minimum and maximum energies. The actual
energies on which the spectrum is evaluated are returned
in tableEnergyBins with the spectrum values as tableValues
and, if included, their errors as tableErrors. The class T
can be either RealVector or RealArray.
template <class T> Integer getValues(const T& parameterValues,
const std::map<string,Real>& xfltInfo,
const Real minEnergy,
const Real maxEnergy,
T& tableEnergyBins,
T& tableValues,
T& tableErrors)
Interpolate on the table using the input parameters in
parameterValues and if there are multiple model spectra
per parameter grid point selected the correct one using
the xfltInfo. Return the resulting spectrum between
the input minimum and maximum energies. The actual
energies on which the spectrum is evaluated are returned
in tableEnergyBins with the spectrum values as tableValues
and, if included, their errors as tableErrors. The class T
can be either RealVector or RealArray.
Integer NumberParameters() const
Integer getNumberParameters() const
Return the number of parameters in the table.
Integer NumberSpectra() const
Integer getNumberSpectra() const
Return the total number of grid points in the table.
Integer NumberEnergies() const
Integer getNumberEnergies() const
Return the number of energies in the spectra.