63 #define G_READ_DS_ROI "gammalib::read_ds_roi(GFitsHDU&)"
64 #define G_READ_DS_EBOUNDS "gammalib::read_ds_ebounds(GFitsHDU&)"
65 #define G_READ_DS_PHASE "gammalib::read_ds_phase(GFitsHDU&)"
66 #define G_READ_DS_GTI "gammalib::read_ds_gti_extname(GFitsHDU&)"
67 #define G_CTA_MODEL_NROI "gammalib::cta_model_nroi(GObservation*, "\
68 "GModelData*, GEnergy&, GTime&)"
102 for (
int i = 1; i <= ndskeys; ++i) {
110 if (hdu.
has_card(type_key) && hdu.
string(type_key) ==
"POS(RA,DEC)") {
114 std::string value = hdu.
string(value_key);
118 if (args.size() == 3) {
131 double ra_pnt = hdu.
real(
"RA_PNT");
132 double dec_pnt = hdu.
real(
"DEC_PNT");
150 std::string msg =
"Invalid acceptance cone value \""+value+
151 "\" encountered in data sub-space "
152 "key \""+value_key+
"\".";
190 for (
int i = 1; i <= ndskeys; ++i) {
201 std::string value = hdu.
string(value_key);
202 std::string unit = hdu.
string(unit_key);
204 if (values.size() == 2) {
209 ebounds.
append(e_min, e_max);
212 std::string msg =
"Invalid energy value \""+value+
213 "\" encountered in data selection key \""+
252 for (
int i = 1; i <= ndskeys; ++i) {
263 std::string value = hdu.
string(value_key);
265 for (
int j = 0; j < intervals.size(); ++j) {
267 if (values.size() == 2) {
270 phases.
append(phmin, phmax);
273 std::string msg =
"Invalid phase value \""+value+
274 "\" encountered in data selection key \""+
318 for (
int i = 1; i <= ndskeys; ++i) {
334 std::string msg =
"Keyword \""+value_key+
"\" missing for data "
335 "sub-space selection of type "+type_key+
336 "=\"TIME\". Please correct FITS header.";
339 if (hdu.
string(value_key) !=
"TABLE") {
340 std::string msg =
"Cannot interpret keyword \""+value_key+
"\" "
341 "value \""+hdu.
string(value_key)+
"\". Only "
342 "the value \"TABLE\" is supported.";
348 std::string msg =
"Keyword \""+ref_key+
"\" missing for data "
349 "sub-space selection of type "+type_key+
350 "=\"TIME\". Please correct FITS header.";
375 const std::string& hduclas4)
381 for (
int i = 0; i < fits.
size(); ++i) {
441 if ((rho_max > 0.0) && (resolution > 0.0)) {
444 if (iter < iter_min) {
447 else if (iter > iter_max) {
487 if ((rho > 0.0) && (resolution > 0.0)) {
490 if (iter < iter_min) {
493 else if (iter > iter_max) {
524 std::string cls = std::string(
typeid(&obs).name());
525 std::string msg =
"Invalid observation type \""+cls+
"\" provided with "
526 "name \""+obs.
name()+
"\" (ID="+obs.
id()+
"). "
527 "Please specify a \"GCTAObservation\" instance as "
577 std::string cls = std::string(
typeid(&rsp).name());
578 std::string msg =
"Invalid response type \""+cls+
"\" provided. Please "
579 "specify a \"GCTAResponse\" as argument.";
611 std::string cls = std::string(
typeid(cta.
response()).name());
612 std::string msg =
"Invalid response type \""+cls+
"\" provided in "
613 "CTA observation \""+obs.
name()+
"\" (ID="+obs.
id()+
"). "
614 "Please specify a CTA observation containing an IRF "
615 "response as argument.";
647 std::string cls = std::string(
typeid(cta.
response()).name());
648 std::string msg =
"Invalid response type \""+cls+
"\" provided. Please "
649 "specify a CTA observation containing a response cube "
681 std::string msg =
"Specified observation does not contain a valid "
682 "effective area response. Please specify a CTA "
683 "observation containing an effective area response.";
713 std::string msg =
"Specified observation does not contain a valid "
714 "background response. Please specify a CTA "
715 "observation containing a background response.";
746 if (events == NULL) {
747 std::string msg =
"Specified observation does not contain a CTA event "
748 "list. Please specify a CTA observation containing "
749 "a CTA event list as argument.";
780 if (events == NULL) {
781 std::string msg =
"Specified observation does not contain a CTA event "
782 "cube. Please specify a CTA observation containing "
783 "a CTA event cube as argument.";
812 std::string cls = std::string(
typeid(&event).name());
813 std::string msg =
"Invalid event type \""+cls+
"\" provided. Please "
814 "specify a \"GCTAEventAtom\" or \"GCTAEventBin\" "
815 "instance as argument.";
850 else if (aeff != NULL) {
853 else if (irf != NULL) {
856 else if (cube != NULL) {
859 else if (rad != NULL) {
894 else if (aeff != NULL) {
897 else if (irf != NULL) {
900 else if (cube != NULL) {
903 else if (rad != NULL) {
CTA background model base class definition.
GCTARoi read_ds_roi(const GFitsHDU &hdu)
Extract ROI from data sub-space keywords.
std::string read_ds_gti_extname(const GFitsHDU &hdu)
Return Good Time Intervals extension name from data sub-space keywords.
CTA event list class interface definition.
void append(const double &pmin, const double &pmax)
Append phase interval.
CTA Aeff background model class definition.
bool has_card(const int &cardno) const
Check existence of header card.
const GCTAInstDir & cta_dir(const std::string &origin, const GEvent &event)
Retrieve CTA instrument direction from generic event.
CTA cube-style response function class definition.
Abstract spectral model base class.
CTA IRF background model class.
CTA IRF background model class definition.
GModelSpectral * spectral(void) const
Return spectral model component.
Abstract temporal model base class.
Abstract FITS extension base class.
void append(const GEnergy &emin, const GEnergy &emax)
Append energy interval.
const GCTABackground * background(void) const
Return pointer to background model.
CTA cube-style response function class.
GModelTemporal * temporal(void) const
Return temporal model component.
CTA instrument response function class definition.
const GCTAPointing & cta_pnt(const std::string &origin, const GObservation &obs)
Retrieve CTA pointing from generic observation.
Abstract interface for the event classes.
const double & radius(void) const
Returns radius of region of interest in degrees.
CTA pointing class interface definition.
virtual void response(const GResponse &rsp)
Set response function.
const GCTAEventCube & cta_event_cube(const std::string &origin, const GObservation &obs)
Retrieve CTA event cube from generic observation.
Radial acceptance model class interface definition.
GModelSpectral * spectral(void) const
Return spectral model component.
std::string strip_chars(const std::string &arg, const std::string &chars)
Strip leading and trailing character from string.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
Interface for the CTA region of interest class.
const GCTAResponseCube & cta_rsp_cube(const std::string &origin, const GObservation &obs)
Retrieve CTA cube response from generic observation.
GPhases read_ds_phase(const GFitsHDU &hdu)
Read phase boundary data sub-space keywords.
void pointing(const GCTAPointing &pointing)
Set CTA pointing.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
const GModelTemporal * cta_model_temporal(const GModelData &model)
Retrieve temporal component from CTA background model.
const GCTABackground & cta_rsp_bkg(const std::string &origin, const GObservation &obs)
Retrieve CTA background response from generic observation.
void id(const std::string &id)
Set observation identifier.
Abstract FITS extension base class definition.
Definition of support function used by CTA classes.
double real(const std::string &keyname) const
Return card value as double precision.
CTA effective area base class definition.
Abstract temporal model base class interface definition.
CTA event bin container class.
GModelSpectral * spectral(void) const
Return spectral model component.
Phase intervals class interface definition.
Energy boundaries container class.
GModelTemporal * temporal(void) const
Return temporal model component.
const GCTAResponse * cta_rsp(const std::string &origin, const GResponse &rsp)
Retrieve CTA response from generic observation.
const GCTAAeff * aeff(void) const
Return pointer to effective area response.
const GCTAInstDir & centre(void) const
Returns region of interest centre.
Abstract data model base class interface definition.
GCTAInstDir instdir(const GSkyDir &skydir) const
Get instrument direction from sky direction.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
CTA cube background model class.
Abstract data model class.
CTA instrument direction class interface definition.
const GCTAEventList & cta_event_list(const std::string &origin, const GObservation &obs)
Retrieve CTA event list from generic observation.
const GModelSpectral * cta_model_spectral(const GModelData &model)
Retrieve spectral component from CTA background model.
double resolution(const GModelSpatial *model)
Determine resolution of spatial model.
int integer(const std::string &keyname) const
Return card value as integer.
GModelSpectral * spectral(void) const
Return spectral model component.
const GCTAObservation & cta_obs(const std::string &origin, const GObservation &obs)
Retrieve CTA observation from generic observation.
Abstract observation base class.
void radec_deg(const double &ra, const double &dec)
Set equatorial sky direction (degrees)
CTA response abstract base class definition.
const std::string & extname(void) const
Return extension name.
CTA region of interest class interface definition.
CTA observation class interface definition.
std::string gadf_hduclas4(const GFits &fits, const std::string &hduclas4)
Return extension name for GADF response table of given HDU class 4.
CTA instrument response function class.
CTA instrument response function class.
Abstract base class for the CTA effective area.
Abstract spectral model base class interface definition.
Abstract response base class definition.
void name(const std::string &name)
Set observation name.
GModelTemporal * temporal(void) const
Return temporal model component.
int iter_phi(const double &rho, const double &resolution, const int &iter_min, const int &iter_max)
Determine number of azimuthal Romberg iterations.
GModelTemporal * temporal(void) const
Return temporal model component.
CTA cube background model class interface definition.
GModelSpectral * spectral(void) const
Return spectral model component.
int size(void) const
Return number of HDUs in FITS file.
CTA event bin container class interface definition.
virtual GEvents * events(void)
Return events.
std::string string(const std::string &keyname) const
Return card value as string.
Energy boundaries class interface definition.
Abstract base class for the CTA background model.
Radial acceptance model class.
CTA instrument direction class.
Abstract instrument response base class.
#define G_READ_DS_EBOUNDS
GEbounds read_ds_ebounds(const GFitsHDU &hdu)
Read energy boundary data sub-space keywords.
const GCTAAeff & cta_rsp_aeff(const std::string &origin, const GObservation &obs)
Retrieve CTA effective area response from generic observation.
int iter_rho(const double &rho_max, const double &resolution, const int &iter_min, const int &iter_max)
Determine number of radial Romberg iterations.
const GCTAResponseIrf & cta_rsp_irf(const std::string &origin, const GObservation &obs)
Retrieve CTA IRF response from generic observation.
GModelTemporal * temporal(void) const
Return temporal model component.
Mathematical function definitions.
double todouble(const std::string &arg)
Convert string into double precision value.
Class that handles energies in a unit independent way.
Background model class interface definition.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.