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

Functions

void check_energy_interval (const std::string &origin, const GEnergy &emin, const GEnergy &emax)
 Checks energy interval. More...
 
void check_prj_x2s_status (const std::string &origin, const int &status, const int &number)
 Checks status of GWcs::prj_x2s method. More...
 
void check_prj_s2x_status (const std::string &origin, const int &status, const int &number)
 Checks status of GWcs::prj_s2x method. More...
 
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 tmpnam (void)
 Return temporary file name. More...
 
std::string getenv (const std::string &arg)
 Return value of environment variable. 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...
 
std::string strdate (void)
 Return current date. 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_parnum (const std::string &origin, const GXmlElement &xml, const int &number)
 Checks number of parameters. More...
 
void xml_check_type (const std::string &origin, GXmlElement &xml, const std::string &type)
 Checks the model type. 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...
 
bool compare (const double &a, const double &b, const double &tol)
 Compare two floating point values with tolerance. More...
 
std::string http_query (const std::string &host, const std::string &query)
 Return response to a HTTP query. More...
 
std::string host_country (const bool &force_query=false)
 Return two-digit host country code. More...
 
GFilename gamma_filename (const std::string &name)
 Returns filename in .gamma directory. More...
 
GChatter reduce (const GChatter &chatter)
 Reduce chattiness by one level. More...
 
GTime com_time (const int &tjd, const int &tics)
 Convert TJD and COMPTEL tics 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...
 
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...
 
const double & com_exd2x (const int &id2)
 Return D2 module exclusion region X position. More...
 
const double & com_exd2y (const int &id2)
 Return D2 module exclusion region Y position. More...
 
const double & com_exd2r (const int &id2)
 Return D2 module exclusion region radius. 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 speed_of_light = 299792458.0
 
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_background2d = "BKG"
 
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 
)
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]cFill character.
Returns
Centred string.

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

Definition at line 1118 of file GTools.cpp.

References fill().

Referenced by GSkyRegionMap::contains(), GModelSpatial::flux(), 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().

void gammalib::check_energy_interval ( const std::string &  origin,
const GEnergy emin,
const GEnergy emax 
)
void gammalib::check_prj_s2x_status ( const std::string &  origin,
const int &  status,
const int &  number 
)

Checks status of GWcs::prj_s2x method.

Parameters
[in]originMethod performing the check.
[in]statusStatus flag.
[in]numberNumber of invalid coordinates.
Exceptions
GException::invalid_argumentInvalid (phi,theta) coordinate specified.

Checks the status of the GWcs::prj_s2x method.

Definition at line 438 of file GException.cpp.

References str().

Referenced by GWcsAIT::prj_s2x(), GWcsTAN::prj_s2x(), GWcsSTG::prj_s2x(), GWcsSIN::prj_s2x(), GWcsMOL::prj_s2x(), and GWcsAZP::prj_s2x().

void gammalib::check_prj_x2s_status ( const std::string &  origin,
const int &  status,
const int &  number 
)

Checks status of GWcs::prj_x2s method.

Parameters
[in]originMethod performing the check.
[in]statusStatus flag.
[in]numberNumber of invalid coordinates.
Exceptions
GException::invalid_argumentInvalid (x,y) coordinate specified.

Checks the status of the GWcs::prj_x2s method.

Definition at line 401 of file GException.cpp.

References str().

Referenced by GWcsAIT::prj_x2s(), GWcsSIN::prj_x2s(), GWcsSFL::prj_x2s(), GWcsMOL::prj_x2s(), GWcsMER::prj_x2s(), GWcsCAR::prj_x2s(), GWcsAZP::prj_x2s(), and GWcsARC::prj_x2s().

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 110 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 127 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().

const double & gammalib::com_exd2r ( const int &  id2)

Return D2 module exclusion region radius.

Parameters
[in]id2Module identifier [1,...,14].
Returns
Exclusion region radius (cm).

Returns the D2 module exclusion region radius for a given module. The method does not check the validity of the module identifier.

The values have been implemented from the MPE-FPM-4 file.

Definition at line 195 of file GCOMSupport.cpp.

Referenced by GCOMDri::compute_geometry(), and GCOMSelection::use_event().

const double & gammalib::com_exd2x ( const int &  id2)

Return D2 module exclusion region X position.

Parameters
[in]id2Module identifier [1,...,14].
Returns
Exclusion region X position (cm).

Returns the D2 module exclusion region X position for a given module. The method does not check the validity of the module identifier.

The values have been implemented from the MPE-FPM-4 file.

Definition at line 151 of file GCOMSupport.cpp.

Referenced by GCOMDri::compute_geometry(), and GCOMSelection::use_event().

const double & gammalib::com_exd2y ( const int &  id2)

Return D2 module exclusion region Y position.

Parameters
[in]id2Module identifier [1,...,14].
Returns
Exclusion region Y position (cm).

Returns the D2 module exclusion region Y position for a given module. The method does not check the validity of the module identifier.

The values have been implemented from the MPE-FPM-4 file.

Definition at line 173 of file GCOMSupport.cpp.

Referenced by GCOMDri::compute_geometry(), and GCOMSelection::use_event().

int gammalib::com_tics ( const GTime time)

Convert GTime in COMPTEL tics.

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

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

The method applies the CGRO clock correction. The CGRO clock was too fast by 2.042144 seconds before 8798:28800000 (1992-06-25T01:00:00). After that date the clock was corrected.

Definition at line 125 of file GCOMTools.cpp.

References GTime::mjd(), and sec2day.

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

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

Convert TJD and COMPTEL tics in GTime object.

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

Converts TJD and COMPTEL tics 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).

The method applies the CGRO clock correction. The CGRO clock was too fast by 2.042144 seconds before 8798:28800000 (1992-06-25T01:00:00). After that date the clock was corrected.

Definition at line 55 of file GCOMTools.cpp.

References GTime::mjd(), and sec2day.

Referenced by GCOMTim::read(), GCOMOads::read(), GCOMBvcs::read(), GCOMHkds::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.

The method applies the CGRO clock correction. The CGRO clock was too fast by 2.042144 seconds before 8798:28800000 (1992-06-25T01:00:00). After that date the clock was corrected.

Definition at line 91 of file GCOMTools.cpp.

References GTime::mjd(), and sec2day.

Referenced by GCOMTim::print(), GCOMHkd::print(), GCOMEventList::print(), GCOMEventCube::print(), GCOMBvcs::tdelta(), GCOMSelection::use_event(), 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 56 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::compare ( const double &  a,
const double &  b,
const double &  tol 
)

Compare two floating point values with tolerance.

Parameters
[in]aFirst floating point value.
[in]bSecond floating point value.
[in]tolRelative tolerance.
Returns
True if both floating point values are identical within the tolerance.

This method tests whether a is identical to b within a given relative tolerance tol. The test verifies whether

\[|a - b| \le |a \times tol|\]

for \(a \ne 0\) or whether

\[|a - b| \le |b \times tol|\]

for \(b \ne 0\). If both \(a = 0\) and \(b = 0\) the method returns true.

Definition at line 2190 of file GTools.cpp.

References abs().

bool gammalib::contains ( const std::string &  str,
const std::string &  substring 
)
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 1366 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(), GCTAModelSkyCube::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 1312 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 1290 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 214 of file GTools.cpp.

References getenv().

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 393 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 1044 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 1774 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(), GCTABackground2D::load(), GCTABackground3D::load(), GCTAAeff2D::load(), GCTAPsfTable::load(), GCTAPsf2D::load(), GCTAPsfKing::load(), GCTAResponseIrf::load_aeff(), GCTAResponseIrf::load_edisp(), and GCTAResponseIrf::load_psf().

GFilename gammalib::gamma_filename ( const std::string &  name)

Returns filename in .gamma directory.

Parameters
[in]nameName of file in .gamma directory.
Returns
Filename in .gamma directory.

Returns the filename of the name of a file in the .gamma directory.

Definition at line 2484 of file GTools.cpp.

References getenv().

Referenced by GDaemon::heartbeat_filename(), host_country(), GDaemon::lock_filename(), GDaemon::recover_valid_xml(), GDaemon::start(), GDaemon::update_host_country(), GDaemon::update_statistics(), and GApplication::write_statistics().

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(), GModelSpatialRadialGeneralGauss::update(), and GModelSpatialEllipticalGeneralGauss::update().

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().

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

Return value of environment variable.

Parameters
[in]argEnvironment variable
Returns
Value of environment variable.

Returns the value of an environment variable arg. If the environment variable is not found an empty string will be returned.

Definition at line 465 of file GTools.cpp.

Referenced by expand_env(), gamma_filename(), GVOClient::get_hub_lockfile(), GVOHub::get_hub_lockfile(), GApplicationPars::inpath(), GApplicationPars::outpath(), GApplicationPars::pfiles_path(), GCaldb::rootdir(), and tmpnam().

std::string gammalib::host_country ( const bool &  force_query = false)

Return two-digit host country code.

Parameters
[in]force_queryForce query of host country code?
Returns
Host two-digit host country code.

Returns two-digit host country code, either by reading the code from the $HOME/.gamma/host-country file, or if the file does not exist, by using the http query http://ip-api.com/line/?fields=countryCode.

The result is saved in a static variable, hence once the country code is retrieved no queries will be executed anymore. The http query is issued using the http_query() method. If the query fails the method returns an empty string.

If no host-country file exists and the method retrieved a two-digit country code it will write the results into a host-country file.

Definition at line 2326 of file GTools.cpp.

References gamma_filename(), http_query(), split(), strip_chars(), and GFilename::url().

Referenced by GApplication::log_trailer(), GDaemon::update_host_country(), and GApplication::write_statistics().

std::string gammalib::http_query ( const std::string &  host,
const std::string &  query 
)

Return response to a HTTP query.

Parameters
[in]hostHost address.
[in]queryQuery string.
Returns
Response to a HTTP query.
Exceptions
GException::runtime_errorUnable to open or to connect to socket.
GException::invalid_argumentHost not found.

Returns response to a HTTP query. Be aware that this method will not work for https servers.

Definition at line 2230 of file GTools.cpp.

References G_HTTP_QUERY.

Referenced by host_country().

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 184 of file GTools.hpp.

Referenced by GCTAModelAeffBackground::aeff_integral(), GResponse::convolve(), GCOMModelDRM::eval(), GCTAModelSpatialGaussSpectrum::eval(), GCOMModelDRBPhibarNodes::eval(), GModelSpectralComposite::eval(), GCTAModelSpatialGradient::eval(), GCOMModelDRBPhibarBins::eval(), GModelSpatialRadialProfile::eval(), GModelSpectralMultiplicative::eval(), GCTAModelSpatialMultiplicative::eval(), GModelSpectralExponential::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialGeneralGauss::eval(), GModelSpatialRadialDisk::eval(), GModelSpatialRadialRing::eval(), GModelSpectralBins::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpectralTable::eval(), GCTAModelRadialGauss::eval(), GCTAModelRadialPolynom::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GCTAModelRadialProfile::eval(), GSPIModelDataSpace::eval(), GModelSpectralFunc::eval(), GModelSpectralGauss::eval(), GModelSpectralPlaw::eval(), GModelSpatialRadialShell::eval(), GModelSpectralExpPlaw::eval(), GModelSpectralLogParabola::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralSuperExpPlaw::eval(), GModelSpectralPlawPhotonFlux::eval(), GModelSpectralPlawEnergyFlux::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(), GCTAModelSkyCube::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 201 of file GTools.hpp.

Referenced by GCTAModelAeffBackground::aeff_integral(), GResponse::convolve(), GCOMModelDRM::eval(), GCTAModelSpatialGaussSpectrum::eval(), GCOMModelDRBPhibarNodes::eval(), GModelSpectralComposite::eval(), GCTAModelSpatialGradient::eval(), GCOMModelDRBPhibarBins::eval(), GModelSpatialRadialProfile::eval(), GModelSpectralMultiplicative::eval(), GCTAModelSpatialMultiplicative::eval(), GModelSpectralExponential::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialDisk::eval(), GModelSpatialRadialGeneralGauss::eval(), GModelSpatialRadialRing::eval(), GModelSpectralBins::eval(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpectralTable::eval(), GCTAModelRadialGauss::eval(), GCTAModelRadialPolynom::eval(), GModelSpatialEllipticalGeneralGauss::eval(), GCTAModelRadialProfile::eval(), GSPIModelDataSpace::eval(), GModelSpectralFunc::eval(), GModelSpectralGauss::eval(), GModelSpectralPlaw::eval(), GModelSpatialRadialShell::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(), GCTAModelSkyCube::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(), GCOMResponse::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GCOMResponse::irf_radial(), 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 left justified.
[in]nRequested total width.
[in]cFill character.
Returns
Left justified string.

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

Definition at line 1070 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 1167 of file GTools.cpp.

Referenced by GMatrixSparse::add_to_column(), GMatrixSparse::column(), GSkyMap::create_healpix_hdu(), GFitsTable::data_open(), GModelAssociations::get_association_xml(), GModelAssociation::get_property_xml(), GOptimizerPars::GOptimizerPars(), GModelSpatialRadialProfile::num_nodes(), GCOMDri::num_skipped_superpackets(), GCOMDri::num_superpackets(), GCOMDri::num_used_superpackets(), GMatrixSparse::stack_push_column(), xml2str(), xml_check_parnum(), 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 1143 of file GTools.cpp.

References fill(), and G_PARFORMAT_LENGTH.

Referenced by GApplication::log_value(), GLATEfficiency::print(), GCOMRoi::print(), GLATRoi::print(), GCOMInstDir::print(), GPulsarEphemeris::print(), GCOMOad::print(), GCOMStatus::print(), GBilinear::print(), GCOMBvc::print(), GUrlFile::print(), GFftWavetable::print(), GEphemerides::print(), GDaemon::print(), GCOMSelection::print(), GUrlString::print(), GCTARoi::print(), GVOHub::print(), GModelSpectralTablePar::print(), GPhases::print(), GCOMTim::print(), GModelSpatialRadialProfileGauss::print(), GPhotons::print(), GTimes::print(), GModelSpatialRadialProfileDMBurkert::print(), GModelSpatialRadialProfileDMEinasto::print(), GModelSpatialRadialProfileDMZhao::print(), GCTAModelRadialRegistry::print(), GModelRegistry::print(), GObservationRegistry::print(), GPulsar::print(), GWcsRegistry::print(), GRan::print(), GCOMIaq::print(), GModelSpectralRegistry::print(), GModelTemporalRegistry::print(), GLATObservation::print(), GOptimizerLM::print(), GCTAModelSpatialRegistry::print(), GModelSpatialRegistry::print(), GCTAModelSpatialGaussSpectrum::print(), GCOMModelDRM::print(), GMWLObservation::print(), GCTAModelIrfBackground::print(), GModelAssociation::print(), GSkyDirs::print(), GCOMInstChars::print(), GCTAModelSpatialGradient::print(), GModelSpatialComposite::print(), GCTAModelAeffBackground::print(), GMWLSpectrum::print(), GCOMHkd::print(), GCTAModelSpatialMultiplicative::print(), GModelSpatialDiffuseConst::print(), GCTAAeffPerfTable::print(), GCOMModelDRBPhibarBins::print(), GCOMModelDRBPhibarNodes::print(), GCTABackgroundPerfTable::print(), GCOMEventList::print(), GHealpix::print(), GCOMD1Response::print(), GModelTemporalConst::print(), GSPIObservation::print(), GLATEventCube::print(), GCOMOads::print(), GResponseVectorCache::print(), GFitsTable::print(), GCTAAeffArf::print(), GModelSpectralTablePars::print(), GLATEventList::print(), GLATMeanPsf::print(), GLATResponse::print(), GFitsImage::print(), GModelAssociations::print(), GDerivative::print(), GCTAModelCubeBackground::print(), GCOMEventCube::print(), GModelSpectralComposite::print(), GModelSpectralMultiplicative::print(), GCOMD2Response::print(), GLATResponseTable::print(), GSPIEventCube::print(), GCTAModelRadialAcceptance::print(), GCTAModelRadialGauss::print(), GVOClient::print(), GCTABackground2D::print(), GCTAPointing::print(), GCTABackground3D::print(), GCTAModelRadialPolynom::print(), GCTAAeff2D::print(), GModelSpatialDiffuseMap::print(), GModelSpectralExponential::print(), GCOMBvcs::print(), GCOMHkds::print(), GCOMResponse::print(), GCTAModelRadialProfile::print(), GCOMDri::print(), GModelSpatialRadialGauss::print(), GLATPsf::print(), GCTAModelBackground::print(), GModelSpatialRadialDisk::print(), GModelSpatialRadialGeneralGauss::print(), GLATEdisp::print(), GModelTemporalLightCurve::print(), GIntegrals::print(), GCTAEventList::print(), GCOMDris::print(), GCTAModelSpatialLookup::print(), GModelSpatialRadialRing::print(), GModelSpectralBins::print(), GIntegral::print(), GSPIModelDataSpace::print(), GCTAModelSkyCube::print(), GModelSpatialEllipticalDisk::print(), GCTACubeBackground::print(), GModelSpectralTable::print(), GModelSpectralConst::print(), GSPIResponse::print(), GModelSpatialEllipticalGauss::print(), GOptimizerPars::print(), GFft::print(), GTestSuites::print(), GModelSpatialEllipticalGeneralGauss::print(), GSkyRegions::print(), GCsv::print(), GModelSpatialPointSource::print(), GCTAEventCube::print(), GSkyRegionCircle::print(), GModelSpatialDiffuseCube::print(), GLATLtCubeMap::print(), GModelSpectralFunc::print(), GModelSpectralGauss::print(), GLATAeff::print(), GCTAPsfVector::print(), GCTAPsfPerfTable::print(), GModelSpectralPlaw::print(), GCTAResponseIrf::print(), GCTACubeExposure::print(), GResponseCache::print(), GModelSpatialRadialShell::print(), GCTAObservation::print(), GCTAPsf2D::print(), GCTAPsfTable::print(), GCTAPsfKing::print(), GCaldb::print(), GTimeReference::print(), GFitsTableCol::print(), GModelSpectralExpPlaw::print(), GModelSpectralLogParabola::print(), GApplicationPar::print(), GModelSpectralBrokenPlaw::print(), GCTAEdispRmf::print(), GSkyRegionRectangle::print(), GEnergies::print(), GCTAResponseCube::print(), GModelSpectralExpInvPlaw::print(), GModelSpectralSuperExpPlaw::print(), GFilename::print(), GModelTemporalPhaseCurve::print(), GCTACubePsf::print(), GNodeArray::print(), GRmf::print(), GCOMObservation::print(), GCTACubeEdisp::print(), GGti::print(), GArf::print(), GCTAEdispPerfTable::print(), GModelSpectralPlawPhotonFlux::print(), GCTAResponseTable::print(), GModelSpectralPlawEnergyFlux::print(), GCTAOnOffObservation::print(), GModelSpectralNodes::print(), GModelSpectralSmoothBrokenPlaw::print(), GMatrixSymmetric::print(), GFits::print(), GTestSuite::print(), GEbounds::print(), GMatrix::print(), GApplication::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 1248 of file GTools.cpp.

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

Referenced by GModelSpectralBins::eflux(), 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 GCTABackgroundPerfTable::rate_ebin(), GCTABackground2D::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 1200 of file GTools.cpp.

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

Referenced by GModelSpectralBins::flux(), GModelSpectralTable::flux(), GModelSpectralFunc::flux(), GModelSpectralPlaw::flux(), GModelSpectralBrokenPlaw::flux(), GModelSpectralNodes::flux(), GModelSpectralBins::mc_update(), 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 2036 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 168 of file GTools.cpp.

Referenced by GPulsar::load_psrtime(), and 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 right justified.
[in]nRequested total width.
[in]cFill character.
Returns
Right justified string.

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

Definition at line 1094 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 2107 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(), 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 131 of file GTools.cpp.

Referenced by GPulsar::load_parfile().

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 983 of file GTools.cpp.

Referenced by GApplicationPar::check_options(), GFitsTable::data_open(), GXmlNode::element(), host_country(), GModel::ids(), GApplicationPars::inpath(), GModel::instruments(), GCTABackgroundPerfTable::load(), GCTAAeffPerfTable::load(), GCTAPsfPerfTable::load(), GPulsar::load(), GCsv::load(), GCTAEdispPerfTable::load(), GLATResponse::load(), GPulsar::load_parfile(), GPulsar::load_psrtime(), GApplicationPars::outpath(), GApplicationPars::pfiles_path(), GSkyRegionCircle::read(), GSkyRegionRectangle::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 489 of file GTools.cpp.

Referenced by GIntegral::adaptive_simpson(), GMatrixSymmetric::add_to_column(), GMatrix::add_to_column(), GMatrixSparse::add_to_column(), GMatrixSymmetric::add_to_row(), GMatrix::add_to_row(), GCTAModelAeffBackground::aeff_integral(), GMatrixSymmetric::alloc_members(), angle(), GModelAssociations::append(), GModelSpectralTablePars::append(), GApplicationPars::append(), GCTAModelSpatialMultiplicative::append(), GCsv::append(), GModelSpatialComposite::append(), GModelSpectralComposite::append(), GModelSpectralMultiplicative::append(), GArf::append(), GModelSpectralFunc::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(), GWcs::cel_set(), check_prj_s2x_status(), check_prj_x2s_status(), GMatrixSymmetric::cholesky_decompose(), GSparseNumeric::cholesky_numeric_analysis(), GMatrixSymmetric::cholesky_solver(), GMatrixSparse::cholesky_solver(), GSparseSymbolic::cholesky_symbolic_analysis(), GMatrixSymmetric::column(), GMatrix::column(), GMatrixSparse::column(), GCOMDri::compute_dre(), GCOMDris::compute_drws(), GCOMDri::compute_tof_correction(), GCTAPsfVector::containment_radius(), GCTAPsfPerfTable::containment_radius(), GCTAPsfTable::containment_radius(), GCTAPsf2D::containment_radius(), GCTAPsfKing::containment_radius(), GResponse::convolve(), GFitsHeaderCard::copy_dtype(), cross(), GSparseSymbolic::cs_amd(), GCOMStatus::d1status(), GCOMStatus::d2status(), GFitsTable::data_open(), GFitsTable::data_save(), GFitsTableCol::elements(), GModelSpatialDiffuseCube::energies(), GEphemerides::ephemeris(), GPulsar::ephemeris(), GCOMModelDRBPhibarBins::eval(), GModelSpatialRadialGauss::eval(), GModelSpatialRadialGeneralGauss::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(), GModelAssociations::extend(), GModelSpectralTablePars::extend(), GApplicationPars::extend(), GObservations::extend(), GModels::extend(), GSkyMap::extract(), GMatrix::extract_lower_triangle(), GTime::extract_timesys(), GMatrix::extract_upper_triangle(), GOptimizerPar::factor_max(), GOptimizerPar::factor_min(), GOptimizerPar::factor_value(), GCTAEventList::fetch(), GVOTable::field_from_fits_column(), GException::fits_error::fits_error(), fits_move_to_hdu(), GFft::forward(), GCOMSelection::fpmtflag(), GFitsHeaderCard::free_dtype(), GIntegral::gauss_kronrod(), GCTACubeEdisp::GCTACubeEdisp(), GCTAModelRadialPolynom::GCTAModelRadialPolynom(), GCTAModelSpatialLookup::GCTAModelSpatialLookup(), GModelAssociations::get_association_xml(), GModelAssociation::get_property_xml(), GVOHub::get_socket(), GFitsTable::get_tform(), GHealpix::GHealpix(), GMatrix::GMatrix(), GMatrixSparse::GMatrixSparse(), GMatrixSymmetric::GMatrixSymmetric(), GModelSpectralTable::GModelSpectralTable(), GSkyMap::GSkyMap(), GVector::GVector(), GXmlElement::GXmlElement(), GSkyRegionRectangle::height(), GFits::image(), GModelAssociations::insert(), GFitsTable::insert(), GModelSpectralTablePars::insert(), GApplicationPars::insert(), GModelSpectralFunc::insert(), GObservations::insert(), GModelSpectralNodes::insert(), GModels::insert(), GPhases::insert_interval(), GMatrixSparse::insert_row(), GApplicationPar::integer(), GCsv::integer(), GModelSpectralFunc::intensity(), GModelSpectralNodes::intensity(), GNodeArray::interpolate(), GHealpix::interpolator(), GLATResponse::irf(), GCOMResponse::irf_diffuse(), GCOMResponse::irf_elliptical(), GCOMResponse::irf_ptsrc(), GCOMResponse::irf_radial(), GCTAResponseCube::irf_radial(), GWcs::lin_matinv(), GCsv::load(), GFitsTableBitCol::load_column(), GFitsTableCol::load_column_fixed(), GFitsTableCol::load_column_variable(), GModelSpatialDiffuseCube::load_cube(), GModelTemporalLightCurve::load_nodes(), GModelSpectralFunc::load_nodes(), GModelTemporalPhaseCurve::load_nodes(), GPulsar::load_parfile(), GOptimizerPar::max(), GCTABackground3D::mc(), GCTABackground2D::mc(), GCTAResponseIrf::mc(), GCTAEdisp2D::mc(), GModelSpatialDiffuseConst::mc_norm(), GOptimizerPar::min(), GDerivative::minuit2(), GObservation::model(), GFits::new_image(), GModelTemporalPhaseCurve::normalize_nodes(), GVOHub::notify(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelSkyCube::npred(), GCTAModelSpatial::npred(), GObservation::npred(), GFitsImage::offset(), GFits::open(), GCTAResponseTable::operator()(), GSkyMap::operator()(), GMatrixSymmetric::operator*(), GMatrix::operator*(), GMatrixSparse::operator*(), operator*(), GMatrix::operator*=(), GSkyMap::operator*=(), GMatrixSparse::operator*=(), GVector::operator+=(), GMatrixSymmetric::operator+=(), GMatrix::operator+=(), GSkyMap::operator+=(), GMatrixSparse::operator+=(), GVector::operator-=(), GMatrixSymmetric::operator-=(), GMatrix::operator-=(), GSkyMap::operator-=(), GMatrixSparse::operator-=(), GSkyMap::operator/=(), GOptimizerLM::optimize(), GException::out_of_range::out_of_range(), GApplicationPars::parse(), GXml::parse(), GApplicationPars::pickle(), GApplicationPar::pickle(), GIntegrals::polint(), GIntegral::polint(), GVOClient::post_string(), GVOHub::post_string(), GLATEfficiency::print(), GCOMRoi::print(), GCOMInstDir::print(), GLATRoi::print(), GCOMEventAtom::print(), GPulsarEphemeris::print(), GBilinear::print(), GCOMStatus::print(), GCOMBvc::print(), GCOMOad::print(), GUrlFile::print(), GLATInstDir::print(), GUrlString::print(), GCOMSelection::print(), GFftWavetable::print(), GEphemerides::print(), GDaemon::print(), GCTARoi::print(), GModelSpatialRadialProfileGauss::print(), GModelSpectralTablePar::print(), GCOMTim::print(), GPhases::print(), GModelSpatialRadialProfileDMBurkert::print(), GModelSpatialRadialProfileDMEinasto::print(), GModelSpatialRadialProfileDMZhao::print(), GSPIInstDir::print(), GPhotons::print(), GTimes::print(), GModelRegistry::print(), GCTAModelRadialRegistry::print(), GRan::print(), GWcsRegistry::print(), GObservationRegistry::print(), GPulsar::print(), GCOMIaq::print(), GMWLDatum::print(), GLATObservation::print(), GModelSpatialRegistry::print(), GModelSpectralRegistry::print(), GModelTemporalRegistry::print(), GOptimizerLM::print(), GCTAModelSpatialRegistry::print(), GLATEventBin::print(), GCOMEventBin::print(), GModelAssociation::print(), GCTAModelIrfBackground::print(), GCOMModelDRM::print(), GCOMInstChars::print(), GModelSpatialComposite::print(), GCTAModelSpatialGradient::print(), GPhoton::print(), GSkyDirs::print(), GCTAEventBin::print(), GCTABackgroundPerfTable::print(), GModelSpatialDiffuseConst::print(), GCTAModelAeffBackground::print(), GMWLSpectrum::print(), GCTAModelSpatialMultiplicative::print(), GCOMModelDRBPhibarBins::print(), GCOMModelDRBPhibarNodes::print(), GCTAAeffPerfTable::print(), GCOMHkd::print(), GCOMD1Response::print(), GHealpix::print(), GCOMEventList::print(), GSPIObservation::print(), GModelTemporalConst::print(), GCOMOads::print(), GLATEventCube::print(), GFitsTable::print(), GCTAAeffArf::print(), GResponseVectorCache::print(), GModelAssociations::print(), GLATEventList::print(), GLATMeanPsf::print(), GModelSpectralTablePars::print(), GFitsImage::print(), GCOMEventCube::print(), GCTAInstDir::print(), GModelSpectralComposite::print(), GCTAModelCubeBackground::print(), GDerivative::print(), GLATResponseTable::print(), GSPIEventCube::print(), GCOMD2Response::print(), GModelSpectralMultiplicative::print(), GCTAModelRadialAcceptance::print(), GCTAModelRadialGauss::print(), GCTABackground2D::print(), GCTABackground3D::print(), GCTAModelRadialPolynom::print(), GModelSpatialDiffuseMap::print(), GModelSpectralExponential::print(), GCTAAeff2D::print(), GHorizDir::print(), GCOMHkds::print(), GCOMResponse::print(), GModelSpatialRadialGauss::print(), GCOMBvcs::print(), GCOMDri::print(), GCTAModelRadialProfile::print(), GCTAModelBackground::print(), GModelSpatialRadialDisk::print(), GLATPsf::print(), GModelSpatialRadialGeneralGauss::print(), GLATEdisp::print(), GCTAEventList::print(), GCOMDris::print(), GModelSpatialRadialRing::print(), GModelSpectralBins::print(), GSPIEventBin::print(), GModelTemporalLightCurve::print(), GIntegrals::print(), GCTAModelSpatialLookup::print(), GModelSpatialEllipticalDisk::print(), GSPIModelDataSpace::print(), GIntegral::print(), GCTAModelSkyCube::print(), GModelSpectralTable::print(), GModelSpectralConst::print(), GModelSpatialEllipticalGauss::print(), GOptimizerPars::print(), GSPIResponse::print(), GTestSuites::print(), GModelSpatialEllipticalGeneralGauss::print(), GFft::print(), GModelSpatialPointSource::print(), GFitsHeader::print(), GSkyRegions::print(), GCsv::print(), GLATLtCubeMap::print(), GCTAEventCube::print(), GModelSpatialDiffuseCube::print(), GSkyRegionCircle::print(), GModelSpectralFunc::print(), GLATAeff::print(), GModelSpectralGauss::print(), GCTAPsfPerfTable::print(), GCTAPsfVector::print(), GModelSpectralPlaw::print(), GFitsHeaderCard::print(), GModelSpatialRadialShell::print(), GCTACubeExposure::print(), GResponseCache::print(), GCTAResponseIrf::print(), GCTAObservation::print(), GCTAPsfTable::print(), GCTAPsf2D::print(), GCTAPsfKing::print(), GTimeReference::print(), GCaldb::print(), GFitsTableCol::print(), GModelSpectralExpPlaw::print(), GModelSpectralLogParabola::print(), GCTAEdispRmf::print(), GModelSpectralBrokenPlaw::print(), GSkyRegionRectangle::print(), GEnergies::print(), GFilename::print(), GModelSpectralSuperExpPlaw::print(), GModelSpectralExpInvPlaw::print(), GModelTemporalPhaseCurve::print(), GCTACubePsf::print(), GRmf::print(), GNodeArray::print(), GEnergy::print(), GSkyPixel::print(), GCOMObservation::print(), GCTACubeEdisp::print(), GSkyDir::print(), GArf::print(), GGti::print(), GCTAEdispPerfTable::print(), GCTAResponseTable::print(), GModelSpectralPlawEnergyFlux::print(), GModelSpectralPlawPhotonFlux::print(), GCTAOnOffObservation::print(), GVector::print(), GModelSpectralNodes::print(), GModelSpectralSmoothBrokenPlaw::print(), GMatrixSymmetric::print(), GFits::print(), GTime::print(), GTestSuite::print(), GNdarray::print(), GEbounds::print(), GMatrix::print(), GApplication::print(), GCTAEdisp2D::print(), GObservations::print(), GPha::print(), GModelSky::print(), GOptimizerPar::print(), GModels::print(), GSkyMap::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(), GLATPsfV1::read(), GLATPsfV3::read(), GCOMModelDRBPhibarBins::read(), GCOMModelDRBPhibarNodes::read(), GLATPsf::read(), GCOMOads::read(), GCTAModelRadialPolynom::read(), GModelSpectralBins::read(), GSkyRegionCircle::read(), GCTAAeff2D::read(), GCTAModelSpatialLookup::read(), GCTAObservation::read(), GSkyRegionRectangle::read(), GModelPar::read(), GCTAPsfTable::read(), GCTAPsf2D::read(), GCTAPsfKing::read(), GCOMSelection::read(), GFitsHeaderCard::read(), GModelSpectralNodes::read(), GModelSpatialDiffuseCube::read(), GPha::read(), GCTAEdisp2D::read(), GLATAeff::read_aeff(), GCTAResponseTable::read_axes(), read_ds_ebounds(), read_ds_gti_extname(), read_ds_phase(), read_ds_roi(), GSPIEventCube::read_ebds(), GMWLSpectrum::read_fits(), GSkyMap::read_healpix(), GSPIEventCube::read_models(), GSPIEventCube::read_pnt(), GLATEventCube::read_srcmap(), 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(), GMatrix::row(), GModelSpectralFunc::save(), GFitsTableBitCol::save_column(), GFitsTableCol::save_column_fixed(), GFitsTableCol::save_column_variable(), GModelSpectralTablePars::set(), GCOMHkds::set(), GEnergies::set(), GObservations::set(), GTime::set(), GModels::set(), GLATEventCube::set_bin(), GCTAEventCube::set_bin(), GFftWavetable::set_factors(), GCTAEventList::set_mc_id_names(), GFftWavetable::set_members(), GCTABackground2D::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(), GDerivative::smooth_robust(), GMatrixSparse::stack_push_column(), GVOHub::start_hub(), GFitsTableULongCol::string(), GFitsTableDoubleCol::string(), GFitsTableLongCol::string(), GFitsTableLongLongCol::string(), GFitsTableUShortCol::string(), GFitsTableShortCol::string(), GFitsTableFloatCol::string(), GFitsTableByteCol::string(), GFitsTableCFloatCol::string(), GFitsTableCDoubleCol::string(), GFits::table(), GCOMBvcs::tdelta(), GTestSuite::test_value(), GFitsTableCol::tform_binary(), tochar(), GIntegral::trapzd(), GIntegrals::trapzd(), GCOMStatus::update_cache(), GDaemon::update_countries_data(), GDaemon::update_daily(), GFitsTable::update_header(), GModelSpectralBins::update_pars(), GModelSpectralNodes::update_pars(), GDaemon::update_versions_data(), GCOMSelection::use_d1(), GCOMSelection::use_d2(), GTime::utc(), GXmlElement::value(), GDerivative::value(), GFitsHeaderCard::value(), GWcs::wcs_p2s(), GWcs::wcs_print(), GWcs::wcs_print_value(), GWcs::wcs_s2p(), GWcs::wcs_set_ctype(), GSkyRegionRectangle::width(), GModelSpatialComposite::write(), GCTAModelSpatialMultiplicative::write(), GCOMModelDRBPhibarNodes::write(), GCOMModelDRBPhibarBins::write(), GCTARoi::write(), GSPIObservation::write(), GWcs::write(), GModelSpectralComposite::write(), GModelSpectralMultiplicative::write(), GCTAPointing::write(), GCTAModelRadialPolynom::write(), GTimeReference::write(), GModelSpectralBins::write(), GSPIModelDataSpace::write(), GSkyRegionCircle::write(), GCTAResponseIrf::write(), GCTAObservation::write(), GTestSuites::write(), GGti::write(), GSkyRegionRectangle::write(), GModelPar::write(), GCOMObservation::write(), GCOMSelection::write(), GFitsHeaderCard::write(), GEbounds::write(), GModelSpectralNodes::write(), GModel::write_attributes(), GCTAEventList::write_ds_keys(), GCTAEventList::write_mc_ids(), GModel::write_scales(), xml_check_par(), and xml_check_parnum().

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 503 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 517 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 531 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 545 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 560 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 582 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 596 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 615 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 652 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 688 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 1549 of file GTools.cpp.

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

std::string gammalib::strdate ( void  )

Return current date.

Returns the current date as string in the format yyyy-mm-ddThh:mm:ss.

Definition at line 727 of file GTools.cpp.

Referenced by GLog::prefix(), and GApplication::write_statistics().

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 94 of file GTools.cpp.

Referenced by GFitsTable::data_open(), GVOClient::find_hub(), host_country(), 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().

std::string gammalib::tmpnam ( void  )

Return temporary file name.

Returns
Temporary file name.

Returns a temporary file name.

Definition at line 421 of file GTools.cpp.

References getenv().

Referenced by GVOClient::publish().

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 767 of file GTools.cpp.

References str().

Referenced by 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 911 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 851 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 881 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 791 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 836 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 866 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 896 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 806 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 1416 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 1855 of file GTools.cpp.

References str().

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

void gammalib::xml_check_parnum ( const std::string &  origin,
const GXmlElement xml,
const int &  number 
)

Checks number of parameters.

Parameters
[in]originMethod performing the check.
[in]xmlXML element.
[in]numberExpected number of parameters.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Checks the number of parameter in an XML element.

Definition at line 1777 of file GTools.cpp.

References GXmlNode::elements(), number(), and str().

Referenced by GModelSpatialRadialProfileGauss::read(), GModelSpatialRadialProfileDMBurkert::read(), GModelSpatialRadialProfileDMEinasto::read(), GModelSpatialRadialProfileDMZhao::read(), GLATObservation::read(), GCOMModelDRM::read(), GModelSpatialDiffuseConst::read(), GModelTemporalConst::read(), GCTAModelRadialGauss::read(), GModelSpatialDiffuseMap::read(), GCTAModelRadialProfile::read(), GModelSpatialRadialGauss::read(), GModelSpatialRadialDisk::read(), GModelSpatialRadialGeneralGauss::read(), GModelTemporalLightCurve::read(), GModelSpatialRadialRing::read(), GModelSpatialEllipticalDisk::read(), GModelSpatialEllipticalGauss::read(), GModelSpectralConst::read(), GModelSpatialEllipticalGeneralGauss::read(), GModelSpatialPointSource::read(), GModelSpatialDiffuseCube::read(), GModelSpectralFunc::read(), GModelSpectralGauss::read(), GModelSpectralPlaw::read(), GModelSpatialRadialShell::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralBrokenPlaw::read(), GModelSpectralSuperExpPlaw::read(), GModelSpectralExpInvPlaw::read(), GModelTemporalPhaseCurve::read(), GModelSpectralPlawPhotonFlux::read(), GModelSpectralPlawEnergyFlux::read(), GModelSpectralSmoothBrokenPlaw::read(), and GLATObservation::write().

void gammalib::xml_check_type ( const std::string &  origin,
GXmlElement xml,
const std::string &  type 
)

Checks the model type.

Parameters
[in]originMethod performing the check.
[in,out]xmlXML element.
[in]typeExpected model typeN.
Exceptions
GException::invalid_valueInvalid XML format encountered.

Checks the number of parameter in an XML element.

Definition at line 1819 of file GTools.cpp.

References GXmlElement::attribute().

Referenced by GModelSpatialRadialProfileGauss::write(), GModelSpatialRadialProfileDMBurkert::write(), GModelSpatialRadialProfileDMEinasto::write(), GModelSpatialRadialProfileDMZhao::write(), GCOMModelDRM::write(), GCTAModelSpatialGradient::write(), GModelSpatialComposite::write(), GModelSpatialDiffuseConst::write(), GCTAModelSpatialMultiplicative::write(), GModelTemporalConst::write(), GModelSpectralComposite::write(), GModelSpectralMultiplicative::write(), GCTAModelRadialGauss::write(), GModelSpatialDiffuseMap::write(), GCTAModelRadialPolynom::write(), GModelSpectralExponential::write(), GCTAModelRadialProfile::write(), GModelSpatialRadialDisk::write(), GModelTemporalLightCurve::write(), GModelSpatialRadialRing::write(), GModelSpectralBins::write(), GModelSpatialEllipticalDisk::write(), GModelSpectralTable::write(), GModelSpectralConst::write(), GModelSpatialEllipticalGauss::write(), GModelSpatialEllipticalGeneralGauss::write(), GModelSpatialElliptical::write(), GModelSpatialPointSource::write(), GModelSpatialRadial::write(), GModelSpatialDiffuseCube::write(), GModelSpectralFunc::write(), GModelSpectralGauss::write(), GModelSpectralPlaw::write(), GModelSpatialRadialShell::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GModelSpectralBrokenPlaw::write(), GModelSpectralExpInvPlaw::write(), GModelSpectralSuperExpPlaw::write(), GModelTemporalPhaseCurve::write(), GModelSpectralPlawEnergyFlux::write(), GModelSpectralPlawPhotonFlux::write(), GModelSpectralNodes::write(), and GModelSpectralSmoothBrokenPlaw::write().

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. The XML file access path will be prepended to the file name access path if the file name has not an absolute path and if the file name access path does not start with the XML file access path.

Definition at line 1889 of file GTools.cpp.

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

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

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 its access path starts has the same access path as the XML file the XML file access path is stripped from the file name.

Definition at line 1946 of file GTools.cpp.

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

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

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 1738 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 1988 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 1689 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(), GCOMModelDRM::read(), GCTAModelSpatialGradient::read(), GCOMModelDRBPhibarNodes::read(), GModelSpatialDiffuseConst::read(), GCTARoi::read(), GModelTemporalConst::read(), GSPIObservation::read(), GCTAPointing::read(), GCTAModelRadialGauss::read(), GModelSpatialDiffuseMap::read(), GCTAModelRadialProfile::read(), GModelSpatialRadialGauss::read(), GTimeReference::read(), GModelSpatialRadialDisk::read(), GModelSpatialRadialGeneralGauss::read(), GModelSpectralBins::read(), GModelTemporalLightCurve::read(), GCTAModelSpatialLookup::read(), GModelSpatialRadialRing::read(), GModelSpatialEllipticalDisk::read(), GModelSpectralConst::read(), GModelSpatialEllipticalGauss::read(), GModelSpectralTable::read(), GModelSpatialEllipticalGeneralGauss::read(), GModelSpatialElliptical::read(), GModelSpatialPointSource::read(), GModelSpatialRadial::read(), GModelSpatialDiffuseCube::read(), GModelSpectralFunc::read(), GModelSpectralGauss::read(), GModelSpectralPlaw::read(), GCTAResponseIrf::read(), GModelSpatialRadialShell::read(), GCTAObservation::read(), GGti::read(), GModelSpectralExpPlaw::read(), GModelSpectralLogParabola::read(), GModelSpectralBrokenPlaw::read(), GCTAResponseCube::read(), GModelSpectralExpInvPlaw::read(), GModelSpectralSuperExpPlaw::read(), GModelTemporalPhaseCurve::read(), GModelSpectralPlawPhotonFlux::read(), GModelSpectralPlawEnergyFlux::read(), GEbounds::read(), GModelSpectralNodes::read(), GModelSpectralSmoothBrokenPlaw::read(), GCTAModelSkyCube::read_xml_spatial(), 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 1596 of file GTools.cpp.

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

Referenced by GModelSpectralRegistry::alloc(), GSPIObservation::read(), GModelSpatialDiffuseMap::read(), GModelSpectralTable::read(), GModelSpatialElliptical::read(), GModelSpatialPointSource::read(), GModelSpatialRadial::read(), GModelSpatialDiffuseCube::read(), GCTAResponseIrf::read(), GCTAObservation::read(), GModelSpectralLogParabola::read(), GCTAResponseCube::read(), and GCOMObservation::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 1637 of file GTools.cpp.

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

Referenced by GModelSpatialRadialProfileGauss::write(), GModelSpatialRadialProfileDMBurkert::write(), GModelSpatialRadialProfileDMZhao::write(), GModelSpatialRadialProfileDMEinasto::write(), GMWLObservation::write(), GCOMModelDRM::write(), GCTAModelSpatialGradient::write(), GCOMModelDRBPhibarNodes::write(), GModelSpatialDiffuseConst::write(), GCTARoi::write(), GSPIObservation::write(), GModelTemporalConst::write(), GCTAModelRadialGauss::write(), GCTAPointing::write(), GCTAModelRadialPolynom::write(), GModelSpatialDiffuseMap::write(), GCTAModelRadialProfile::write(), GModelSpatialRadialGauss::write(), GTimeReference::write(), GModelSpatialRadialDisk::write(), GModelSpatialRadialGeneralGauss::write(), GModelSpatialRadialRing::write(), GCTAModelSpatialLookup::write(), GModelSpectralBins::write(), GModelTemporalLightCurve::write(), GModelSpatialEllipticalDisk::write(), GModelSpectralConst::write(), GModelSpatialEllipticalGauss::write(), GModelSpectralTable::write(), GModelSpatialEllipticalGeneralGauss::write(), GModelSpatialPointSource::write(), GModelSpatialElliptical::write(), GModelSpatialRadial::write(), GModelSpatialDiffuseCube::write(), GModelSpectralFunc::write(), GModelSpectralGauss::write(), GModelSpectralPlaw::write(), GModelSpatialRadialShell::write(), GCTAResponseIrf::write(), GCTAObservation::write(), GGti::write(), GModelSpectralExpPlaw::write(), GModelSpectralLogParabola::write(), GModelSpectralBrokenPlaw::write(), GCTAResponseCube::write(), GModelSpectralExpInvPlaw::write(), GModelSpectralSuperExpPlaw::write(), GModelTemporalPhaseCurve::write(), GCOMObservation::write(), GModelSpectralPlawEnergyFlux::write(), GModelSpectralPlawPhotonFlux::write(), GCTAOnOffObservation::write(), GEbounds::write(), GModelSpectralNodes::write(), GModelSpectralSmoothBrokenPlaw::write(), and GCTAModelSkyCube::write_xml_spatial().

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(), GSkyRegionRectangle::compute_solid_angle(), GCTAPsfTable::containment_radius(), GModelSpatialRadialProfile::contains(), GModelSpatialRadialGauss::contains(), GModelSpatialRadialDisk::contains(), GModelSpatialRadialGeneralGauss::contains(), GModelSpatialRadialRing::contains(), GModelSpatialEllipticalDisk::contains(), GModelSpatialEllipticalGauss::contains(), GModelSpatialEllipticalGeneralGauss::contains(), GModelSpatialPointSource::contains(), GModelSpatialRadialShell::contains(), GSkyRegionRectangle::corner(), cosd(), GCTACubePsf::delta_max(), GSkyRegionRectangle::dir_to_local(), GMatrix::eulerx(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatialEllipticalDisk::eval(), GModelSpatialEllipticalGauss::eval(), GModelSpatialEllipticalGeneralGauss::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(), GCOMResponse::irf_diffuse(), GCOMResponse::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GCOMResponse::irf_radial(), GCTAResponseIrf::irf_radial(), GCOMIaq::klein_nishina_bin(), GSkyDir::lb_deg(), GCTABackgroundPerfTable::load(), GCTAPsfPerfTable::load(), GSPIResponse::load_irf(), GSkyRegionRectangle::local_to_dir(), GCOMIaq::location_spread(), GCTAAeff2D::max(), GCTABackgroundPerfTable::mc(), GCTAModelAeffBackground::mc(), GModelSpatialRadialDisk::mc(), GCTAModelRadialGauss::mc(), GCTAModelRadialPolynom::mc(), GCTAModelRadialProfile::mc(), GModelSpatialEllipticalDisk::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(), 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(), GCTABackground2D::set_members(), GCTABackground3D::set_members(), GSPIResponse::set_wcs(), sincosd(), sind(), GWcs::solidangle(), GCTABackgroundPerfTable::solidangle(), GSkyDir::sun(), tand(), GCTAEdisp2D::theta(), GModelSpatialRadialProfileGauss::theta_max(), GModelSpatialRadialProfileDMZhao::theta_max(), GModelSpatialRadialProfileDMEinasto::theta_max(), GModelSpatialRadialProfileDMBurkert::theta_max(), GModelSpatialRadialGauss::theta_max(), GModelSpatialRadialGeneralGauss::theta_max(), GModelSpatialRadialDisk::theta_max(), GModelSpatialRadialRing::theta_max(), GModelSpatialEllipticalDisk::theta_max(), GModelSpatialEllipticalGauss::theta_max(), GModelSpatialEllipticalGeneralGauss::theta_max(), GModelSpatialRadialShell::theta_max(), GModelSpatialRadialRing::theta_min(), GModelSpatialEllipticalDisk::update(), GModelSpatialRadialGauss::update(), GModelSpatialRadialDisk::update(), GModelSpatialEllipticalGauss::update(), GModelSpatialRadialGeneralGauss::update(), GModelSpatialEllipticalGeneralGauss::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_background2d = "BKG"
const std::string gammalib::extname_cta_background3d = "BACKGROUND"
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 53 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 61 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 79 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 88 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 113 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 127 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 169 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 194 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 52 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 70 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 98 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 143 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_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.

Referenced by GCOMD2Response::operator()().

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(), GSkyRegionRectangle::contains(), 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(), GCTAModelAeffBackground::mc(), GModelSpatialRadialProfile::mc(), GModelSpatialDiffuseMap::mc(), GCTABackground2D::mc(), GCTABackground3D::mc(), GModelSpatialRadialDisk::mc(), GModelSpatialRadialGeneralGauss::mc(), GModelSpatialRadialRing::mc(), GModelSpatialEllipticalDisk::mc(), GModelSpatialEllipticalGeneralGauss::mc(), GModelSpatialDiffuseCube::mc(), GModelSpatialRadialShell::mc(), GCTAResponseIrf::mc(), GCTAEdisp2D::mc(), GCTAModelSpatialGradient::mc_max_value(), GSkyDir::moon(), GCTAResponseIrf::npsf(), GCTABackgroundPerfTable::operator()(), GCTAAeffPerfTable::operator()(), GCTAAeffArf::operator()(), GSkyRegionRectangle::overlaps(), GSkyDir::posang_deg(), GHorizDir::print(), GSPIResponse::print(), GSkyDir::print(), GWcsMOL::prj_set(), GWcsAIT::prj_set(), GWcsTAN::prj_set(), GWcsSTG::prj_set(), GWcsCAR::prj_set(), GWcsAZP::prj_set(), GWcsSIN::prj_set(), GWcsARC::prj_set(), GWcsMER::prj_set(), GWcsSFL::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(), GSkyRegionMap::set_region_rectangle(), GSkyDir::sun(), GCTAPsf2D::write(), GCTAPsfKing::write(), GCTAEventList::write_events(), and GHorizDir::zenith_deg().

const double gammalib::sec2day = 1.0 / sec_in_day
const double gammalib::speed_of_light = 299792458.0

Definition at line 53 of file GTools.hpp.

Referenced by GEphemerides::geo2ssb().

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(), GTime::utc(), and GTime::utc2tt().

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(), com_radial_kerns_rho::eval(), GCTAModelIrfBackground::npred_roi_kern_theta::eval(), GCTAModelAeffBackground::npred_roi_kern_theta::eval(), GCTAModelSpatial::npred_roi_kern_theta::eval(), GModelSpatial::circle_int_kern_rho::eval(), com_elliptical_kerns_rho::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(), GCOMResponse::irf_diffuse(), iter_phi(), GModelSpatialRadialProfileDMBurkert::jfactor(), GModelSpatialRadialProfileDMEinasto::jfactor(), GModelSpatialRadialProfileDMZhao::jfactor(), limit_omega(), GCTABackgroundPerfTable::load(), GCTABackgroundPerfTable::mc(), GCTAModelAeffBackground::mc(), GModelSpatialEllipticalGeneralGauss::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(), GModelSpatialRadialGauss::update(), GModelSpatialEllipticalGauss::update(), GModelSpatialRadialDisk::update(), GModelSpatialRadialGeneralGauss::update(), GModelSpatialRadialRing::update(), GModelSpatialEllipticalGeneralGauss::update(), GCTAPsfPerfTable::update(), GCTAPsfVector::update(), GModelSpatialRadialShell::update(), GCTAPsf2D::update(), and GCTAPsfKing::update().

const double gammalib::twothird = 2.0/3.0