GammaLib  2.0.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gammalib Namespace Reference

Functions

int fits_move_to_hdu (const std::string &caller, void *vptr, const int &hdunum=0)
 Move to FITS extension. More...
 
double acos (const double &arg)
 Computes acos by avoiding NaN due to rounding errors. More...
 
double atan2 (const double &y, const double &x)
 Compute arc tangens in radians. More...
 
double cosd (const double &angle)
 Compute cosine of angle in degrees. More...
 
double sind (const double &angle)
 Compute sine of angle in degrees. More...
 
double tand (const double &angle)
 Compute tangens of angle in degrees. More...
 
double asind (const double &value)
 Compute arc sine in degrees. More...
 
double acosd (const double &value)
 Compute arc cosine in degrees. More...
 
double atand (const double &value)
 Compute arc tangens in degrees. More...
 
double atan2d (const double &y, const double &x)
 Compute arc tangens in degrees. More...
 
void sincosd (const double &angle, double *s, double *c)
 Compute sine and cosine of angle in degrees. More...
 
double gammln (const double &arg)
 Computes logarithm of gamma function. More...
 
double erf (const double &arg)
 Computes error function. More...
 
double erfc (const double &arg)
 Computes complementary error function. More...
 
double erfinv (const double &arg)
 Computes inverse error function. More...
 
double modulo (const double &v1, const double &v2)
 Returns the remainder of the division. More...
 
double plaw_integral (const double &x1, const double &f1, const double &x2, const double &f2)
 Returns the integral of a power law. More...
 
double gauss_integral (const double &x1, const double &x2)
 Returns the integral of a Gaussian function. More...
 
std::string strip_whitespace (const std::string &arg)
 Strip leading and trailing whitespace from string. More...
 
std::string strip_chars (const std::string &arg, const std::string &chars)
 Strip leading and trailing character from string. More...
 
std::string rstrip_chars (const std::string &arg, const std::string &chars)
 Strip trailing character from string. More...
 
std::string replace_segment (const std::string &arg, const std::string &segment, const std::string &replacement)
 Replace string segment in string. More...
 
std::string expand_env (const std::string &arg)
 Expand environment variables in string. More...
 
std::string filepath (const std::string &pathname, const std::string &filename)
 Build file path from path name and file name. More...
 
std::string str (const unsigned short int &value)
 Convert unsigned short integer value into string. More...
 
std::string str (const unsigned int &value)
 Convert unsigned integer value into string. More...
 
std::string str (const unsigned long int &value)
 Convert unsigned long integer value into string. More...
 
std::string str (const unsigned long long int &value)
 Convert unsigned long long integer value into string. More...
 
std::string str (const short int &value)
 Convert short integer value into string. More...
 
std::string str (const int &value, const std::string &fmt="%d")
 Convert integer value into string. More...
 
std::string str (const long int &value)
 Convert long integer value into string. More...
 
std::string str (const long long int &value)
 Convert long long integer value into string. More...
 
std::string str (const float &value, const int &precision=0)
 Convert single precision value into string. More...
 
std::string str (const double &value, const int &precision=0)
 Convert double precision value into string. More...
 
std::string str (const std::complex< double > &value, const int &precision=0)
 Convert complex value into string. More...
 
char * tochar (const std::string &arg)
 Convert string to C string. More...
 
short toshort (const std::string &arg)
 Convert string into short value. More...
 
unsigned short toushort (const std::string &arg)
 Convert string into unsigned short value. More...
 
int toint (const std::string &arg)
 Convert string into integer value. More...
 
unsigned int touint (const std::string &arg)
 Convert string into unsigned integer value. More...
 
long tolong (const std::string &arg)
 Convert string into long value. More...
 
unsigned long toulong (const std::string &arg)
 Convert string into unsigned long value. More...
 
long long tolonglong (const std::string &arg)
 Convert string into long long value. More...
 
unsigned long long toulonglong (const std::string &arg)
 Convert string into unsigned long long value. More...
 
float tofloat (const std::string &arg)
 Convert string into single precision value. More...
 
double todouble (const std::string &arg)
 Convert string into double precision value. More...
 
std::string toupper (const std::string &s)
 Convert string to upper case. More...
 
std::string tolower (const std::string &s)
 Convert string to lower case. More...
 
std::vector< std::string > split (const std::string &s, const std::string &sep)
 Split string. More...
 
std::string fill (const std::string &s, const int &n)
 Fill string with n strings of same type. More...
 
std::string left (const std::string &s, const int &n, const char &c= ' ')
 Left justify string to achieve a length of n characters. More...
 
std::string right (const std::string &s, const int &n, const char &c= ' ')
 Right justify string to achieve a length of n characters. More...
 
std::string centre (const std::string &s, const int &n, const char &c= ' ')
 Centre string to achieve a length of n characters. More...
 
std::string parformat (const std::string &s, const int &indent=0)
 Convert string in parameter format. More...
 
std::string number (const std::string &noun, const int &number)
 Convert singular noun into number noun. More...
 
double plaw_photon_flux (const double &emin, const double &emax, const double &epivot, const double &gamma)
 Compute photon flux between two energies for a power law. More...
 
double plaw_energy_flux (const double &emin, const double &emax, const double &epivot, const double &gamma)
 Compute energy flux between two energies for a power law. More...
 
GEnergy elogmean (const GEnergy &a, const GEnergy &b)
 Computes log mean energy. More...
 
bool dir_exists (const std::string &dirname)
 Checks if directory exists. More...
 
bool is_infinite (const double &x)
 Signal if argument is infinite. More...
 
bool is_notanumber (const double &x)
 Signal if argument is not a number. More...
 
bool contains (const std::string &str, const std::string &substring)
 Checks if a substring is in a string. More...
 
bool contains (const std::vector< std::string > &strings, const std::string &string)
 Checks if a string is contained in a vector of strings. More...
 
void warning (const std::string &origin, const std::string &message)
 Emits warning. More...
 
std::string xml2str (const std::string &arg)
 Convert XML character references in string to characters. More...
 
std::string str2xml (const std::string &arg)
 Convert special characters in string to XML character references. More...
 
bool xml_has_par (const GXmlElement &xml, const std::string &name)
 Checks if parameter with given name in XML element exists. More...
 
GXmlElementxml_need_par (const std::string &origin, GXmlElement &xml, const std::string &name)
 Return pointer to parameter with given name in XML element. More...
 
const GXmlElementxml_get_par (const std::string &origin, const GXmlElement &xml, const std::string &name)
 Return pointer to parameter with given name in XML element. More...
 
std::string xml_get_attr (const std::string &origin, const GXmlElement &xml, const std::string &name, const std::string &attribute)
 Return attribute value for a given parameter in XML element. More...
 
void xml_check_par (const std::string &origin, const std::string &name, const int &number)
 Checks whether a parameter has occured once. More...
 
GFilename xml_file_expand (const GXmlElement &xml, const std::string &filename)
 Expand file name provided as XML attribute for loading. More...
 
GFilename xml_file_reduce (const GXmlElement &xml, const std::string &filename)
 Reduce file name provided for writing as XML attribute. More...
 
void xml_get_name_value_pair (const GXmlNode *node, std::string &name, std::string &value)
 Extract name / value pair from XML node. More...
 
int recv (int fd, char *buffer, int len, int flags, int timeout)
 Checks whether a parameter has occured once. More...
 
double roi_arclength (const double &rad, const double &dist, const double &cosdist, const double &sindist, const double &roi, const double &cosroi)
 Returns length of circular arc within circular ROI. More...
 
GChatter reduce (const GChatter &chatter)
 Reduce chattiness by one level. More...
 
void com_wcs_mer2car (GSkyMap &map)
 Changes Mercator's projection to cartesian projection. More...
 
double com_energy1 (const double &energy, const double &phigeo)
 Return D1 energy deposit. More...
 
double com_energy2 (const double &energy, const double &phigeo)
 Return D2 energy deposit. More...
 
GTime com_time (const int &tjd, const int &tics)
 Convert TJD and COMPTEL ticks in GTime object. More...
 
int com_tjd (const GTime &time)
 Convert GTime in COMPTEL TJD. More...
 
int com_tics (const GTime &time)
 Convert GTime in COMPTEL tics. More...
 
cta_omega_intervals limit_omega (const double &min, const double &max, const double &domega)
 Limit omega interval. More...
 
double resolution (const GModelSpatial *model)
 Determine resolution of spatial model. More...
 
GCTARoi read_ds_roi (const GFitsHDU &hdu)
 Extract ROI from data sub-space keywords. More...
 
GEbounds read_ds_ebounds (const GFitsHDU &hdu)
 Read energy boundary data sub-space keywords. More...
 
GPhases read_ds_phase (const GFitsHDU &hdu)
 Read phase boundary data sub-space keywords. More...
 
std::string read_ds_gti_extname (const GFitsHDU &hdu)
 Return Good Time Intervals extension name from data sub-space keywords. More...
 
std::string gadf_hduclas4 (const GFits &fits, const std::string &hduclas4)
 Return extension name for GADF response table of given HDU class 4. More...
 
int iter_rho (const double &rho_max, const double &resolution, const int &iter_min, const int &iter_max)
 Determine number of radial Romberg iterations. More...
 
int iter_phi (const double &rho, const double &resolution, const int &iter_min, const int &iter_max)
 Determine number of azimuthal Romberg iterations. More...
 
const GCTAObservationcta_obs (const std::string &origin, const GObservation &obs)
 Retrieve CTA observation from generic observation. More...
 
const GCTAPointingcta_pnt (const std::string &origin, const GObservation &obs)
 Retrieve CTA pointing from generic observation. More...
 
const GCTAResponsecta_rsp (const std::string &origin, const GResponse &rsp)
 Retrieve CTA response from generic observation. More...
 
const GCTAResponseIrfcta_rsp_irf (const std::string &origin, const GObservation &obs)
 Retrieve CTA IRF response from generic observation. More...
 
const GCTAResponseCubecta_rsp_cube (const std::string &origin, const GObservation &obs)
 Retrieve CTA cube response from generic observation. More...
 
const GCTAAeffcta_rsp_aeff (const std::string &origin, const GObservation &obs)
 Retrieve CTA effective area response from generic observation. More...
 
const GCTABackgroundcta_rsp_bkg (const std::string &origin, const GObservation &obs)
 Retrieve CTA background response from generic observation. More...
 
const GCTAEventListcta_event_list (const std::string &origin, const GObservation &obs)
 Retrieve CTA event list from generic observation. More...
 
const GCTAEventCubecta_event_cube (const std::string &origin, const GObservation &obs)
 Retrieve CTA event cube from generic observation. More...
 
const GCTAInstDircta_dir (const std::string &origin, const GEvent &event)
 Retrieve CTA instrument direction from generic event. More...
 
const GModelSpectralcta_model_spectral (const GModelData &model)
 Retrieve spectral component from CTA background model. More...
 
const GModelTemporalcta_model_temporal (const GModelData &model)
 Retrieve temporal component from CTA background model. More...
 
const GFitsTablespi_hdu (const GFits &fits, const std::string &extname, const int &extver=1)
 Return FITS table. More...
 
int spi_num_hdus (const GFits &fits, const std::string &extname)
 Return number of HDU versions. More...
 
GTime spi_ijd2time (const double &ijd)
 Convert IJD to GTime. More...
 
GTimes spi_annealing_start_times (void)
 Return start time of annealing operations. More...
 
GTimes spi_gedfail_times (void)
 Return times of detector failures. More...
 

Variables

const std::string extname_arf = "SPECRESP"
 
const std::string extname_ebounds = "EBOUNDS"
 
const std::string extname_energies = "ENERGIES"
 
const std::string extname_gti = "GTI"
 
const double pi = 3.141592653589793238462643383279502884197
 
const double twopi = 6.283185307179586476925286766559005768394
 
const double fourpi = 12.56637061435917295385057353311801153679
 
const double pihalf = 1.570796326794896619231321691639751442099
 
const double inv_pihalf = 0.6366197723675813430755350534900574
 
const double inv_sqrt4pi = 0.2820947917738781434740397257803862929220
 
const double inv_sqrt2pi = 0.3989422804014327028632180827116826549172
 
const double pi2 = pi*pi
 
const double deg2rad = 0.0174532925199432954743717
 
const double rad2deg = 57.295779513082322864647722
 
const double ln2 = 0.6931471805599453094172321214581766
 
const double ln10 = 2.3025850929940456840179914546843642
 
const double inv_ln2 = 1.4426950408889634073599246810018921
 
const double inv_ln10 = 1.0/ln10
 
const double inv_loge = 1.0/std::log10(std::exp(1.0))
 
const double onethird = 1.0/3.0
 
const double twothird = 2.0/3.0
 
const double fourthird = 4.0/3.0
 
const double sqrt_onehalf = std::sqrt(1.0/2.0)
 
const double sqrt_two = std::sqrt(2.0)
 
const double sqrt_pihalf = std::sqrt(pihalf)
 
const double sqrt_twopi = std::sqrt(twopi)
 
const std::string extname_pha = "SPECTRUM"
 
const std::string extname_rmf = "MATRIX"
 
const double MeV2erg = 1.6021765e-6
 
const double erg2MeV = 624150.96
 
const double MeV2Angstrom = 1.239841875e-2
 
const double pc2cm = 3.08568025e18
 
const double sec_in_day = 86400.0
 
const double sec2day = 1.0 / sec_in_day
 
const double tai2tt = 32.184
 
const double mec2 = 0.5109989461
 
const double gkx1 [5]
 
const double gkw10 [5]
 
const double gkx2 [5]
 
const double gkw21a [5]
 
const double gkw21b [6]
 
const double gkx3 [11]
 
const double gkw43a [10]
 
const double gkw43b [12]
 
const double gkx4 [22]
 
const double gkw87a [21]
 
const double gkw87b [23]
 
const std::string extname_dri = "DRI"
 
const std::string extname_cta_aeff2d = "EFFECTIVE AREA"
 
const std::string extname_cta_background3d = "BACKGROUND"
 
const std::string extname_cta_migras = "MIGRAS"
 
const std::string extname_deltas = "DELTAS"
 
const std::string extname_cta_edisp2d = "ENERGY DISPERSION"
 
const std::string extname_cta_counts = "COUNTS"
 
const std::string extname_cta_weights = "WEIGHTS"
 
const std::string extname_cta_events = "EVENTS"
 
const std::string extname_cta_spatial_lookup = "RADIAL BACKGROUND LOOKUP"
 
const std::string extname_cta_psf2d = "POINT SPREAD FUNCTION"
 
const std::string extname_cta_psfking = "POINT SPREAD FUNCTION"
 
const std::string extname_cta_psftable = "PSF_2D_TABLE"
 
const std::string extname_lat_aeff = "EFFECTIVE AREA"
 
const std::string extname_lat_efficiency = "EFFICIENCY_PARAMS"
 
const std::string extname_lat_edisp = "ENERGY DISPERSION"
 
const std::string extname_lat_edisp_scale = "EDISP_SCALING_PARAMS"
 
const std::string extname_lat_events = "EVENTS"
 
const std::string extname_lat_exposure = "EXPOSURE"
 
const std::string extname_lat_wgtexposure = "WEIGHTED_EXPOSURE"
 
const std::string extname_lat_cthetabounds = "CTHETABOUNDS"
 
const std::string extname_lat_ltcubemap = "EXPOSURE"
 

Function Documentation

double gammalib::acosd ( const double &  value)

Compute arc cosine in degrees.

Parameters
[in]valueValue

This code has been adapted from the WCSLIB function wcstrig.c::acosd().

Definition at line 218 of file GMath.cpp.

References acos(), and rad2deg.

Referenced by GWcs::cel_set(), GWcsSIN::prj_x2s(), GWcs::sph_s2x(), and GWcs::sph_x2s().

double gammalib::asind ( const double &  value)

Compute arc sine in degrees.

Parameters
[in]valueValue

This code has been adapted from the WCSLIB function wcstrig.c::asind().

Definition at line 250 of file GMath.cpp.

References asin(), and rad2deg.

Referenced by GWcsAZP::prj_s2x(), GWcsAZP::prj_set(), GWcsAIT::prj_x2s(), GWcsAZP::prj_x2s(), GWcsSIN::prj_x2s(), GWcs::sph_s2x(), and GWcs::sph_x2s().

double gammalib::atan2 ( const double &  y,
const double &  x 
)

Compute arc tangens in radians.

Parameters
[in]yNominator
[in]xDenominator

This code has been adapted from the WCSLIB function wcstrig.c::atan2d().

Definition at line 102 of file GMath.cpp.

References pi, and pihalf.

Referenced by atan2d(), GHorizDir::celvector(), GSkyDir::celvector(), GSkyDir::euler(), GHealpix::get_ring_info(), GHealpix::loc2dir(), GHealpix::max_pixrad(), GSkyDir::moon(), GCTAInstDir::phi(), GSkyDir::posang(), GCTAPointing::skydir(), GCTABackground3D::solid_angle(), and GSkyDir::sun().

double gammalib::atan2d ( const double &  y,
const double &  x 
)

Compute arc tangens in degrees.

Parameters
[in]yNominator
[in]xDenominator

This code has been adapted from the WCSLIB function wcstrig.c::atan2d().

Definition at line 308 of file GMath.cpp.

References atan2(), and rad2deg.

Referenced by GWcs::cel_set(), GModelSpatialEllipticalGauss::mc(), GWcsSTG::prj_x2s(), GWcsTAN::prj_x2s(), GWcsAZP::prj_x2s(), GWcsSIN::prj_x2s(), GWcsAIT::prj_x2s(), GWcsARC::prj_x2s(), GWcs::sph_s2x(), and GWcs::sph_x2s().

double gammalib::atand ( const double &  value)

Compute arc tangens in degrees.

Parameters
[in]valueValue

This code has been adapted from the WCSLIB function wcstrig.c::atand().

Definition at line 282 of file GMath.cpp.

References atan(), and rad2deg.

Referenced by GWcsAZP::prj_s2x(), GWcsSIN::prj_s2x(), GWcsSTG::prj_x2s(), and GWcsMER::prj_x2s().

std::string gammalib::centre ( const std::string &  s,
const int &  n,
const char &  c = ' ' 
)

Centre string to achieve a length of n characters.

Parameters
[in]sString to be centred.
[in]nRequested total width.
[in]cLeft fill character.
Returns
Centred string.

Centre string by adding whitespace to the left and the right to achieve a length of n characters.

Definition at line 1008 of file GTools.cpp.

References fill().

Referenced by GSkyRegionMap::contains(), GSkyMap::flux(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GApplication::log_header(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAEventList::print(), GCOMEventList::read_events(), and GSkyMap::region_circle().

double gammalib::com_energy1 ( const double &  energy,
const double &  phigeo 
)

Return D1 energy deposit.

Parameters
[in]energyInput photon energy (MeV).
[in]phigeoGeometrical scatter angle (deg).
Returns
D1 energy deposit in MeV.

Definition at line 108 of file GCOMSupport.cpp.

References com_energy2().

Referenced by GCOMInstChars::psd_correction().

double gammalib::com_energy2 ( const double &  energy,
const double &  phigeo 
)

Return D2 energy deposit.

Parameters
[in]energyInput photon energy (MeV).
[in]phigeoGeometrical scatter angle (deg).
Returns
D2 energy deposit in MeV.

Definition at line 125 of file GCOMSupport.cpp.

References cos(), deg2rad, and mec2.

Referenced by com_energy1(), GCOMIaq::compton_kinematics(), GCOMInstChars::prob_D2inter(), GCOMInstChars::trans_D2(), and GCOMInstChars::trans_V23().

int gammalib::com_tics ( const GTime time)

Convert GTime in COMPTEL tics.

Parameters
[in]timeTime.
Returns
COMPTEL ticks (1/8 ms).

Converts GTime object in COMPTEL ticks (1/8 ms).

Definition at line 196 of file GCOMSupport.cpp.

References com_time(), and com_tjd().

Referenced by GCOMTim::print(), GCOMEventList::print(), GCOMEventCube::print(), GCOMTim::write(), and GCOMDri::write_attributes().

GTime gammalib::com_time ( const int &  tjd,
const int &  tics 
)

Convert TJD and COMPTEL ticks in GTime object.

Parameters
[in]tjdTruncated Julian Days (days).
[in]ticsCOMPTEL ticks (1/8 ms).
Returns
Time.

Converts TJD and COMPTEL ticks into a GTime object. COMPTEL times are given in UTC, i.e. 8393:0 converts into 1991-05-17T00:00:00 UT (see COM-RP-UNH-DRG-037).

Definition at line 149 of file GCOMSupport.cpp.

References GTime::mjd(), and GTime::secs().

Referenced by com_tics(), GCOMTim::read(), GCOMOads::read(), GCOMDri::read_attributes(), and GCOMEventAtom::time().

int gammalib::com_tjd ( const GTime time)

Convert GTime in COMPTEL TJD.

Parameters
[in]timeTime.
Returns
Truncated Julian Days (days).

Converts GTime object in TJD.

Definition at line 178 of file GCOMSupport.cpp.

References GTime::mjd().

Referenced by com_tics(), GCOMTim::print(), GCOMEventList::print(), GCOMEventCube::print(), GCOMTim::write(), and GCOMDri::write_attributes().

void gammalib::com_wcs_mer2car ( GSkyMap map)

Changes Mercator's projection to cartesian projection.

Parameters
[in,out]mapSkymap.

Changes the World Coordinate System of a sky map from Mercartor's projection to a cartesian projection. This transformation is needed to correct the wrong WCS headers that are found in the COMPTEL files distributed through the HEASARC web site.

The method operates only on sky maps that use Mercator's projection. Nothing is done for all other sky map. This method can thus be transparently be applied to the sky maps read from COMPTEL data files.

Definition at line 58 of file GCOMSupport.cpp.

References GWcs::cdelt(), GWcs::code(), GSkyProjection::coordsys(), GWcs::crpix(), GWcs::crval(), GSkyMap::nx(), GSkyMap::ny(), and GSkyMap::projection().

Referenced by GCOMObservation::load_drb(), GCOMObservation::load_drg(), GCOMObservation::load_drx(), and GCOMDri::read().

bool gammalib::contains ( const std::string &  str,
const std::string &  substring 
)

Checks if a substring is in a string.

Parameters
[in]strString you want to search in.
[in]substringString you are looking for in str.
Returns
True if a string contains a sub string.

Checks if substring is contained in str

Definition at line 1232 of file GTools.cpp.

Referenced by GCTAModelSpatialMultiplicative::append(), GModelSpatialComposite::append(), GModelSpectralComposite::append(), GModelSpectralMultiplicative::append(), GSkyRegionCircle::read(), GSPIModelDataSpace::setup_detector_indices(), GSPIModelDataSpace::setup_energy_indices(), GSPIModelDataSpace::setup_pointing_indices(), GCTAModelSpatialMultiplicative::write(), GModelSpectralComposite::write(), and GModelSpectralMultiplicative::write().

bool gammalib::contains ( const std::vector< std::string > &  strings,
const std::string &  string 
)

Checks if a string is contained in a vector of strings.

Parameters
[in]stringsVector of strings you want to search in.
[in]stringstring you are looking for in strings.
Returns
True if a string is contained a vector.

Checks if a string is contained in a vector of strings

Definition at line 1256 of file GTools.cpp.

double gammalib::cosd ( const double &  angle)

Compute cosine of angle in degrees.

Parameters
[in]angleAngle in degrees

This code has been adapted from the WCSLIB function wcstrig.c::cosd().

Definition at line 134 of file GMath.cpp.

References abs(), cos(), and deg2rad.

Referenced by GWcs::cel_set(), GWcsSFL::prj_s2x(), GWcsSTG::prj_s2x(), GWcsTAN::prj_s2x(), GWcsSIN::prj_s2x(), GWcsAZP::prj_set(), GWcs::sph_s2x(), and GWcs::sph_x2s().

const GCTAInstDir & gammalib::cta_dir ( const std::string &  origin,
const GEvent event 
)

Retrieve CTA instrument direction from generic event.

Parameters
[in]originMethod asking for pointer retrieval.
[in]eventGeneric event.
Returns
Reference to CTA RoI.
Exceptions
GException::invalid_argumentevent does not contain a CTA instrument direction.

Extract CTA Instrument Direction from an event.

Definition at line 804 of file GCTASupport.cpp.

Referenced by GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelCubeBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), and GCTAResponseIrf::irf_radial().

const GCTAEventCube & gammalib::cta_event_cube ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA event cube from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA event cube.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA event cube.

Extract CTA event cube from a CTA observation.

Definition at line 770 of file GCTASupport.cpp.

References cta_obs(), and GObservation::events().

Referenced by GCTAResponseCube::irf_radial().

const GCTAEventList & gammalib::cta_event_list ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA event list from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA event list.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA event list.

Extract CTA event list from a CTA observation.

Definition at line 736 of file GCTASupport.cpp.

References cta_obs(), and GObservation::events().

Referenced by GCTAModelAeffBackground::aeff_integral(), GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelBackground::mc(), GCTAResponseIrf::nirf(), GCTAModelIrfBackground::npred(), GCTAModelRadialAcceptance::npred(), GCTAModelSpatial::npred(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), and GCTAResponseIrf::nroi_radial().

const GModelSpectral * gammalib::cta_model_spectral ( const GModelData model)

Retrieve spectral component from CTA background model.

Parameters
[in]modelData model.
Returns
Pointer to spectral component.

Retrieves the spectral component from a CTA background model. If the background model has no spectral component, a NULL pointer will be returned.

Definition at line 834 of file GCTASupport.cpp.

References GCTAModelIrfBackground::spectral(), GCTAModelAeffBackground::spectral(), GCTAModelCubeBackground::spectral(), GCTAModelRadialAcceptance::spectral(), and GCTAModelBackground::spectral().

Referenced by GCTAOnOffObservation::N_bgd().

const GModelTemporal * gammalib::cta_model_temporal ( const GModelData model)

Retrieve temporal component from CTA background model.

Parameters
[in]modelData model.
Returns
Pointer to temporal component.

Retrieves the temporal component from a CTA background model. If the background model has no temporal component, a NULL pointer will be returned.

Definition at line 878 of file GCTASupport.cpp.

References GCTAModelIrfBackground::temporal(), GCTAModelAeffBackground::temporal(), GCTAModelCubeBackground::temporal(), GCTAModelRadialAcceptance::temporal(), and GCTAModelBackground::temporal().

const GCTAObservation & gammalib::cta_obs ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA observation from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA observation.
Exceptions
GException::invalid_argumentObservation obs is not a CTA observations.

Dynamically casts generic observation into a CTA observation. If the generic observation is not a CTA observation, an exception is thrown.

Definition at line 516 of file GCTASupport.cpp.

References GObservation::id(), and GObservation::name().

Referenced by cta_event_cube(), cta_event_list(), cta_pnt(), cta_rsp_cube(), cta_rsp_irf(), GCTAModelBackground::mc(), GCTAResponseIrf::nirf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), and GCTAResponseIrf::nroi_radial().

const GCTAPointing & gammalib::cta_pnt ( const std::string &  origin,
const GObservation obs 
)
const GCTAResponse * gammalib::cta_rsp ( const std::string &  origin,
const GResponse rsp 
)

Retrieve CTA response from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]rspGeneric response.
Returns
Pointer to CTA response.
Exceptions
GException::invalid_argumentResponse rsp is not a CTA response.

Extract CTA response from a CTA observation.

Definition at line 569 of file GCTASupport.cpp.

Referenced by GCTAObservation::response(), and GCTAOnOffObservation::response().

const GCTAAeff & gammalib::cta_rsp_aeff ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA effective area response from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA effective area response.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA effective area response.

Extract CTA effective area response from a CTA observation.

Definition at line 672 of file GCTASupport.cpp.

References GCTAResponseIrf::aeff(), and cta_rsp_irf().

Referenced by GCTAModelAeffBackground::aeff_integral(), GCTAModelAeffBackground::eval(), and GCTAModelAeffBackground::mc().

const GCTABackground & gammalib::cta_rsp_bkg ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA background response from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA background response.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA background response.

Extract CTA background response from a CTA observation.

Definition at line 704 of file GCTASupport.cpp.

References GCTAResponseIrf::background(), and cta_rsp_irf().

Referenced by GCTAModelIrfBackground::eval(), GCTAModelIrfBackground::mc(), and GCTAModelIrfBackground::npred().

const GCTAResponseCube & gammalib::cta_rsp_cube ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA cube response from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA cube response.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA cube response.

Extract CTA cube response from a CTA observation.

Definition at line 636 of file GCTASupport.cpp.

References cta_obs(), and GCTAObservation::response().

Referenced by GCTAModelCubeBackground::eval(), and GCTAModelCubeBackground::npred().

const GCTAResponseIrf & gammalib::cta_rsp_irf ( const std::string &  origin,
const GObservation obs 
)

Retrieve CTA IRF response from generic observation.

Parameters
[in]originMethod asking for pointer retrieval.
[in]obsGeneric observation.
Returns
Reference to CTA IRF response.
Exceptions
GException::invalid_argumentObservation obs does not contain a CTA IRF response.

Extract CTA IRF response from a CTA observation.

Definition at line 600 of file GCTASupport.cpp.

References cta_obs(), GObservation::id(), GObservation::name(), and GCTAObservation::response().

Referenced by GCTAOnOffObservation::compute_arf(), GCTAOnOffObservation::compute_arf_cut(), GCTAOnOffObservation::compute_rmf(), cta_rsp_aeff(), and cta_rsp_bkg().

bool gammalib::dir_exists ( const std::string &  dirname)

Checks if directory exists.

Parameters
[in]dirnameDirectory name.
Returns
True if directory exists, false otherwise.

Checks if a directory exists. The function expands any environment variable prior to checking.

Definition at line 1202 of file GTools.cpp.

References expand_env().

Referenced by GCaldb::path(), and GCaldb::rootdir().

GEnergy gammalib::elogmean ( const GEnergy a,
const GEnergy b 
)

Computes log mean energy.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
Log mean energy.

Computes the logarithmic mean energy \(10^{0.5 * (\log E_{\rm a} + \log E_{\rm b})}\) for two energies.

Definition at line 1180 of file GTools.cpp.

References GEnergy::log10MeV(), GEnergy::MeV(), and pow().

Referenced by GLATEventCube::set_energies(), and GCTAEventCube::set_energies().

double gammalib::erf ( const double &  arg)

Computes error function.

Parameters
[in]argArgument.
Returns
Error function.

Reference: http://en.wikipedia.org/wiki/Complementary_error_function

Definition at line 417 of file GMath.cpp.

References abs(), and exp().

Referenced by erfc(), and erfinv().

double gammalib::erfc ( const double &  arg)

Computes complementary error function.

Parameters
[in]argArgument.
Returns
Complementary error function.

Reference: http://en.wikipedia.org/wiki/Complementary_error_function

Definition at line 450 of file GMath.cpp.

References erf().

Referenced by gauss_integral().

double gammalib::erfinv ( const double &  arg)

Computes inverse error function.

Parameters
[in]argArgument.
Returns
Inverse error function.

Definition at line 463 of file GMath.cpp.

References abs(), copysign, erf(), exp(), log(), pi, and sqrt().

std::string gammalib::expand_env ( const std::string &  arg)

Expand environment variables in string.

Parameters
[in]argString.
Returns
String with expected environment variables.

Expands any environment variable that is found in a string. Valid delimiters for environment variables are $ENV{<name>}, $ENV(<name>), ${<name>}, $(<name>) and $<name> (in the last case the terminating delimiter is either a / or a blank character or the end of the string). Environment variables occuring within single quotes (') are ignored. Environment variables that do not exist will be kept as specified.

The method also replaces ~ or ~user by the user's home directory, ~+ by the value of the PWD environment variable and ~- by the value of the OLDPWD variable. If the user or the PWD or OLDPWD variable are not found, no replacement is done.

This function has been inspired by the function ape_util_expand_env_var from ape_util.c in the ape software developed at HEASARC.

Definition at line 209 of file GTools.cpp.

Referenced by dir_exists(), GFilename::file(), GCaldb::GCaldb(), GCsv::load(), GUrlFile::open(), GFilename::path(), GFilename::protocol(), GCaldb::rootdir(), and GFilename::url().

std::string gammalib::filepath ( const std::string &  pathname,
const std::string &  filename 
)

Build file path from path name and file name.

Parameters
[in]pathnamePath name.
[in]filenameFile name.
Returns
File path.

Builds a file path by combining the pathname and the filename following

 filepath = pathname/filename

If pathname is an empty string, the method simply returns the filename.

Definition at line 388 of file GTools.cpp.

Referenced by GCOMInstChars::load(), GCOMD1Response::load(), GCOMD2Response::load(), GCOMResponse::load(), GCTAResponseIrf::load(), spi_hdu(), and spi_num_hdus().

std::string gammalib::fill ( const std::string &  s,
const int &  n 
)

Fill string with n strings of same type.

Parameters
[in]sString to be filled.
[in]nNumber of fillings.
Returns
Filled strings.

Replicates a given string n time.

Definition at line 934 of file GTools.cpp.

Referenced by centre(), GLog::header(), left(), GApplication::log_header(), GApplication::log_parameters(), parformat(), GLog::prefix(), GXmlPI::print(), GXmlText::print(), GXmlComment::print(), GXmlDocument::print(), GXmlElement::print(), right(), and GTestSuites::run().

int gammalib::fits_move_to_hdu ( const std::string &  caller,
void *  vptr,
const int &  hdunum = 0 
)

Move to FITS extension.

Parameters
[in]callerName of caller.
[in]vptrFITS file void pointer.
[in]hdunumHDU number (optional)
Exceptions
GException::fits_errorcfitsio error occured.

If hdunum is >0, moves the FITS file void pointer to the HDU specified by hdunum. Otherwise, the FITS file void pointer is moved to the HDU specified by the HDUposition attribute of the void pointer.

Definition at line 1745 of file GFits.cpp.

References __ffmahd, FPTR, and str().

Referenced by GFitsTable::data_open(), GFitsHeader::load(), GFitsHDU::move_to_hdu(), GFits::open(), GFitsHDU::open(), GFitsImage::open_image(), GFitsHeaderCard::read(), and GFitsHeaderCard::write().

std::string gammalib::gadf_hduclas4 ( const GFits fits,
const std::string &  hduclas4 
)

Return extension name for GADF response table of given HDU class 4.

Parameters
[in]fitsFITS file.
[in]hduclas4HDU class 4.
Returns
Extension name.

Returns the extension name for GADF response table of given HDU class 4. If the response table is not found, an empty extension name is returned.

Definition at line 374 of file GCTASupport.cpp.

References GFitsHDU::extname(), GFitsHDU::has_card(), GFits::size(), GFitsHDU::string(), and strip_whitespace().

Referenced by GCTAEdisp2D::fetch(), GCTABackground3D::load(), GCTAAeff2D::load(), GCTAPsf2D::load(), GCTAPsfKing::load(), GCTAPsfTable::load(), GCTAResponseIrf::load_aeff(), GCTAResponseIrf::load_edisp(), and GCTAResponseIrf::load_psf().

double gammalib::gammln ( const double &  arg)

Computes logarithm of gamma function.

Parameters
[in]argArgument.
Returns
Logarithm of gamma function.

Definition at line 383 of file GMath.cpp.

References log().

Referenced by GRan::poisson().

double gammalib::gauss_integral ( const double &  x1,
const double &  x2 
)

Returns the integral of a Gaussian function.

Parameters
[in]x1Lower x boundary (in units of Gaussian sigma).
[in]x2Upper x boundary (in units of Gaussian sigma).
Returns
Integral of Gaussian

Analytically computes

\[\frac{1}{\sqrt{\pi}}\int_{x_1}^{x_2} e^{-\frac{1}{2}x^2} dx\]

Definition at line 605 of file GMath.cpp.

References erfc(), norm(), and sqrt_two.

Referenced by GModelSpectralGauss::flux(), and GCTAEdispPerfTable::prob_erecobin().

bool gammalib::is_infinite ( const double &  x)
inline

Signal if argument is infinite.

Parameters
[in]xArgument.
Returns
True if argument x is infinite, false otherwise.

Signals if the argument x is infinite.

This function has been copied from gnulib.

Definition at line 167 of file GTools.hpp.

Referenced by GCTAModelAeffBackground::aeff_integral(), GResponse::convolve(), GModelSpatialRadialRing::eval(), GModelSpatialRadialDisk::eval(), GCTAModelSpatialGaussSpectrum::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpectralComposite::eval(), GCTAModelSpatialGradient::eval(), GCOMModelDRBFitting::eval(), GModelSpatialRadialProfile::eval(), GCTAModelSpatialMultiplicative::eval(), GModelSpectralMultiplicative::eval(), GModelSpectralExponential::eval(), GModelSpectralTable::eval(), GCTAModelRadialGauss::eval(), GCTAModelRadialPolynom::eval(), GModelSpatialRadialShell::eval(), GCTAModelRadialProfile::eval(), GSPIModelDataSpace::eval(), GModelSpectralFunc::eval(), GModelSpectralGauss::eval(), GModelSpectralPlaw::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelSpectralPlawPhotonFlux::eval(), cta_npsf_kern_rad_azsym::eval(), GModelSpectralNodes::eval(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), cta_psf_radial_kerns_phi::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GCTAModelIrfBackground::npred_roi_kern_phi::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatial::npred_roi_kern_phi::eval(), GResponse::edisp_kerns::eval(), GObservation::npred_spec_kern::eval(), cta_irf_radial_kern_rho::eval(), GCTAEdisp2D::edisp_ereco_kern::eval(), cta_irf_radial_kern_omega::eval(), cta_nroi_radial_kern_rho::eval(), cta_nroi_radial_kern_omega::eval(), cta_irf_elliptical_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_irf_diffuse_kern_theta::eval(), cta_irf_diffuse_kern_phi::eval(), cta_nroi_diffuse_kern_theta::eval(), cta_nroi_diffuse_kern_phi::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_omega::eval(), cta_psf_radial_kern_delta::eval(), cta_psf_radial_kern_phi::eval(), cta_psf_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_omega::eval(), cta_psf_diffuse_kern_delta::eval(), cta_psf_diffuse_kern_phi::eval(), GResponse::eval_prob(), GResponse::eval_probs(), GCOMResponse::irf(), GSPIResponse::irf(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GResponse::irf_elliptical(), GCTAResponseCube::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GCTAResponseCube::irf_ptsrc(), GResponse::irf_radial(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GCTAOnOffObservation::likelihood_cstat(), GObservation::likelihood_gaussian_binned(), GObservation::likelihood_poisson_binned(), GObservation::likelihood_poisson_unbinned(), GCTAOnOffObservation::likelihood_wstat(), GCTAResponseIrf::nirf(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelSpatial::npred(), GModelSky::npred(), GObservation::npred_spec(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAPsfTable::precompute(), GModelSpatialDiffuseMap::prepare_map(), GCTAResponseCube::psf_elliptical(), GCTAResponseCube::psf_radial(), GCTAPsfKing::r_max(), roi_arclength(), GIntegral::romberg(), GIntegrals::romberg(), GModelSpatialRadialShell::update(), and GCTAOnOffObservation::wstat_value().

bool gammalib::is_notanumber ( const double &  x)
inline

Signal if argument is not a number.

Parameters
[in]xArgument.
Returns
True if argument x is not a number, false otherwise.

Signals if the argument x is not a number.

This function is a very simple kluge. It may not work on all systems.

Definition at line 184 of file GTools.hpp.

Referenced by GCTAModelAeffBackground::aeff_integral(), GResponse::convolve(), GModelSpatialRadialRing::eval(), GModelSpatialRadialDisk::eval(), GCTAModelSpatialGaussSpectrum::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpectralComposite::eval(), GCTAModelSpatialGradient::eval(), GCOMModelDRBFitting::eval(), GModelSpatialRadialProfile::eval(), GCTAModelSpatialMultiplicative::eval(), GModelSpectralMultiplicative::eval(), GModelSpectralExponential::eval(), GModelSpectralTable::eval(), GCTAModelRadialGauss::eval(), GCTAModelRadialPolynom::eval(), GModelSpatialRadialShell::eval(), GCTAModelRadialProfile::eval(), GModelSpectralFunc::eval(), GSPIModelDataSpace::eval(), GModelSpectralGauss::eval(), GModelSpectralPlaw::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawEnergyFlux::eval(), GModelSpectralPlawPhotonFlux::eval(), cta_npsf_kern_rad_azsym::eval(), GModelSpectralNodes::eval(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GModelSpectralSmoothBrokenPlaw::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), cta_psf_radial_kerns_phi::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GCTAModelIrfBackground::npred_roi_kern_phi::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatial::npred_roi_kern_phi::eval(), GResponse::edisp_kerns::eval(), GObservation::npred_spec_kern::eval(), cta_irf_radial_kern_rho::eval(), GCTAEdisp2D::edisp_ereco_kern::eval(), cta_irf_radial_kern_omega::eval(), cta_nroi_radial_kern_rho::eval(), cta_nroi_radial_kern_omega::eval(), cta_irf_elliptical_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_irf_diffuse_kern_theta::eval(), cta_irf_diffuse_kern_phi::eval(), cta_nroi_diffuse_kern_theta::eval(), cta_nroi_diffuse_kern_phi::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_omega::eval(), cta_psf_radial_kern_delta::eval(), cta_psf_radial_kern_phi::eval(), cta_psf_elliptical_kern_rho::eval(), cta_psf_elliptical_kern_omega::eval(), cta_psf_diffuse_kern_delta::eval(), cta_psf_diffuse_kern_phi::eval(), GResponse::eval_prob(), GResponse::eval_probs(), GCOMResponse::irf(), GSPIResponse::irf(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GResponse::irf_elliptical(), GCTAResponseCube::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GCTAResponseCube::irf_ptsrc(), GResponse::irf_radial(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GCTAResponseIrf::nirf(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelSpatial::npred(), GModelSky::npred(), GObservation::npred_spec(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAPsfTable::precompute(), GModelSpatialDiffuseMap::prepare_map(), GCTAResponseCube::psf_elliptical(), GCTAResponseCube::psf_radial(), roi_arclength(), GIntegral::romberg(), GIntegrals::romberg(), GModelSpatialRadialShell::update(), and GCTAOnOffObservation::wstat_value().

int gammalib::iter_phi ( const double &  rho,
const double &  resolution,
const int &  iter_min,
const int &  iter_max 
)

Determine number of azimuthal Romberg iterations.

Parameters
[in]rhoRadial offset (radians).
[in]resolutionRequested angular resolution (radians).
[in]iter_minMinimum number of iterations.
[in]iter_maxMaximum number of iterations.
Returns
Number of azimuthal Romberg iterations.

Determines the number of azimuthal Romberg iterations using the formula

\[ iter = \log_2 \left( \frac{2\pi \rho}{resolution} \right) + 1 \]

where \(\rho\) is the radial offset and \(resolution\) is the required angular resolution.

The result will be constrained to the interval [iter_min,iter_max].

Definition at line 478 of file GCTASupport.cpp.

References inv_ln2, log(), resolution(), and twopi.

Referenced by GCTAModelAeffBackground::aeff_integral(), GCTAModelSpatial::npred_roi_kern_theta::eval(), cta_irf_diffuse_kern_theta::eval(), cta_psf_diffuse_kern_delta::eval(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTAModelIrfBackground::npred(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAResponseCube::psf_elliptical(), and GCTAResponseCube::psf_radial().

int gammalib::iter_rho ( const double &  rho_max,
const double &  resolution,
const int &  iter_min,
const int &  iter_max 
)

Determine number of radial Romberg iterations.

Parameters
[in]rho_maxMaximum radial offset (radians).
[in]resolutionRequested angular resolution (radians).
[in]iter_minMinimum number of iterations.
[in]iter_maxMaximum number of iterations.
Returns
Number of radial Romberg iterations.

Determines the number of radial Romberg iterations using the formula

\[ iter = \log_2 \left( \frac{\rho_{\rm max}}{resolution} \right) + 1 \]

where \(\rho_{\rm max}\) is the maximum radial offset and \(resolution\) is the required angular resolution.

The result will be constrained to the interval [iter_min,iter_max].

Definition at line 432 of file GCTASupport.cpp.

References inv_ln2, log(), and resolution().

Referenced by GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTAModelSpatial::npred(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAResponseCube::psf_diffuse(), and GCTAResponseCube::psf_elliptical().

std::string gammalib::left ( const std::string &  s,
const int &  n,
const char &  c = ' ' 
)

Left justify string to achieve a length of n characters.

Parameters
[in]sString to be centred.
[in]nRequested total width.
[in]cFill character.
Returns
Left justified string.

Left justify string by adding whitespace to the right to achieve a length of n characters.

Definition at line 960 of file GTools.cpp.

References fill().

Referenced by GApplication::log_header(), GFitsHeaderCard::print(), GFitsTableByteCol::resize_data(), GFitsTableFloatCol::resize_data(), GFitsTableShortCol::resize_data(), GFitsTableLongCol::resize_data(), GFitsTableLongLongCol::resize_data(), GFitsTableDoubleCol::resize_data(), GFitsTableUShortCol::resize_data(), GFitsTableULongCol::resize_data(), GFitsTableCDoubleCol::resize_data(), GFitsTableCFloatCol::resize_data(), GFitsTableStringCol::resize_data(), and GFitsTableBoolCol::resize_data().

cta_omega_intervals gammalib::limit_omega ( const double &  min,
const double &  max,
const double &  domega 
)

Limit omega interval.

Parameters
[in]minInterval minimum (radians).
[in]maxInterval maximum (radians).
[in]domegaHalf length of interval (radians).
Returns
Vector of intervals.

Limits an omega interval [min,max] to the interval specified by [-domega,domega]. This may lead to a split of [min,max] in several intervals. The method thus returns a vector of intervals that overlap with [-domega,domega]. If there is no overlap with the interval, the method returns an empty vector.

The method takes care of wrap arounds. It is assumed that on input [min,max] is contained within [-2pi,+2pi].

Definition at line 90 of file GCTAResponse_helpers.cpp.

References max(), min(), pi, and twopi.

Referenced by cta_irf_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_rho::eval(), and cta_psf_elliptical_kern_rho::eval().

double gammalib::modulo ( const double &  v1,
const double &  v2 
)

Returns the remainder of the division.

Parameters
[in]v1Nominator.
[in]v2Denominator.
Returns
Remainder of division

Returns the remainder of the division v1/v2. The result is non-negative. v1 can be positive or negative; v2 must be positive.

Definition at line 526 of file GMath.cpp.

Referenced by GHealpix::ang2pix_z_phi_nest(), GHealpix::ang2pix_z_phi_ring(), GSkyDir::euler(), and GHealpix::interpolator().

std::string gammalib::number ( const std::string &  noun,
const int &  number 
)

Convert singular noun into number noun.

Parameters
[in]nounSingular noun.
[in]numberNumber of instance of noun.
Returns
Converted noun.

Converts a singular noun into a number noun by appending a "s" to the noun if the number of the instances of the noun is not one.

Definition at line 1057 of file GTools.cpp.

Referenced by GMatrixSparse::add_to_column(), GMatrixSparse::column(), GSkyMap::create_healpix_hdu(), GFitsTable::data_open(), GOptimizerPars::GOptimizerPars(), GModelSpatialRadialProfile::num_nodes(), GMatrixSparse::stack_push_column(), xml2str(), xml_get_par(), and xml_need_par().

std::string gammalib::parformat ( const std::string &  s,
const int &  indent = 0 
)

Convert string in parameter format.

Parameters
[in]sString to be converted.
[in]indentIndentation of parameter.
Returns
Parameter string.

Converts and string into the parameter format of type "s ......: " with a total length of G_PARFORMAT_LENGTH.

Definition at line 1033 of file GTools.cpp.

References fill(), and G_PARFORMAT_LENGTH.

Referenced by GApplication::log_value(), GLATEfficiency::print(), GLATRoi::print(), GCOMInstDir::print(), GCOMRoi::print(), GCOMSelection::print(), GCOMOad::print(), GCOMStatus::print(), GBilinear::print(), GUrlFile::print(), GFftWavetable::print(), GPhases::print(), GUrlString::print(), GCTARoi::print(), GVOHub::print(), GCOMTim::print(), GModelSpatialRadialProfileGauss::print(), GModelSpectralTablePar::print(), GPhotons::print(), GTimes::print(), GModelSpatialRadialProfileDMEinasto::print(), GModelSpatialRadialProfileDMBurkert::print(), GModelSpatialRadialProfileDMZhao::print(), GCTAModelRadialRegistry::print(), GModelRegistry::print(), GObservationRegistry::print(), GRan::print(), GWcsRegistry::print(), GCOMIaq::print(), GLATObservation::print(), GModelTemporalRegistry::print(), GOptimizerLM::print(), GCTAModelSpatialRegistry::print(), GModelSpatialRegistry::print(), GModelSpectralRegistry::print(), GResponseVectorCache::print(), GCTAModelSpatialGaussSpectrum::print(), GCTAModelIrfBackground::print(), GMWLObservation::print(), GHealpix::print(), GCTAModelSpatialGradient::print(), GModelSpatialComposite::print(), GCOMInstChars::print(), GCTAModelAeffBackground::print(), GCOMModelDRBFitting::print(), GMWLSpectrum::print(), GCTAAeffPerfTable::print(), GCTABackgroundPerfTable::print(), GCTAModelSpatialMultiplicative::print(), GModelSpatialDiffuseConst::print(), GCOMEventList::print(), GModelSpatialRadialDisk::print(), GModelSpatialRadialRing::print(), GCOMD1Response::print(), GModelTemporalConst::print(), GSPIObservation::print(), GModelSpatialPointSource::print(), GModelSpatialRadialGauss::print(), GFitsTable::print(), GCTAAeffArf::print(), GCOMOads::print(), GLATEventCube::print(), GModelSpectralTablePars::print(), GLATMeanPsf::print(), GLATResponse::print(), GFitsImage::print(), GModelSpatialEllipticalDisk::print(), GCOMDri::print(), GLATEventList::print(), GDerivative::print(), GCOMEventCube::print(), GCTAModelCubeBackground::print(), GModelSpatialEllipticalGauss::print(), GModelSpectralComposite::print(), GCOMD2Response::print(), GLATResponseTable::print(), GSPIEventCube::print(), GCTAModelRadialGauss::print(), GCTAModelRadialAcceptance::print(), GCTABackground3D::print(), GCTAPointing::print(), GVOClient::print(), GModelSpectralMultiplicative::print(), GCTAAeff2D::print(), GModelSpatialDiffuseMap::print(), GCOMResponse::print(), GCTAModelRadialPolynom::print(), GModelSpectralExponential::print(), GCTAModelRadialProfile::print(), GCTAModelBackground::print(), GLATPsf::print(), GModelTemporalLightCurve::print(), GIntegral::print(), GCTAModelSpatialLookup::print(), GIntegrals::print(), GLATEdisp::print(), GCTAEventList::print(), GSPIModelDataSpace::print(), GCTACubeBackground::print(), GSPIResponse::print(), GOptimizerPars::print(), GModelSpectralConst::print(), GModelSpectralTable::print(), GTestSuites::print(), GFft::print(), GModelSpatialRadialShell::print(), GSkyRegions::print(), GCsv::print(), GSkyRegionCircle::print(), GLATLtCubeMap::print(), GModelSpatialDiffuseCube::print(), GModelSpectralFunc::print(), GCTAEventCube::print(), GLATAeff::print(), GModelSpectralGauss::print(), GCOMObservation::print(), GCTAPsfPerfTable::print(), GCTAPsfVector::print(), GModelSpectralPlaw::print(), GResponseCache::print(), GCTACubeExposure::print(), GCTAResponseIrf::print(), GCTAObservation::print(), GCTAPsf2D::print(), GCTAPsfTable::print(), GFitsTableCol::print(), GCTAPsfKing::print(), GCaldb::print(), GTimeReference::print(), GModelSpectralExpPlaw::print(), GApplicationPar::print(), GModelSpectralLogParabola::print(), GCTAOnOffObservation::print(), GModelSpectralBrokenPlaw::print(), GCTAEdispRmf::print(), GEnergies::print(), GCTAResponseCube::print(), GFilename::print(), GModelSpectralExpInvPlaw::print(), GModelTemporalPhaseCurve::print(), GModelSpectralSuperExpPlaw::print(), GCTACubePsf::print(), GRmf::print(), GNodeArray::print(), GGti::print(), GCTACubeEdisp::print(), GArf::print(), GCTAEdispPerfTable::print(), GCTAResponseTable::print(), GModelSpectralPlawEnergyFlux::print(), GModelSpectralPlawPhotonFlux::print(), GModelSpectralNodes::print(), GApplication::print(), GModelSpectralSmoothBrokenPlaw::print(), GMatrixSymmetric::print(), GFits::print(), GTestSuite::print(), GEbounds::print(), GMatrix::print(), GCTAEdisp2D::print(), GObservations::print(), GPha::print(), GModelSky::print(), GOptimizerPar::print(), GSkyMap::print(), GModels::print(), GMatrixSparse::print(), GModel::print_attributes(), GMatrixBase::print_col_compression(), GFitsHDU::print_hdu(), GMatrixBase::print_row_compression(), and GWcs::wcs_print().

double gammalib::plaw_energy_flux ( const double &  emin,
const double &  emax,
const double &  epivot,
const double &  gamma 
)

Compute energy flux between two energies for a power law.

Parameters
[in]eminMinimum energy.
[in]emaxMaximum energy.
[in]epivotPivot energy.
[in]gammaSpectral index.
Returns
Energy flux under power law.

Analytically computes

\[\int_{E_{\rm min}}^{E_{\rm max}} \left( E/E_{\rm pivot} \right)^{\gamma} E dE\]

where \(E_{\rm min}\) and \(E_{\rm max}\) are the minimum and maximum energy, respectively, and \(E_{\rm pivot}\) is the pivot energy, and \(\gamma\) is the spectral index.

Definition at line 1138 of file GTools.cpp.

References abs(), log(), and pow().

Referenced by GModelSpectralTable::eflux(), GModelSpectralFunc::eflux(), GModelSpectralPlaw::eflux(), GModelSpectralBrokenPlaw::eflux(), GModelSpectralNodes::eflux(), GModelSpectralFunc::set_cache(), GModelSpectralNodes::set_flux_cache(), and GModelSpectralTable::update_flux().

double gammalib::plaw_integral ( const double &  x1,
const double &  f1,
const double &  x2,
const double &  f2 
)

Returns the integral of a power law.

Parameters
[in]x1First x value.
[in]f1Power law value at first x value.
[in]x2Second x value.
[in]f2Power law value at second x value.
Returns
Integral of power law

Analytically computes

\[\int_{x_1}^{x_2} F_1 \left( \frac{x}{x_1} \right)^m dx\]

where

\[m = \frac{\ln (F_2 / F_1)}{\ln (x_2 / x_1)}\]

and \(F_1\) is the power law value at point \(x_1\) and \(F_2\) is the power law value at point \(x_2\).

Definition at line 566 of file GMath.cpp.

References abs(), log(), and pow().

Referenced by GCTACubeBackground::fill(), GCTABackgroundPerfTable::rate_ebin(), and GCTABackground3D::rate_ebin().

double gammalib::plaw_photon_flux ( const double &  emin,
const double &  emax,
const double &  epivot,
const double &  gamma 
)

Compute photon flux between two energies for a power law.

Parameters
[in]eminMinimum energy.
[in]emaxMaximum energy.
[in]epivotPivot energy.
[in]gammaSpectral index.
Returns
Photon flux under power law.

Analytically computes

\[\int_{E_{\rm min}}^{E_{\rm max}} \left( E/E_{\rm pivot} \right)^{\gamma} dE\]

where \(E_{\rm min}\) and \(E_{\rm max}\) are the minimum and maximum energy, respectively, and \(E_{\rm pivot}\) is the pivot energy, and \(\gamma\) is the spectral index.

Definition at line 1090 of file GTools.cpp.

References abs(), log(), and pow().

Referenced by GModelSpectralTable::flux(), GModelSpectralFunc::flux(), GModelSpectralPlaw::flux(), GModelSpectralBrokenPlaw::flux(), GModelSpectralNodes::flux(), GModelSpectralFunc::mc_update(), GModelSpectralNodes::mc_update(), GModelSpectralFunc::set_cache(), GModelSpectralNodes::set_flux_cache(), GModelSpectralTable::update_flux(), GModelSpectralTable::update_mc(), and GModelSpectralBrokenPlaw::update_mc_cache().

GEbounds gammalib::read_ds_ebounds ( const GFitsHDU hdu)

Read energy boundary data sub-space keywords.

Parameters
[in]hduFITS HDU
Exceptions
GException::invalid_valueInvalid energy data sub-space encountered

Reads the energy boundary data sub-space keywords by searching for a DSTYPx keyword named "ENERGY". The data sub-space information is expected to be in the format "200:50000", where the 2 arguments are the minimum and maximum energy. The energy unit is given by the keyword DSUNIx, which supports keV, MeV, GeV and TeV (case independent). No detailed syntax checking is performed.

Definition at line 180 of file GCTASupport.cpp.

References GEbounds::append(), G_READ_DS_EBOUNDS, GFitsHDU::has_card(), GFitsHDU::integer(), split(), str(), GFitsHDU::string(), and todouble().

Referenced by GCTAEventList::read().

std::string gammalib::read_ds_gti_extname ( const GFitsHDU hdu)

Return Good Time Intervals extension name from data sub-space keywords.

Parameters
[in]hduFITS HDU
Returns
Good Time Interval extension name
Exceptions
GException::invalid_valueInvalid Good Time Intervals data sub-space encountered

Returns the name of the FITS extension that contains the Good Time Intervals by screening the data sub-space keywords that are present in the FITS header. The method searches for a DSTYPx keyword named "TIME" and a corresponding DSVALx keyword named "TABLE", and the extension name is extracted from the corresponding DSREFx keyword. Note that by convention the extension name is preceeded by a colon, which is stripped by this method.

Definition at line 308 of file GCTASupport.cpp.

References G_READ_DS_GTI, GFitsHDU::has_card(), GFitsHDU::integer(), str(), GFitsHDU::string(), strip_chars(), and strip_whitespace().

Referenced by GCTAEventList::read().

GPhases gammalib::read_ds_phase ( const GFitsHDU hdu)

Read phase boundary data sub-space keywords.

Parameters
[in]hduFITS HDU
Returns
Phase intervals
Exceptions
GException::invalid_valueInvalid phase data sub-space encountered

Reads the phase boundary data sub-space keywords by searching for a DSTYPx keyword named "PHASE". The data sub-space information is expected to be in the format "0.1:0.3,0.5:0.7", where each subset of numbers represents the minimum and maximum phase. No detailed syntax checking is performed.

Definition at line 242 of file GCTASupport.cpp.

References GPhases::append(), G_READ_DS_PHASE, GFitsHDU::has_card(), GFitsHDU::integer(), split(), str(), GFitsHDU::string(), and todouble().

Referenced by GCTAEventList::read().

GCTARoi gammalib::read_ds_roi ( const GFitsHDU hdu)

Extract ROI from data sub-space keywords.

Parameters
[in]hduFITS HDU
Exceptions
GException::invalid_valueInvalid ROI data sub-space encountered

Reads the ROI data sub-space keywords by searching for a DSTYPx keyword named "POS(RA,DEC)". The data sub-space information is expected to be in the format "CIRCLE(267.0208,-24.78,4.5)", where the 3 arguments are Right Ascension, Declination and radius in units of degrees. No detailed syntax checking is performed.

If no ROI information has been found, an GCTARoi object with initial values will be returned.

Definition at line 92 of file GCTASupport.cpp.

References GCTARoi::centre(), G_READ_DS_ROI, GFitsHDU::has_card(), GCTAPointing::instdir(), GFitsHDU::integer(), GSkyDir::radec_deg(), GCTARoi::radius(), GFitsHDU::real(), split(), str(), GFitsHDU::string(), strip_chars(), and todouble().

Referenced by GCTAEventList::read().

int gammalib::recv ( int  fd,
char *  buffer,
int  len,
int  flags,
int  timeout 
)

Checks whether a parameter has occured once.

Parameters
[in]fdSocket file descriptor.
[out]bufferBuffer to hold data.
[in]lenMaximum number of bytes to recv().
[in]flagsFlags (as the fourth param to recv() ).
[in]timeoutTimeout in milliseconds.
Returns
recv() error code, -2 == timeout

This function implements the recv() function with a timeout. The timeout is specified in milliseconds.

Definition at line 1809 of file GTools.cpp.

Referenced by GVOHub::handle_request(), and GVOClient::receive_string().

std::string gammalib::replace_segment ( const std::string &  arg,
const std::string &  segment,
const std::string &  replacement 
)

Replace string segment in string.

Parameters
[in]argString in which character segements are to be replaced
[in]segmentString segment to be replaced.
[in]replacementReplacement string.
Returns
String with replaced segements.

Replaces string segments by a replacement string in a given string.

If the input string arg is "Wonderful", the segment is "onder" and the replacement is "ish" the method will return "Wishful".

Definition at line 163 of file GTools.cpp.

Referenced by GFitsTable::update_header().

double gammalib::resolution ( const GModelSpatial model)

Determine resolution of spatial model.

Parameters
[in]modelPointer to spatial model.
Returns
Resolution of spatial model (radians).

Determine the resolution of a spatial model. So far the method only works for a spatial map or cube model holding a WCS projection. If a constant spatial model is encountered a resolution of 180 deg is returned.

If the resolution of the model could not be determined, the method returns a resolution of 0.01 deg.

Definition at line 178 of file GCTAResponse_helpers.cpp.

References abs(), GWcs::cdelt(), GModelSpatialDiffuseCube::cube(), deg2rad, GModelSpatialDiffuseMap::map(), pi, and GSkyMap::projection().

Referenced by GCTAResponseIrf::irf_diffuse(), iter_phi(), iter_rho(), GCTAResponseCube::psf_diffuse(), and GSkyRegionMap::set_region_circle().

std::string gammalib::right ( const std::string &  s,
const int &  n,
const char &  c = ' ' 
)

Right justify string to achieve a length of n characters.

Parameters
[in]sString to be centred.
[in]nRequested total width.
[in]cFill character.
Returns
Right justified string.

Right justify string by adding whitespace to the left to achieve a length of n characters.

Definition at line 984 of file GTools.cpp.

References fill().

Referenced by GFitsHeaderCard::print(), and GFitsTableCol::print().

double gammalib::roi_arclength ( const double &  rad,
const double &  dist,
const double &  cosdist,
const double &  sindist,
const double &  roi,
const double &  cosroi 
)

Returns length of circular arc within circular ROI.

Parameters
[in]radCircle radius in radians (<pi).
[in]distCircle centre distance to ROI centre (<pi).
[in]cosdistCosine of circle centre distance to ROI centre.
[in]sindistSinus of circle centre distance to ROI centre.
[in]roiRadius of ROI in radians.
[in]cosroiCosine of ROI radius.

This method returns the arclength in radians of a circle of radius 'rad' with a centre that is offset by 'dist' from the ROI centre, where the ROI radius is given by 'roi'. To speed-up computations, the cosines and sinus of 'roi' and 'psf' should be calculated by the client and be passed to the method.

Definition at line 1880 of file GTools.cpp.

References acos(), cos(), is_infinite(), is_notanumber(), sin(), and twopi.

Referenced by cta_psf_radial_kerns_delta::eval(), cta_npsf_kern_rad_azsym::eval(), GCTAModelRadialAcceptance::roi_kern::eval(), GModelSpatial::circle_int_kern_rho::eval(), cta_irf_radial_kern_rho::eval(), cta_nroi_radial_kern_rho::eval(), cta_irf_elliptical_kern_rho::eval(), cta_nroi_elliptical_kern_rho::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_delta::eval(), and cta_psf_elliptical_kern_rho::eval().

std::string gammalib::rstrip_chars ( const std::string &  arg,
const std::string &  chars 
)

Strip trailing character from string.

Parameters
[in]argString from which character should be stripped.
[in]charsCharacter(s) to be stripped.
Returns
String with stripped characters.

Definition at line 126 of file GTools.cpp.

void gammalib::sincosd ( const double &  angle,
double *  s,
double *  c 
)

Compute sine and cosine of angle in degrees.

Parameters
[in]angleAngle [degrees].
[out]sSine of angle.
[out]cCosine of angle.

This code has been adapted from the WCSLIB function wcstrig.c::sincosd().

Definition at line 342 of file GMath.cpp.

References abs(), cos(), deg2rad, and sin().

Referenced by GWcs::cel_set(), GWcsTAN::prj_s2x(), GWcsAIT::prj_s2x(), GWcsSIN::prj_s2x(), GWcsSTG::prj_s2x(), GWcsARC::prj_s2x(), GWcsAZP::prj_s2x(), GWcs::sph_s2x(), and GWcs::sph_x2s().

double gammalib::sind ( const double &  angle)

Compute sine of angle in degrees.

Parameters
[in]angleAngle in degrees

This code has been adapted from the WCSLIB function wcstrig.c::sind().

Definition at line 163 of file GMath.cpp.

References abs(), deg2rad, and sin().

Referenced by GWcs::cel_set(), GWcsTAN::prj_s2x(), GWcsSTG::prj_s2x(), GWcsSIN::prj_s2x(), and GWcsAZP::prj_set().

GTimes gammalib::spi_annealing_start_times ( void  )

Return start time of annealing operations.

Returns
Start time of annealing operations.

Returns the start time of the SPI annealing operations.

Source: https://www.cosmos.esa.int/web/integral/long-term-plan

Definition at line 248 of file GSPITools.cpp.

References GTimes::append().

Referenced by GSPIModelDataSpace::add_gedanneal().

GTimes gammalib::spi_gedfail_times ( void  )

Return times of detector failures.

Returns
Times of detector failures.

Returns the times of detector failures.

Definition at line 301 of file GSPITools.cpp.

References GTimes::append().

Referenced by GSPIModelDataSpace::add_gedfail().

const GFitsTable * gammalib::spi_hdu ( const GFits fits,
const std::string &  extname,
const int &  extver = 1 
)

Return FITS table.

Parameters
[in]fitsFITS file.
[in]extnameExtension name.
[in]extverExtension version.
Returns
Pointer to FITS table.

Returns the HDU with a specific extension name and version from the FITS file. The method searched in the FITS file as well as grouping tables and nested grouping tables.

The method allocates a copy of the HDU, hence the client needs to deallocate the HDU after usage.

Definition at line 57 of file GSPITools.cpp.

References GFitsTable::clone(), GFitsHDU::extname(), GFits::filename(), filepath(), GFitsHDU::has_card(), GFitsHDU::integer(), GFitsTable::nrows(), GFilename::path(), GFits::size(), and GFitsHDU::string().

Referenced by GSPIResponse::load_irfs(), GSPIEventCube::read(), and GSPIEventCube::read_models().

GTime gammalib::spi_ijd2time ( const double &  ijd)

Convert IJD to GTime.

Parameters
[in]ijdINTEGRAL Julian Days (days).
Returns
time.

Converts time given in INTEGRAL Julian Days into a GTime object.

Definition at line 225 of file GSPITools.cpp.

References GTime::mjd().

Referenced by GSPIEventCube::read_gti().

int gammalib::spi_num_hdus ( const GFits fits,
const std::string &  extname 
)

Return number of HDU versions.

Parameters
[in]fitsFITS file.
[in]extnameExtension name.
Returns
Number of HDU versions.

Returns the number of HDU versions with a specific extension name in the FITS file and associated or nested grouping tables.

Definition at line 166 of file GSPITools.cpp.

References GFitsHDU::extname(), GFits::filename(), filepath(), GFitsTable::nrows(), GFilename::path(), GFits::size(), and GFitsHDU::string().

Referenced by GSPIResponse::load_irfs(), and GSPIEventCube::read().

std::vector< std::string > gammalib::split ( const std::string &  s,
const std::string &  sep 
)

Split string.

Parameters
[in]sString to be splitted.
[in]sepSeparator(s).
Returns
Vector of split strings.

Splits a string on the basis of one or multiple separator characters. The separator characters are provided by the sep argument. Subsequent separator characters that are not seperated by some other characters will lead to an empty string element, except for a blank separator where subsequent blanks are takens as a single separator. Below a few examples that illustrate how the function will split a given string.

"Name;RA;DEC" => ["Name","RA","DEC"] (sep=";")
"My house is    red" => ["My","house","is","red"] (sep=" ")
"IRF::FRONT" => ["IRF","","FRONT"] (sep=":")
"Fields;RA,DEC,Flux" => ["Fields","RA","DEC","Flux"] (sep=";,")
"Last;Field;" => ["Last","Field",""] (sep=";")

Definition at line 873 of file GTools.cpp.

Referenced by GApplicationPar::check_options(), GFitsTable::data_open(), GXmlNode::element(), GModel::ids(), GApplicationPars::inpath(), GModel::instruments(), GCTABackgroundPerfTable::load(), GCTAAeffPerfTable::load(), GCTAPsfPerfTable::load(), GCsv::load(), GCTAEdispPerfTable::load(), GLATResponse::load(), GApplicationPars::outpath(), GApplicationPars::pfiles_path(), GSkyRegionCircle::read(), read_ds_ebounds(), read_ds_phase(), read_ds_roi(), GCTAObservation::save(), GCTAModelSpatialMultiplicative::write(), GModelSpectralComposite::write(), and GModelSpectralMultiplicative::write().

std::string gammalib::str ( const unsigned short int &  value)

Convert unsigned short integer value into string.

Parameters
[in]valueUnsigned short integer to be converted into string.
Returns
String with unsigned short integer value.

Definition at line 415 of file GTools.cpp.

Referenced by GIntegral::adaptive_simpson(), GCTAModelAeffBackground::aeff_integral(), GModelSpectralTablePars::append(), GApplicationPars::append(), GCTAModelSpatialMultiplicative::append(), GModelSpatialComposite::append(), GCsv::append(), GModelSpectralComposite::append(), GModelSpectralMultiplicative::append(), GArf::append(), GPha::append(), GObservations::append(), GModelSpectralNodes::append(), GModels::append(), GCTAResponseTable::append_axis(), GCTAEventList::append_column(), GCTAOnOffObservation::arf_rad_max(), GFitsTableCDoubleCol::ascii_format(), GFitsTableCFloatCol::ascii_format(), GFitsTableStringCol::ascii_format(), GFitsTableBitCol::ascii_format(), GFitsTableBoolCol::ascii_format(), GFits::at(), GNdarray::at(), GFft::backward(), GCTAException::bad_rsp_table_dim::bad_rsp_table_dim(), GWcs::cel_set(), GCOMDri::compute_dre(), GCTAPsfVector::containment_radius(), GCTAPsfPerfTable::containment_radius(), GCTAPsf2D::containment_radius(), GCTAPsfKing::containment_radius(), GCTAPsfTable::containment_radius(), GResponse::convolve(), GFitsHeaderCard::copy_dtype(), GException::csv_bad_columns::csv_bad_columns(), GCOMStatus::d1status(), GCOMStatus::d2status(), GFitsTable::data_open(), GFitsTableCol::elements(), GModelSpatialDiffuseCube::energies(), GException::erange_invalid::erange_invalid(), GModelSpatialRadialGauss::eval(), GModelSpectralPlaw::eval(), GModelData::eval(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), cta_psf_radial_kerns_phi::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GCTAModelIrfBackground::npred_roi_kern_phi::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatial::npred_roi_kern_phi::eval(), GModelSpectralTablePars::extend(), GApplicationPars::extend(), GObservations::extend(), GModels::extend(), GSkyMap::extract(), GTime::extract_timesys(), GOptimizerPar::factor_max(), GOptimizerPar::factor_min(), GOptimizerPar::factor_value(), GCTAEventList::fetch(), GVOTable::field_from_fits_column(), GException::file_function_columns::file_function_columns(), GException::file_function_data::file_function_data(), GException::file_function_value::file_function_value(), GException::fits_bad_bitpix::fits_bad_bitpix(), GException::fits_bad_col_length::fits_bad_col_length(), GException::fits_column_not_found::fits_column_not_found(), GException::fits_error::fits_error(), GException::fits_file_exist::fits_file_exist(), GException::fits_hdu_not_found::fits_hdu_not_found(), GException::fits_hdu_not_image::fits_hdu_not_image(), GException::fits_hdu_not_table::fits_hdu_not_table(), GException::fits_inconsistent_tdim::fits_inconsistent_tdim(), GException::fits_invalid_nrows::fits_invalid_nrows(), GException::fits_invalid_row::fits_invalid_row(), fits_move_to_hdu(), GException::fits_no_data::fits_no_data(), GException::fits_no_header::fits_no_header(), GException::fits_open_error::fits_open_error(), GException::fits_unknown_coltype::fits_unknown_coltype(), GException::fits_unknown_HDU_type::fits_unknown_HDU_type(), GException::fits_unknown_tabtype::fits_unknown_tabtype(), GException::fits_wrong_image_operator::fits_wrong_image_operator(), GFft::forward(), GFitsHeaderCard::free_dtype(), GIntegral::gauss_kronrod(), GCTACubeEdisp::GCTACubeEdisp(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GCTAModelSpatialLookup::GCTAModelSpatialLookup(), GVOHub::get_socket(), GModelSpectralTable::GModelSpectralTable(), GException::gradient_par_mismatch::gradient_par_mismatch(), GFits::image(), GLATException::inconsistent_response::inconsistent_response(), GModelSpectralTablePars::insert(), GApplicationPars::insert(), GObservations::insert(), GModelSpectralNodes::insert(), GModels::insert(), GPhases::insert_interval(), GMatrixSparse::insert_row(), GApplicationPar::integer(), GCsv::integer(), GModelSpectralNodes::intensity(), GHealpix::interpolator(), GException::invalid_order::invalid_order(), GLATResponse::irf(), GCTAResponseCube::irf_radial(), GFitsTableCol::load_column_variable(), GModelSpatialDiffuseCube::load_cube(), GModelTemporalLightCurve::load_nodes(), GModelTemporalPhaseCurve::load_nodes(), GException::matrix_mismatch::matrix_mismatch(), GException::matrix_not_pos_definite::matrix_not_pos_definite(), GException::matrix_not_square::matrix_not_square(), GException::matrix_not_symmetric::matrix_not_symmetric(), GException::matrix_vector_mismatch::matrix_vector_mismatch(), GOptimizerPar::max(), GCTABackground3D::mc(), GCTAResponseIrf::mc(), GCTAEdisp2D::mc(), GModelSpatialDiffuseConst::mc_norm(), GException::mem_alloc::mem_alloc(), GOptimizerPar::min(), GDerivative::minuit2(), GObservation::model(), GException::model_invalid_parscale::model_invalid_parscale(), GModelTemporalPhaseCurve::normalize_nodes(), GException::not_enough_nodes::not_enough_nodes(), GVOHub::notify(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelSpatial::npred(), GFits::open(), GCTAResponseTable::operator()(), GSkyMap::operator*=(), GSkyMap::operator+=(), GSkyMap::operator-=(), GSkyMap::operator/=(), GOptimizerLM::optimize(), GException::out_of_range::out_of_range(), GApplicationPars::parse(), GApplicationPars::pickle(), GApplicationPar::pickle(), GIntegral::polint(), GIntegrals::polint(), GVOClient::post_string(), GVOHub::post_string(), GLATEfficiency::print(), GLATRoi::print(), GCOMSelection::print(), GCOMInstDir::print(), GCOMRoi::print(), GCOMEventAtom::print(), GCOMOad::print(), GBilinear::print(), GCOMStatus::print(), GUrlFile::print(), GLATInstDir::print(), GFftWavetable::print(), GPhases::print(), GUrlString::print(), GCTARoi::print(), GModelSpatialRadialProfileGauss::print(), GCOMTim::print(), GModelSpectralTablePar::print(), GModelSpatialRadialProfileDMBurkert::print(), GModelSpatialRadialProfileDMEinasto::print(), GModelSpatialRadialProfileDMZhao::print(), GSPIInstDir::print(), GPhotons::print(), GTimes::print(), GCTAModelRadialRegistry::print(), GModelRegistry::print(), GObservationRegistry::print(), GRan::print(), GCOMIaq::print(), GMWLDatum::print(), GWcsRegistry::print(), GLATObservation::print(), GModelSpatialRegistry::print(), GModelSpectralRegistry::print(), GModelTemporalRegistry::print(), GCTAModelSpatialRegistry::print(), GOptimizerLM::print(), GResponseVectorCache::print(), GCOMEventBin::print(), GLATEventBin::print(), GCTAModelIrfBackground::print(), GHealpix::print(), GCTAModelSpatialGradient::print(), GCOMInstChars::print(), GPhoton::print(), GModelSpatialComposite::print(), GModelSpatialDiffuseConst::print(), GCTABackgroundPerfTable::print(), GMWLSpectrum::print(), GCTAEventBin::print(), GCTAModelSpatialMultiplicative::print(), GCTAModelAeffBackground::print(), GCOMModelDRBFitting::print(), GCTAAeffPerfTable::print(), GModelSpatialRadialDisk::print(), GModelSpatialRadialRing::print(), GCOMEventList::print(), GCOMD1Response::print(), GModelSpatialPointSource::print(), GModelSpatialRadialGauss::print(), GSPIObservation::print(), GModelTemporalConst::print(), GCOMOads::print(), GFitsTable::print(), GCTAAeffArf::print(), GLATEventCube::print(), GLATMeanPsf::print(), GModelSpatialEllipticalDisk::print(), GModelSpectralTablePars::print(), GCOMDri::print(), GFitsImage::print(), GLATEventList::print(), GModelSpatialEllipticalGauss::print(), GModelSpectralComposite::print(), GDerivative::print(), GCTAInstDir::print(), GCOMEventCube::print(), GCTAModelCubeBackground::print(), GCTABackground3D::print(), GLATResponseTable::print(), GCTAModelRadialAcceptance::print(), GSPIEventCube::print(), GCOMD2Response::print(), GModelSpectralMultiplicative::print(), GCTAModelRadialGauss::print(), GModelSpatialDiffuseMap::print(), GModelSpectralExponential::print(), GCTAModelRadialPolynom::print(), GCOMResponse::print(), GHorizDir::print(), GCTAAeff2D::print(), GCTAModelRadialProfile::print(), GLATPsf::print(), GCTAModelBackground::print(), GSPIEventBin::print(), GModelTemporalLightCurve::print(), GCTAModelSpatialLookup::print(), GIntegral::print(), GIntegrals::print(), GCTAEventList::print(), GLATEdisp::print(), GSPIModelDataSpace::print(), GModelSpectralConst::print(), GModelSpectralTable::print(), GSPIResponse::print(), GOptimizerPars::print(), GModelSpatialRadialShell::print(), GFft::print(), GTestSuites::print(), GFitsHeader::print(), GSkyRegions::print(), GCsv::print(), GLATLtCubeMap::print(), GModelSpatialDiffuseCube::print(), GModelSpectralFunc::print(), GCTAEventCube::print(), GSkyRegionCircle::print(), GModelSpectralGauss::print(), GLATAeff::print(), GCOMObservation::print(), GCTAPsfPerfTable::print(), GCTAPsfVector::print(), GModelSpectralPlaw::print(), GFitsHeaderCard::print(), GResponseCache::print(), GCTACubeExposure::print(), GCTAResponseIrf::print(), GCTAObservation::print(), GCTAPsf2D::print(), GCTAPsfTable::print(), GCTAPsfKing::print(), GFitsTableCol::print(), GTimeReference::print(), GCaldb::print(), GModelSpectralExpPlaw::print(), GModelSpectralLogParabola::print(), GCTAOnOffObservation::print(), GCTAEdispRmf::print(), GModelSpectralBrokenPlaw::print(), GEnergies::print(), GModelSpectralExpInvPlaw::print(), GFilename::print(), GModelSpectralSuperExpPlaw::print(), GModelTemporalPhaseCurve::print(), GEnergy::print(), GCTACubePsf::print(), GSkyDir::print(), GNodeArray::print(), GRmf::print(), GCTACubeEdisp::print(), GGti::print(), GSkyPixel::print(), GArf::print(), GCTAEdispPerfTable::print(), GModelSpectralPlawEnergyFlux::print(), GModelSpectralPlawPhotonFlux::print(), GCTAResponseTable::print(), GModelSpectralNodes::print(), GVector::print(), GTime::print(), GModelSpectralSmoothBrokenPlaw::print(), GMatrixSymmetric::print(), GFits::print(), GTestSuite::print(), GNdarray::print(), GEbounds::print(), GMatrix::print(), GCTAEdisp2D::print(), GObservations::print(), GPha::print(), GModelSky::print(), GOptimizerPar::print(), GSkyMap::print(), GModels::print(), GMatrixSparse::print(), GModel::print_attributes(), GMatrixBase::print_col_compression(), GMatrixBase::print_elements(), GFitsHDU::print_hdu(), GMatrixBase::print_row_compression(), GCTARoi::radius(), GSkyRegionCircle::radius(), GVOHub::random_string(), GCOMModelDRBFitting::read(), GLATPsf::read(), GCOMOads::read(), GCTAModelRadialPolynom::read(), GSkyRegionCircle::read(), GCTAAeff2D::read(), GCTAModelSpatialLookup::read(), GCTAPsfTable::read(), GCTAPsf2D::read(), GModelPar::read(), GCTAPsfKing::read(), GModelSpatialDiffuseCube::read(), GFitsHeaderCard::read(), GModelSpectralNodes::read(), GPha::read(), GCTAEdisp2D::read(), GCTAResponseTable::read_axes(), read_ds_ebounds(), read_ds_gti_extname(), read_ds_phase(), read_ds_roi(), GSPIEventCube::read_ebds(), GSPIEventCube::read_models(), GSPIEventCube::read_pnt(), GCTAResponseTable::read_tables(), GSkyMap::read_wcs(), GApplicationPar::real(), GCsv::real(), GVOClient::register_to_hub(), GVOHub::request_register(), GFft::require_same_shape(), GNdarray::require_same_shape(), GIntegral::romberg(), GIntegrals::romberg(), GFitsTableCol::save_column_variable(), GModelSpectralTablePars::set(), GEnergies::set(), GTime::set(), GObservations::set(), GModels::set(), GFftWavetable::set_factors(), GCTAEventList::set_mc_id_names(), GFftWavetable::set_members(), GCTABackground3D::set_members(), GApplicationPar::set_status(), GSPIModelDataSpace::setup_date(), GSPIModelDataSpace::setup_dete(), GSPIModelDataSpace::setup_ebin(), GSPIModelDataSpace::setup_evtclass(), GSPIModelDataSpace::setup_point(), GNdarray::shape(), GSkyMap::shape(), GException::skymap_bad_image_dim::skymap_bad_image_dim(), GException::skymap_bad_par::skymap_bad_par(), GException::skymap_bad_size::skymap_bad_size(), GDerivative::smooth_robust(), GVOHub::start_hub(), GFitsTableULongCol::string(), GFitsTableLongCol::string(), GFitsTableUShortCol::string(), GFitsTableDoubleCol::string(), GFitsTableFloatCol::string(), GFitsTableShortCol::string(), GFitsTableByteCol::string(), GFitsTableLongLongCol::string(), GFitsTableCDoubleCol::string(), GFitsTableCFloatCol::string(), GFits::table(), GTestSuite::test_value(), GFitsTableCol::tform_binary(), tochar(), GIntegral::trapzd(), GIntegrals::trapzd(), GCOMStatus::update_cache(), GFitsTable::update_header(), GModelSpectralNodes::update_pars(), GTime::utc(), GDerivative::value(), GFitsHeaderCard::value(), GException::vector_bad_cross_dim::vector_bad_cross_dim(), GException::vector_mismatch::vector_mismatch(), GException::wcs_hpx_bad_nside::wcs_hpx_bad_nside(), GException::wcs_invalid_phi_theta::wcs_invalid_phi_theta(), GException::wcs_invalid_x_y::wcs_invalid_x_y(), GWcs::wcs_p2s(), GWcs::wcs_print(), GWcs::wcs_print_value(), GWcs::wcs_s2p(), GException::wcs_singular_matrix::wcs_singular_matrix(), GModelSpatialComposite::write(), GCOMModelDRBFitting::write(), GCTAModelSpatialMultiplicative::write(), GCTARoi::write(), GWcs::write(), GSPIObservation::write(), GModelSpectralComposite::write(), GCTAPointing::write(), GModelSpectralMultiplicative::write(), GCTAModelRadialPolynom::write(), GTimeReference::write(), GSPIModelDataSpace::write(), GSkyRegionCircle::write(), GCTAResponseIrf::write(), GCTAObservation::write(), GTestSuites::write(), GGti::write(), GModelPar::write(), GFitsHeaderCard::write(), GEbounds::write(), GModelSpectralNodes::write(), GModel::write_attributes(), GCTAEventList::write_ds_keys(), GCTAEventList::write_mc_ids(), GModel::write_scales(), and xml_check_par().

std::string gammalib::str ( const unsigned int &  value)

Convert unsigned integer value into string.

Parameters
[in]valueUnsigned integer to be converted into string.
Returns
String with unsigned integer value.

Definition at line 429 of file GTools.cpp.

std::string gammalib::str ( const unsigned long int &  value)

Convert unsigned long integer value into string.

Parameters
[in]valueUnsigned long integer to be converted into string.
Returns
String with unsigned long integer value.

Definition at line 443 of file GTools.cpp.

std::string gammalib::str ( const unsigned long long int &  value)

Convert unsigned long long integer value into string.

Parameters
[in]valueUnsigned long long integer to be converted into string.
Returns
String with unsigned long long integer value.

Definition at line 457 of file GTools.cpp.

std::string gammalib::str ( const short int &  value)

Convert short integer value into string.

Parameters
[in]valueShort integer to be converted into string.
Returns
String with short integer value.

Definition at line 471 of file GTools.cpp.

std::string gammalib::str ( const int &  value,
const std::string &  fmt = "%d" 
)

Convert integer value into string.

Parameters
[in]valueInteger to be converted into string.
[in]fmtFormat string.
Returns
String with integer value.

Definition at line 486 of file GTools.cpp.

References G_CHAR_BUFFER.

std::string gammalib::str ( const long int &  value)

Convert long integer value into string.

Parameters
[in]valueLong integer to be converted into string.
Returns
String with long integer value.

Definition at line 508 of file GTools.cpp.

std::string gammalib::str ( const long long int &  value)

Convert long long integer value into string.

Parameters
[in]valueLong long integer to be converted into string.
Returns
String with long long integer value.

Definition at line 522 of file GTools.cpp.

std::string gammalib::str ( const float &  value,
const int &  precision = 0 
)

Convert single precision value into string.

Parameters
[in]valueSingle precision value to be converted into string.
[in]precisionFloating point precision.
Returns
String with single precision value.

Converts a single precision value into a string. Any positive precision argument specifies the exact number of digits after the comma.

Definition at line 541 of file GTools.cpp.

std::string gammalib::str ( const double &  value,
const int &  precision = 0 
)

Convert double precision value into string.

Parameters
[in]valueDouble precision value to be converted into string.
[in]precisionFloating point precision.
Returns
String with double precision value.

Converts a double precision value into a string. Any positive precision argument specifies the exact number of digits after the comma.

Definition at line 578 of file GTools.cpp.

std::string gammalib::str ( const std::complex< double > &  value,
const int &  precision = 0 
)

Convert complex value into string.

Parameters
[in]valueComplex value to be converted into string.
[in]precisionFloating point precision.
Returns
String with complex value.

Converts a complex value into a string. Any positive precision argument specifies the exact number of digits after the comma.

Definition at line 614 of file GTools.cpp.

References abs().

std::string gammalib::str2xml ( const std::string &  arg)

Convert special characters in string to XML character references.

Parameters
[in]argString.
Returns
String with special characters replaced by character references.

Converts all special characters found in a string into character references. For more information about XML character references read http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Definition at line 1439 of file GTools.cpp.

Referenced by GXmlText::write(), and GXmlAttribute::write().

std::string gammalib::strip_chars ( const std::string &  arg,
const std::string &  chars 
)

Strip leading and trailing character from string.

Parameters
[in]argString from which character should be stripped.
[in]charsCharacter(s) to be stripped.
Returns
String with stripped characters.

Definition at line 89 of file GTools.cpp.

Referenced by GFitsTable::data_open(), GVOClient::find_hub(), GCsv::load(), GApplicationPars::parse(), read_ds_gti_extname(), read_ds_roi(), and strip_whitespace().

double gammalib::tand ( const double &  angle)

Compute tangens of angle in degrees.

Parameters
[in]angleAngle in degrees

This code has been adapted from the WCSLIB function wcstrig.c::tand().

Definition at line 192 of file GMath.cpp.

References abs(), deg2rad, and tan().

Referenced by GWcsMER::prj_s2x().

char * gammalib::tochar ( const std::string &  arg)

Convert string to C string.

Parameters
[in]argString to be converted.
Returns
C string.

Allocates a C string with the content of a C++ string.

Definition at line 657 of file GTools.cpp.

References str().

Referenced by GCTAExceptionHandler::what(), GLATExceptionHandler::what(), GMWLExceptionHandler::what(), and GExceptionHandler::what().

float gammalib::tofloat ( const std::string &  arg)

Convert string into single precision value.

Parameters
[in]argString to be converted.
Returns
Single precision value.

Definition at line 801 of file GTools.cpp.

long gammalib::tolong ( const std::string &  arg)

Convert string into long value.

Parameters
[in]argString to be converted.
Returns
Long value.

Definition at line 741 of file GTools.cpp.

long long gammalib::tolonglong ( const std::string &  arg)

Convert string into long long value.

Parameters
[in]argString to be converted.
Returns
Long long value.

Definition at line 771 of file GTools.cpp.

Referenced by GFitsHeaderCard::set_dtype().

short gammalib::toshort ( const std::string &  arg)

Convert string into short value.

Parameters
[in]argString to be converted.
Returns
Short value.

Definition at line 681 of file GTools.cpp.

unsigned int gammalib::touint ( const std::string &  arg)

Convert string into unsigned integer value.

Parameters
[in]argString to be converted.
Returns
Unsigned integer value.

Definition at line 726 of file GTools.cpp.

unsigned long gammalib::toulong ( const std::string &  arg)

Convert string into unsigned long value.

Parameters
[in]argString to be converted.
Returns
Unsigned long value.

Definition at line 756 of file GTools.cpp.

unsigned long long gammalib::toulonglong ( const std::string &  arg)

Convert string into unsigned long long value.

Parameters
[in]argString to be converted.
Returns
Unsigned long long value.

Definition at line 786 of file GTools.cpp.

Referenced by GFitsHeaderCard::set_dtype().

unsigned short gammalib::toushort ( const std::string &  arg)

Convert string into unsigned short value.

Parameters
[in]argString to be converted.
Returns
Unsigned short value.

Definition at line 696 of file GTools.cpp.

std::string gammalib::xml2str ( const std::string &  arg)

Convert XML character references in string to characters.

Parameters
[in]argString containing XML character references.
Returns
String with character reference replaced by respective characters.

Converts all character references found in a string in their respective characters. For more information about XML character references read http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Definition at line 1306 of file GTools.cpp.

References G_XML2STRING, number(), and toint().

Referenced by GXmlAttribute::GXmlAttribute(), and GXmlText::GXmlText().

void gammalib::xml_check_par ( const std::string &  origin,
const std::string &  name,
const int &  number 
)

Checks whether a parameter has occured once.

Parameters
[in]originMethod performing the check.
[in]nameParameter name.
[in]numberNumber of occurences of parameter.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Throws an exception if a given parameter has not exactly occured once. The exception text is adapted to the case that none or multiple parameters have been found.

Definition at line 1669 of file GTools.cpp.

References str().

Referenced by GCTAObservation::read(), xml_get_par(), and xml_need_par().

GFilename gammalib::xml_file_expand ( const GXmlElement xml,
const std::string &  filename 
)

Expand file name provided as XML attribute for loading.

Parameters
[in]xmlXML element.
[in]filenameFile name.
Returns
Expanded file name.

Expands file name provided as XML attribute for loading. If the file name is not empty and has no path it is assumed that the file is located in the same directory as the XML file, and the XML file access path is prepended to the file name.

Definition at line 1703 of file GTools.cpp.

References GXmlNode::filename(), GFilename::is_empty(), and GFilename::path().

Referenced by GLATObservation::read(), GMWLObservation::read(), GSPIObservation::read(), GModelSpatialDiffuseMap::read(), GModelTemporalLightCurve::read(), GCTAModelSpatialLookup::read(), GModelSpectralTable::read(), GModelSpatialDiffuseCube::read(), GModelSpectralFunc::read(), GCOMObservation::read(), GCTAObservation::read(), GCTAOnOffObservation::read(), GCTAResponseCube::read(), and GModelTemporalPhaseCurve::read().

GFilename gammalib::xml_file_reduce ( const GXmlElement xml,
const std::string &  filename 
)

Reduce file name provided for writing as XML attribute.

Parameters
[in]xmlXML element.
[in]filenameFile name.
Returns
Reduced file name.

Reduces file name provided for writing as XML attribute. If the file name is not empty and has the same access path as the XML file it is assumed that both files are located in the same directory, and the access path is stripped from the file name.

Definition at line 1733 of file GTools.cpp.

References GFilename::file(), GXmlNode::filename(), GFilename::is_empty(), and GFilename::path().

Referenced by GLATObservation::write(), GMWLObservation::write(), GSPIObservation::write(), GModelSpatialDiffuseMap::write(), GModelTemporalLightCurve::write(), GCTAModelSpatialLookup::write(), GModelSpectralTable::write(), GModelSpatialDiffuseCube::write(), GModelSpectralFunc::write(), GCOMObservation::write(), GCTAObservation::write(), GCTAOnOffObservation::write(), GCTAResponseCube::write(), and GModelTemporalPhaseCurve::write().

std::string gammalib::xml_get_attr ( const std::string &  origin,
const GXmlElement xml,
const std::string &  name,
const std::string &  attribute 
)

Return attribute value for a given parameter in XML element.

Parameters
[in]originMethod requesting parameter.
[in]xmlXML element.
[in]nameParameter name.
[in]attributeAttribute name.
Returns
Value of attribute.
Exceptions
GException::invalid_valueAttribute not found.

Returns the value of attribute of parameter name in XML element. The function checks whether the parameter has been found and throws an exception if no parameter or multiple occurences of a parameter with given name are found. The function furthermore checks whether the attribute exists.

Definition at line 1628 of file GTools.cpp.

References GXmlElement::attribute(), GXmlElement::has_attribute(), and xml_get_par().

Referenced by GMWLObservation::read(), GSPIObservation::read(), GCOMObservation::read(), and GCTAOnOffObservation::read().

void gammalib::xml_get_name_value_pair ( const GXmlNode node,
std::string &  name,
std::string &  value 
)

Extract name / value pair from XML node.

Parameters
[in]nodePointer to XML node.
[out]nameName string.
[out]valueValue string.

Extracts a name / value pair from a XML node. If the XML node pointer is NULL, the name and value strings will be empty.

Definition at line 1761 of file GTools.cpp.

References GXmlNode::element(), and GXmlText::text().

Referenced by GVOClient::get_response_value(), and GVOHub::get_response_value().

const GXmlElement * gammalib::xml_get_par ( const std::string &  origin,
const GXmlElement xml,
const std::string &  name 
)

Return pointer to parameter with given name in XML element.

Parameters
[in]originMethod requesting parameter.
[in]xmlXML element.
[in]nameParameter name.
Returns
Pointer to parameter XML element.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Returns pointer to parameter with given name in XML element. The function checks whether the parameter has been found and throws an exception if no parameter or multiple occurences of a parameter with given name are found.

Definition at line 1579 of file GTools.cpp.

References GXmlElement::attribute(), GXmlNode::element(), GXmlNode::elements(), number(), and xml_check_par().

Referenced by GModelSpatialRadialProfileGauss::read(), GModelSpatialRadialProfileDMBurkert::read(), GModelSpatialRadialProfileDMEinasto::read(), GModelSpatialRadialProfileDMZhao::read(), GCTAModelSpatialGradient::read(), GCTARoi::read(), GCOMModelDRBFitting::read(), GModelSpatialDiffuseConst::read(), GModelSpatialRadialDisk::read(), GModelSpatialRadialRing::read(), GModelTemporalConst::read(), GModelSpatialPointSource::read(), GSPIObservation::read(), GModelSpatialRadialGauss::read(), GModelSpatialEllipticalDisk::read(), GModelSpatialEllipticalGauss::read(), GCTAPointing::read(), GModelSpatialDiffuseMap::read(), GTimeReference::read(), GModelTemporalLightCurve::read(), GCTAModelSpatialLookup::read(), GModelSpatialElliptical::read(), GModelSpectralTable::read(), GModelSpatialRadial::read(), GModelSpectralConst::read(), GModelSpatialRadialShell::read(), GModelSpatialDiffuseCube::read(), GModelSpectralGauss::read(), GModelSpectralPlaw::read(), GCTAResponseIrf::read(), GCTAObservation::read(), GGti::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralBrokenPlaw::read(), GCTAResponseCube::read(), GModelSpectralExpInvPlaw::read(), GModelTemporalPhaseCurve::read(), GModelSpectralSuperExpPlaw::read(), GModelSpectralPlawPhotonFlux::read(), GModelSpectralPlawEnergyFlux::read(), GEbounds::read(), GModelSpectralNodes::read(), GModelSpectralSmoothBrokenPlaw::read(), and xml_get_attr().

bool gammalib::xml_has_par ( const GXmlElement xml,
const std::string &  name 
)

Checks if parameter with given name in XML element exists.

Parameters
[in]xmlXML element.
[in]nameParameter name.
Returns
True if parameter exists, false otherwise.

Checks whether a parameter with given name exists in XML element.

Definition at line 1486 of file GTools.cpp.

References GXmlElement::attribute(), GXmlNode::element(), and GXmlNode::elements().

Referenced by GModelSpectralRegistry::alloc(), GModelSpatialPointSource::read(), GSPIObservation::read(), GModelSpatialDiffuseMap::read(), GModelSpatialElliptical::read(), GModelSpectralTable::read(), GModelSpatialRadial::read(), GModelSpatialDiffuseCube::read(), GCOMObservation::read(), GCTAResponseIrf::read(), GCTAObservation::read(), GModelSpectralLogParabola::read(), and GCTAResponseCube::read().

GXmlElement * gammalib::xml_need_par ( const std::string &  origin,
GXmlElement xml,
const std::string &  name 
)

Return pointer to parameter with given name in XML element.

Parameters
[in]originMethod requesting parameter.
[in]xmlXML element.
[in]nameParameter name.
Returns
Pointer to parameter XML element.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Returns pointer to parameter with given name in XML element. If the name is not found, a parameter with the given name is added. In that respect the function differs from xml_get_par which does not add a parameter element.

The function checks for multiple occurences of a parameter and throws an exception in case that more than one parameter with a given name is found.

Definition at line 1527 of file GTools.cpp.

References GXmlNode::append(), GXmlElement::attribute(), GXmlNode::element(), GXmlNode::elements(), number(), and xml_check_par().

Referenced by GModelSpatialRadialProfileGauss::write(), GModelSpatialRadialProfileDMEinasto::write(), GModelSpatialRadialProfileDMZhao::write(), GModelSpatialRadialProfileDMBurkert::write(), GMWLObservation::write(), GCTAModelSpatialGradient::write(), GCTARoi::write(), GCOMModelDRBFitting::write(), GModelSpatialDiffuseConst::write(), GModelSpatialRadialDisk::write(), GModelSpatialRadialRing::write(), GModelSpatialPointSource::write(), GModelTemporalConst::write(), GModelSpatialRadialGauss::write(), GSPIObservation::write(), GModelSpatialEllipticalDisk::write(), GModelSpatialEllipticalGauss::write(), GCTAPointing::write(), GTimeReference::write(), GModelTemporalLightCurve::write(), GCTAModelSpatialLookup::write(), GModelSpatialElliptical::write(), GModelSpatialRadial::write(), GModelSpectralTable::write(), GModelSpectralConst::write(), GModelSpatialRadialShell::write(), GModelSpectralGauss::write(), GCOMObservation::write(), GModelSpectralPlaw::write(), GCTAResponseIrf::write(), GCTAObservation::write(), GGti::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GCTAOnOffObservation::write(), GModelSpectralBrokenPlaw::write(), GCTAResponseCube::write(), GModelSpectralExpInvPlaw::write(), GModelSpectralSuperExpPlaw::write(), GModelTemporalPhaseCurve::write(), GModelSpectralPlawEnergyFlux::write(), GModelSpectralPlawPhotonFlux::write(), GEbounds::write(), GModelSpectralNodes::write(), and GModelSpectralSmoothBrokenPlaw::write().

Variable Documentation

const double gammalib::deg2rad = 0.0174532925199432954743717

Definition at line 43 of file GMath.hpp.

Referenced by GCTAModelAeffBackground::aeff_integral(), GHorizDir::altaz_deg(), GCTAResponseTable::axis_radians(), com_energy2(), GCOMIaq::compton_kinematics(), GCOMDri::compute_drx(), GCOMDri::compute_geometry(), GSkyRegionCircle::compute_solid_angle(), GCTAPsfTable::containment_radius(), GModelSpatialRadialRing::contains(), GModelSpatialRadialDisk::contains(), GModelSpatialRadialGauss::contains(), GModelSpatialPointSource::contains(), GModelSpatialEllipticalDisk::contains(), GModelSpatialEllipticalGauss::contains(), GModelSpatialRadialProfile::contains(), GModelSpatialRadialShell::contains(), cosd(), cta_psf_radial_kerns_delta::cta_psf_radial_kerns_delta(), GCTACubePsf::delta_max(), GMatrix::eulerx(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_psf_elliptical_kern_omega::eval(), GCTACubePsf::fill_cube(), GModelSpatial::flux(), GTime::gast(), GSPIResponse::init_members(), GLATMeanPsf::integral(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCOMIaq::klein_nishina_bin(), GSkyDir::lb_deg(), GCTABackgroundPerfTable::load(), GCTAPsfPerfTable::load(), GSPIResponse::load_irf(), GCOMIaq::location_spread(), GCTAAeff2D::max(), GCTABackgroundPerfTable::mc(), GModelSpatialRadialDisk::mc(), GModelSpatialEllipticalDisk::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialGauss::mc(), GCTAModelRadialPolynom::mc(), GCTAModelRadialProfile::mc(), GCTAModelSpatial::mc(), GModelSpatialDiffuseMap::mc_cone(), GModelSpatialDiffuseCube::mc_cone(), GCTAModelRadialPolynom::mc_max_value(), GCTAModelRadialProfile::mc_max_value(), GModelSpatialDiffuseConst::mc_norm(), GSkyDir::moon(), GCOMInstChars::multi_scatter(), GCTAModelIrfBackground::npred(), GCTAModelRadialAcceptance::npred(), GCTAModelSpatial::npred(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTAModelRadialGauss::omega(), GCTAModelRadialPolynom::omega(), GCTAModelRadialProfile::omega(), GCTAPsfTable::precompute(), GWcsSIN::prj_s2x(), GWcsMOL::prj_s2x(), GWcsARC::prj_set(), GWcsCAR::prj_set(), GWcsMER::prj_set(), GWcsSFL::prj_set(), GCOMInstChars::prob_D2inter(), GModelSpatialRadialProfileGauss::profile_value(), GLATPsfV1::psf(), GLATPsfV3::psf(), GCTAResponseCube::psf_elliptical(), GSkyDir::radec_deg(), GCOMResponse::read(), GCTAPsfVector::read(), GCTAPsf2D::read(), GCTAPsfKing::read(), GCTAEventList::read_events(), GCTAAeffArf::remove_thetacut(), resolution(), GHorizDir::rotate_deg(), GSkyDir::rotate_deg(), GCTAAeff2D::set_boundaries(), GCTAEdisp2D::set_boundaries(), GCTACubePsf::set_delta_axis(), GCTAModelSpatialLookup::set_from_buffer(), GCTABackground3D::set_members(), GSPIResponse::set_wcs(), sincosd(), sind(), GWcs::solidangle(), GCTABackgroundPerfTable::solidangle(), GSkyDir::sun(), tand(), GCTAEdisp2D::theta(), GModelSpatialRadialProfileGauss::theta_max(), GModelSpatialRadialProfileDMEinasto::theta_max(), GModelSpatialRadialProfileDMBurkert::theta_max(), GModelSpatialRadialProfileDMZhao::theta_max(), GModelSpatialRadialRing::theta_max(), GModelSpatialRadialDisk::theta_max(), GModelSpatialRadialGauss::theta_max(), GModelSpatialEllipticalDisk::theta_max(), GModelSpatialEllipticalGauss::theta_max(), GModelSpatialRadialShell::theta_max(), GModelSpatialRadialRing::theta_min(), GCOMInstChars::trans_D2(), GCOMInstChars::trans_V23(), GModelSpatialEllipticalDisk::update(), GModelSpatialRadialDisk::update(), GModelSpatialRadialGauss::update(), GModelSpatialEllipticalGauss::update(), GModelSpatialRadialShell::update(), GCTAPsfKing::update(), and GCOMResponse::write().

const double gammalib::erg2MeV = 624150.96
const std::string gammalib::extname_arf = "SPECRESP"

Definition at line 45 of file GArf.hpp.

Referenced by GCTAAeffArf::load(), GCTAResponseIrf::load_aeff(), GArf::read(), and GArf::write().

const std::string gammalib::extname_cta_aeff2d = "EFFECTIVE AREA"

Definition at line 43 of file GCTAAeff2D.hpp.

Referenced by GCTAAeff2D::load(), GCTAResponseIrf::load_aeff(), and GCTAAeff2D::save().

const std::string gammalib::extname_cta_background3d = "BACKGROUND"

Definition at line 44 of file GCTABackground3D.hpp.

Referenced by GCTABackground3D::load(), and GCTABackground3D::save().

const std::string gammalib::extname_cta_counts = "COUNTS"

Definition at line 50 of file GCTAEventCube.hpp.

Referenced by GCTAEventCube::read(), and GCTAEventCube::write().

const std::string gammalib::extname_cta_edisp2d = "ENERGY DISPERSION"
const std::string gammalib::extname_cta_events = "EVENTS"
const std::string gammalib::extname_cta_migras = "MIGRAS"

Definition at line 48 of file GCTACubeEdisp.hpp.

Referenced by GCTACubeEdisp::read(), and GCTACubeEdisp::write().

const std::string gammalib::extname_cta_psf2d = "POINT SPREAD FUNCTION"

Definition at line 42 of file GCTAPsf2D.hpp.

Referenced by GCTAPsf2D::load(), and GCTAPsf2D::save().

const std::string gammalib::extname_cta_psfking = "POINT SPREAD FUNCTION"

Definition at line 42 of file GCTAPsfKing.hpp.

Referenced by GCTAPsfKing::load(), and GCTAPsfKing::save().

const std::string gammalib::extname_cta_psftable = "PSF_2D_TABLE"

Definition at line 42 of file GCTAPsfTable.hpp.

Referenced by GCTAPsfTable::load(), and GCTAPsfTable::save().

const std::string gammalib::extname_cta_spatial_lookup = "RADIAL BACKGROUND LOOKUP"

Definition at line 49 of file GCTAModelSpatialLookup.hpp.

Referenced by GCTAModelSpatialLookup::save().

const std::string gammalib::extname_cta_weights = "WEIGHTS"

Definition at line 51 of file GCTAEventCube.hpp.

Referenced by GCTAEventCube::read(), and GCTAEventCube::write().

const std::string gammalib::extname_deltas = "DELTAS"

Definition at line 47 of file GCTACubePsf.hpp.

Referenced by GCTACubePsf::read(), and GCTACubePsf::write().

const std::string gammalib::extname_dri = "DRI"

Definition at line 51 of file GCOMDri.hpp.

Referenced by GCOMDri::save().

const std::string gammalib::extname_lat_aeff = "EFFECTIVE AREA"

Definition at line 45 of file GLATAeff.hpp.

Referenced by GLATAeff::read(), and GLATAeff::write_aeff().

const std::string gammalib::extname_lat_cthetabounds = "CTHETABOUNDS"

Definition at line 47 of file GLATLtCube.hpp.

const std::string gammalib::extname_lat_edisp = "ENERGY DISPERSION"

Definition at line 43 of file GLATEdisp.hpp.

Referenced by GLATEdisp::read(), and GLATEdisp::write_edisp().

const std::string gammalib::extname_lat_edisp_scale = "EDISP_SCALING_PARAMS"

Definition at line 44 of file GLATEdisp.hpp.

const std::string gammalib::extname_lat_efficiency = "EFFICIENCY_PARAMS"

Definition at line 46 of file GLATAeff.hpp.

Referenced by GLATAeff::read(), and GLATAeff::write_efficiency().

const std::string gammalib::extname_lat_events = "EVENTS"

Definition at line 45 of file GLATEventList.hpp.

Referenced by GLATEventList::read().

const std::string gammalib::extname_lat_exposure = "EXPOSURE"

Definition at line 45 of file GLATLtCube.hpp.

Referenced by GLATLtCube::read(), and GLATLtCube::write().

const std::string gammalib::extname_lat_ltcubemap = "EXPOSURE"

Definition at line 44 of file GLATLtCubeMap.hpp.

const std::string gammalib::extname_lat_wgtexposure = "WEIGHTED_EXPOSURE"

Definition at line 46 of file GLATLtCube.hpp.

Referenced by GLATLtCube::read(), and GLATLtCube::write().

const std::string gammalib::extname_pha = "SPECTRUM"

Definition at line 45 of file GPha.hpp.

Referenced by GPha::read(), and GPha::write().

const std::string gammalib::extname_rmf = "MATRIX"

Definition at line 44 of file GRmf.hpp.

Referenced by GCTAResponseIrf::load_edisp(), GRmf::read(), and GRmf::write().

const double gammalib::fourpi = 12.56637061435917295385057353311801153679
const double gammalib::fourthird = 4.0/3.0

Definition at line 52 of file GMath.hpp.

const double gammalib::gkw10[5]
Initial value:
= {
0.066671344308688137593568809893332,
0.149451349150580593145776339657697,
0.219086362515982043995534934228163,
0.269266719309996355091226921569469,
0.295524224714752870173892994651338
}

Definition at line 60 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw21a[5]
Initial value:
= {
0.032558162307964727478818972459390,
0.075039674810919952767043140916190,
0.109387158802297641899210590325805,
0.134709217311473325928054001771707,
0.147739104901338491374841515972068
}

Definition at line 78 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw21b[6]
Initial value:
= {
0.011694638867371874278064396062192,
0.054755896574351996031381300244580,
0.093125454583697605535065465083366,
0.123491976262065851077958109831074,
0.142775938577060080797094273138717,
0.149445554002916905664936468389821
}

Definition at line 87 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw43a[10]
Initial value:
= {
0.016296734289666564924281974617663,
0.037522876120869501461613795898115,
0.054694902058255442147212685465005,
0.067355414609478086075553166302174,
0.073870199632393953432140695251367,
0.005768556059769796184184327908655,
0.027371890593248842081276069289151,
0.046560826910428830743339154433824,
0.061744995201442564496240336030883,
0.071387267268693397768559114425516
}

Definition at line 112 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw43b[12]
Initial value:
= {
0.001844477640212414100389106552965,
0.010798689585891651740465406741293,
0.021895363867795428102523123075149,
0.032597463975345689443882222526137,
0.042163137935191811847627924327955,
0.050741939600184577780189020092084,
0.058379395542619248375475369330206,
0.064746404951445885544689259517511,
0.069566197912356484528633315038405,
0.072824441471833208150939535192842,
0.074507751014175118273571813842889,
0.074722147517403005594425168280423
}

Definition at line 126 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw87a[21]
Initial value:
= {
0.008148377384149172900002878448190,
0.018761438201562822243935059003794,
0.027347451050052286161582829741283,
0.033677707311637930046581056957588,
0.036935099820427907614589586742499,
0.002884872430211530501334156248695,
0.013685946022712701888950035273128,
0.023280413502888311123409291030404,
0.030872497611713358675466394126442,
0.035693633639418770719351355457044,
0.000915283345202241360843392549948,
0.005399280219300471367738743391053,
0.010947679601118931134327826856808,
0.016298731696787335262665703223280,
0.021081568889203835112433060188190,
0.025370969769253827243467999831710,
0.029189697756475752501446154084920,
0.032373202467202789685788194889595,
0.034783098950365142750781997949596,
0.036412220731351787562801163687577,
0.037253875503047708539592001191226
}

Definition at line 168 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkw87b[23]
Initial value:
= {
0.000274145563762072350016527092881,
0.001807124155057942948341311753254,
0.004096869282759164864458070683480,
0.006758290051847378699816577897424,
0.009549957672201646536053581325377,
0.012329447652244853694626639963780,
0.015010447346388952376697286041943,
0.017548967986243191099665352925900,
0.019938037786440888202278192730714,
0.022194935961012286796332102959499,
0.024339147126000805470360647041454,
0.026374505414839207241503786552615,
0.028286910788771200659968002987960,
0.030052581128092695322521110347341,
0.031646751371439929404586051078883,
0.033050413419978503290785944862689,
0.034255099704226061787082821046821,
0.035262412660156681033782717998428,
0.036076989622888701185500318003895,
0.036698604498456094498018047441094,
0.037120549269832576114119958413599,
0.037334228751935040321235449094698,
0.037361073762679023410321241766599
}

Definition at line 193 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkx1[5]
Initial value:
= {
0.973906528517171720077964012084452,
0.865063366688984510732096688423493,
0.679409568299024406234327365114874,
0.433395394129247190799265943165784,
0.148874338981631210884826001129720
}

Definition at line 51 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkx2[5]
Initial value:
= {
0.995657163025808080735527280689003,
0.930157491355708226001207180059508,
0.780817726586416897063717578345042,
0.562757134668604683339000099272694,
0.294392862701460198131126603103866
}

Definition at line 69 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkx3[11]
Initial value:
= {
0.999333360901932081394099323919911,
0.987433402908088869795961478381209,
0.954807934814266299257919200290473,
0.900148695748328293625099494069092,
0.825198314983114150847066732588520,
0.732148388989304982612354848755461,
0.622847970537725238641159120344323,
0.499479574071056499952214885499755,
0.364901661346580768043989548502644,
0.222254919776601296498260928066212,
0.074650617461383322043914435796506
}

Definition at line 97 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::gkx4[22]
Initial value:
= {
0.999902977262729234490529830591582,
0.997989895986678745427496322365960,
0.992175497860687222808523352251425,
0.981358163572712773571916941623894,
0.965057623858384619128284110607926,
0.943167613133670596816416634507426,
0.915806414685507209591826430720050,
0.883221657771316501372117548744163,
0.845710748462415666605902011504855,
0.803557658035230982788739474980964,
0.757005730685495558328942793432020,
0.706273209787321819824094274740840,
0.651589466501177922534422205016736,
0.593223374057961088875273770349144,
0.531493605970831932285268948562671,
0.466763623042022844871966781659270,
0.399424847859218804732101665817923,
0.329874877106188288265053371824597,
0.258503559202161551802280975429025,
0.185695396568346652015917141167606,
0.111842213179907468172398359241362,
0.037352123394619870814998165437704
}

Definition at line 142 of file GIntegral.cpp.

Referenced by GIntegral::gauss_kronrod().

const double gammalib::inv_ln10 = 1.0/ln10

Definition at line 48 of file GMath.hpp.

Referenced by GCTAEdispPerfTable::load().

const double gammalib::inv_ln2 = 1.4426950408889634073599246810018921

Definition at line 47 of file GMath.hpp.

Referenced by iter_phi(), and iter_rho().

const double gammalib::inv_loge = 1.0/std::log10(std::exp(1.0))

Definition at line 49 of file GMath.hpp.

const double gammalib::inv_pihalf = 0.6366197723675813430755350534900574

Definition at line 39 of file GMath.hpp.

Referenced by GHealpix::ang2pix_z_phi_nest(), and GHealpix::ang2pix_z_phi_ring().

const double gammalib::inv_sqrt2pi = 0.3989422804014327028632180827116826549172
const double gammalib::inv_sqrt4pi = 0.2820947917738781434740397257803862929220

Definition at line 40 of file GMath.hpp.

const double gammalib::ln2 = 0.6931471805599453094172321214581766

Definition at line 45 of file GMath.hpp.

const double gammalib::MeV2Angstrom = 1.239841875e-2

Definition at line 47 of file GTools.hpp.

Referenced by GEnergy::Angstrom().

const double gammalib::onethird = 1.0/3.0

Definition at line 50 of file GMath.hpp.

Referenced by GSkyMap::flux().

const double gammalib::pc2cm = 3.08568025e18

Definition at line 48 of file GTools.hpp.

const double gammalib::pi2 = pi*pi

Definition at line 42 of file GMath.hpp.

const double gammalib::rad2deg = 57.295779513082322864647722

Definition at line 44 of file GMath.hpp.

Referenced by acosd(), GHorizDir::alt_deg(), asind(), atan2d(), atand(), GHorizDir::az_deg(), GSkyDir::b_deg(), GSkyDir::dec_deg(), GHorizDir::dist_deg(), GSkyDir::dist_deg(), GCTAModelRadial::eval(), GCTAModelSpatialGaussSpectrum::eval(), GCTAModelSpatialGradient::eval(), GCTAModelRadialPolynom::integrand::eval(), GCTAModelRadialProfile::integrand::eval(), GCTAModelRadialAcceptance::roi_kern::eval(), cta_irf_radial_kern_rho::eval(), cta_nroi_radial_kern_rho::eval(), cta_irf_elliptical_kern_omega::eval(), cta_nroi_elliptical_kern_omega::eval(), cta_irf_diffuse_kern_theta::eval(), cta_nroi_diffuse_kern_theta::eval(), cta_psf_radial_kern_rho::eval(), cta_psf_radial_kern_phi::eval(), cta_psf_elliptical_kern_omega::eval(), GCTAModelSpatialLookup::fill_buffer(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_radial(), GSkyDir::l_deg(), GCOMIaq::location_spread(), GModelSpatialDiffuseConst::mc(), GModelSpatialRadialRing::mc(), GModelSpatialRadialDisk::mc(), GModelSpatialEllipticalDisk::mc(), GCTAModelAeffBackground::mc(), GModelSpatialRadialProfile::mc(), GModelSpatialDiffuseMap::mc(), GCTABackground3D::mc(), GModelSpatialRadialShell::mc(), GModelSpatialDiffuseCube::mc(), GCTAResponseIrf::mc(), GCTAEdisp2D::mc(), GCTAModelSpatialGradient::mc_max_value(), GSkyDir::moon(), GCTAResponseIrf::npsf(), GCTABackgroundPerfTable::operator()(), GCTAAeffPerfTable::operator()(), GCTAAeffArf::operator()(), GSkyDir::posang_deg(), GHorizDir::print(), GSPIResponse::print(), GSkyDir::print(), GWcsARC::prj_set(), GWcsSIN::prj_set(), GWcsTAN::prj_set(), GWcsCAR::prj_set(), GWcsSTG::prj_set(), GWcsAIT::prj_set(), GWcsMER::prj_set(), GWcsMOL::prj_set(), GWcsSFL::prj_set(), GWcsAZP::prj_set(), GWcsSIN::prj_x2s(), GWcsMOL::prj_x2s(), GSkyDir::ra_deg(), GCTABackgroundPerfTable::rate_ebin(), GCOMOads::read(), GCOMEventList::read_events(), GSkyDir::rotate(), GHorizDir::rotate_deg(), GModelSpatialRadialProfile::set_region(), GSkyDir::sun(), GCTAPsf2D::write(), GCTAPsfKing::write(), GCTAEventList::write_events(), and GHorizDir::zenith_deg().

const double gammalib::sec2day = 1.0 / sec_in_day

Definition at line 50 of file GTools.hpp.

Referenced by GTime::convert(), GTime::days(), GTime::jd(), GTime::mjd(), GTime::secs(), and GTime::utc().

const double gammalib::sec_in_day = 86400.0
const double gammalib::sqrt_onehalf = std::sqrt(1.0/2.0)

Definition at line 53 of file GMath.hpp.

const double gammalib::sqrt_pihalf = std::sqrt(pihalf)

Definition at line 55 of file GMath.hpp.

const double gammalib::sqrt_two = std::sqrt(2.0)
const double gammalib::sqrt_twopi = std::sqrt(twopi)

Definition at line 56 of file GMath.hpp.

Referenced by GCOMD1Response::update_cache().

const double gammalib::tai2tt = 32.184

Definition at line 51 of file GTools.hpp.

Referenced by GTime::convert(), GTime::secs(), GTime::set(), and GTime::utc().

const double gammalib::twopi = 6.283185307179586476925286766559005768394

Definition at line 36 of file GMath.hpp.

Referenced by GHealpix::ang2pix_z_phi_nest(), GHealpix::ang2pix_z_phi_ring(), GSPIResponse::azimuth(), GModelSpatialRadialProfile::cache_index(), GSkyRegionCircle::compute_solid_angle(), GCTAPsfTable::containment_radius(), GSkyDir::euler(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GResponse::irf_radial_kern_theta::eval(), GResponse::irf_elliptical_kern_theta::eval(), cta_irf_diffuse_kern_theta::eval(), cta_nroi_diffuse_kern_theta::eval(), cta_psf_diffuse_kern_delta::eval(), GFft::factor5(), GFft::factor7(), GLATMeanPsf::integral(), GLATPsfV3::integrate_psf(), GHealpix::interpolator(), iter_phi(), GModelSpatialRadialProfileDMBurkert::jfactor(), GModelSpatialRadialProfileDMEinasto::jfactor(), GModelSpatialRadialProfileDMZhao::jfactor(), limit_omega(), GCTABackgroundPerfTable::load(), GCTABackgroundPerfTable::mc(), GCTAModelAeffBackground::mc(), GLATPsfV3::normalize_psf(), GCTAModelRadialGauss::omega(), GCTAModelRadialPolynom::omega(), GCTAModelRadialProfile::omega(), GCTAPsfTable::precompute(), GModelSpatialRadialProfileGauss::profile_value(), GLATPsfV1::psf(), roi_arclength(), GFftWavetable::set_members(), GWcs::solidangle(), GCTABackgroundPerfTable::solidangle(), GModelSpatialEllipticalDisk::update(), GModelSpatialRadialDisk::update(), GModelSpatialRadialGauss::update(), GModelSpatialEllipticalGauss::update(), GModelSpatialRadialRing::update(), GCTAPsfPerfTable::update(), GModelSpatialRadialShell::update(), GCTAPsfVector::update(), GCTAPsf2D::update(), and GCTAPsfKing::update().

const double gammalib::twothird = 2.0/3.0