ctools
2.0.0
|
Base class for observation tools. More...
#include <ctobservation.hpp>
Public Member Functions | |
ctobservation (const std::string &name, const std::string &version) | |
Name constructor. More... | |
ctobservation (const std::string &name, const std::string &version, const GApplicationPars &pars) | |
Application parameters constructor. More... | |
ctobservation (const std::string &name, const std::string &version, int argc, char *argv[]) | |
Command line constructor. More... | |
ctobservation (const std::string &name, const std::string &version, const GObservations &obs) | |
Observations constructor. More... | |
ctobservation (const ctobservation &app) | |
Copy constructor. More... | |
virtual | ~ctobservation (void) |
Destructor. More... | |
ctobservation & | operator= (const ctobservation &app) |
Assignment operator. More... | |
virtual void | clear (void)=0 |
virtual void | process (void)=0 |
virtual void | save (void)=0 |
void | obs (const GObservations &obs) |
Set observation container. More... | |
const GObservations & | obs (void) const |
Return observation container. More... | |
Public Member Functions inherited from ctool | |
ctool (const std::string &name, const std::string &version) | |
Name constructor. More... | |
ctool (const std::string &name, const std::string &version, const GApplicationPars &pars) | |
Application parameter constructor. More... | |
ctool (const std::string &name, const std::string &version, int argc, char *argv[]) | |
Command line constructor. More... | |
ctool (const ctool &app) | |
Copy constructor. More... | |
virtual | ~ctool (void) |
Destructor. More... | |
ctool & | operator= (const ctool &app) |
Assignment operator. More... | |
virtual void | run (void) |
Run ctool. More... | |
virtual void | execute (void) |
Execute ctool. More... | |
Protected Member Functions | |
GCTAObservation * | first_unbinned_observation (void) |
Return first unbinned CTA observation. More... | |
GCTAObservation * | next_unbinned_observation (void) |
Return next unbinned CTA observation. More... | |
const GCTAObservation * | first_unbinned_observation (void) const |
Return first unbinned CTA observation (const version) More... | |
const GCTAObservation * | next_unbinned_observation (void) const |
Return next unbinned CTA observation (const version) More... | |
void | read_ogip_keywords (GFitsHDU *hdu) const |
Read OGIP keywords from FITS HDU. More... | |
void | write_ogip_keywords (GFitsHDU *hdu) const |
Write OGIP keywords in FITS HDU. More... | |
void | set_obs_statistic (const std::string &statistic) |
Set fit statistic for CTA observations. More... | |
void | set_obs_bounds () |
Set observation boundaries for CTA observations. More... | |
void | save_events_fits (void) |
Save event list in FITS format. More... | |
void | save_events_xml (void) |
Save event list(s) in XML format. More... | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const ctobservation &app) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Member Functions inherited from ctool | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const ctool &app) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | sync_pfiles (void) |
Synchronise parameter files. More... | |
const bool & | read_ahead (void) const |
Signal whether parameters should be read ahead. More... | |
void | setup_observations (GObservations &obs, const bool &response=true, const bool &list=true, const bool &cube=true) |
Setup observation container. More... | |
void | setup_models (GObservations &obs, const std::string &name="") |
Setup model container. More... | |
GEbounds | create_ebounds (void) |
Create energy boundaries from user parameters. More... | |
GEnergies | create_energies (void) |
Create energies from user parameters. More... | |
GSkyMap | create_map (const GObservations &obs) |
Create a skymap from user parameters. More... | |
GCTAEventCube | create_cube (const GObservations &obs) |
Create a CTA event cube from user parameters. More... | |
GCTAObservation | create_cta_obs (void) |
Create a CTA observation from User parameters. More... | |
void | require_inobs (const std::string &method) |
Throws exception if inobs parameter is not valid. More... | |
void | require_inobs_nolist (const std::string &method) |
void | require_inobs_nocube (const std::string &method) |
Throws exception if inobs parameter is a counts cube. More... | |
GCTARoi | get_roi (const GCTAPointing &pnt=GCTAPointing()) |
Return RoI from User parameters. More... | |
GEbounds | get_ebounds (void) |
Return energy boundaries from User parameters. More... | |
GGti | get_gti (const GTimeReference &ref) |
Return Good Time Intervals from User parameter. More... | |
GCTAPointing | get_pointing (void) |
Return CTA pointing from User parameters. More... | |
GSkyDir | get_skydir (void) |
Return sky direction from User parameters. More... | |
std::string | set_outfile_name (const std::string &filename) |
Set output file name. More... | |
bool | is_stacked (void) |
Query user parameters for stacked analysis. More... | |
bool | is_onoff (void) |
Query user parameters for On/Off analysis. More... | |
void | log_parameters (const GChatter &chatter) |
Log application parameters. More... | |
void | log_observations (const GChatter &chatter, const GObservations &obs, const std::string &what="Observation") |
Log observation container. More... | |
void | log_models (const GChatter &chatter, const GModels &models, const std::string &what="Model") |
Log model container. More... | |
void | set_response (GObservations &obs) |
Set response for all CTA observations in container. More... | |
std::vector< bool > | set_edisp (GObservations &obs, const bool &edisp) const |
Set energy dispersion to CTA observations. More... | |
void | restore_edisp (GObservations &obs, const std::vector< bool > &edisp) const |
Restore energy dispersion flags of CTA observations. More... | |
void | set_obs_response (GCTAObservation *obs) |
Set response for CTA observation. More... | |
GObservations | get_observations (const bool &get_response=true) |
Get observation container. More... | |
GSkyDir | get_mean_pointing (const GObservations &obs) |
Derives mean pointing from CTA observations. More... | |
size_t | get_current_rss (void) |
Get current resident set size (physical memory use) in Bytes. More... | |
std::string | get_obs_header (const GObservation *obs) const |
Return observation header string. More... | |
GEnergies | insert_energy_boundaries (const GEnergies &energies, const GCTAObservation &obs) |
Insert observation energy boundaries into list of energies. More... | |
std::vector< bool > | cube_layer_usage (const GEbounds &cube_ebounds, const GEbounds &list_ebounds) const |
Determine the counts cube layer usage. More... | |
std::string | get_gtiname (const std::string &filename, const std::string &evtname) const |
Get Good Time Intervals extension name. More... | |
void | save_event_list (const GCTAObservation *obs, const std::string &infile, const std::string &evtname, const std::string >iname, const std::string &outfile) const |
Save event list into FITS file. More... | |
std::string | warn_too_few_energies (const GEnergies &energies) const |
Set warning string if there are too few energies. More... | |
std::string | warn_xml_suffix (const GFilename &filename) const |
Set warning string if file has no .xml suffix. More... | |
void | provide_help (void) const |
Dump help text in the console. More... | |
Protected Attributes | |
GObservations | m_obs |
Observation container. More... | |
Protected Attributes inherited from ctool | |
bool | m_read_ahead |
Read ahead output parameters. More... | |
bool | m_use_xml |
Use XML file instead of FITS file for observations. More... | |
Private Attributes | |
std::string | m_ogip_telescope |
Name of telescope. More... | |
GTime | m_ogip_tstart |
Start time for OGIP keywords. More... | |
GTime | m_ogip_tstop |
Stop time for OGIP keywords. More... | |
double | m_ogip_telapse |
Elapsed time. More... | |
double | m_ogip_exposure |
Exposure time. More... | |
double | m_ogip_ontime |
Ontime for OGIP keywords. More... | |
double | m_ogip_livetime |
Livetime for OGIP keywords. More... | |
int | m_index_unbinned |
Current index of unbinned observation. More... | |
Base class for observation tools.
This is the baseclass for observation tools. Observation tools are ctools that hold an observation container.
Definition at line 44 of file ctobservation.hpp.
ctobservation::ctobservation | ( | const std::string & | name, |
const std::string & | version | ||
) |
Name constructor.
[in] | name | Observation tool name. |
[in] | version | Observation tool version. |
Constructs a observation tool from the name
and version
. See the equivalent ctool constructor for details.
Definition at line 56 of file ctobservation.cpp.
References init_members().
ctobservation::ctobservation | ( | const std::string & | name, |
const std::string & | version, | ||
const GApplicationPars & | pars | ||
) |
Application parameters constructor.
[in] | name | Observation tool name. |
[in] | version | Observation tool version. |
[in] | pars | Application parameters. |
Constructs a observation tool from the name
, version
and the application parameters pars
. See the equivalent ctool constructor for details.
Definition at line 78 of file ctobservation.cpp.
References init_members().
ctobservation::ctobservation | ( | const std::string & | name, |
const std::string & | version, | ||
int | argc, | ||
char * | argv[] | ||
) |
Command line constructor.
[in] | name | Observation tool name. |
[in] | version | Observation tool version. |
[in] | argc | Number of arguments in command line. |
[in] | argv | Array of command line arguments. |
Constructs a observation tool from the name
, version
and command line arguments. See the equivalent ctool constructor for details.
Definition at line 102 of file ctobservation.cpp.
References init_members().
ctobservation::ctobservation | ( | const std::string & | name, |
const std::string & | version, | ||
const GObservations & | obs | ||
) |
Observations constructor.
[in] | name | Observation tool name. |
[in] | version | Observation tool version. |
[in] | obs | Observation container. |
Constructs a observation tool from the name
, version
and an observation container.
Definition at line 125 of file ctobservation.cpp.
References init_members(), m_obs, and obs().
ctobservation::ctobservation | ( | const ctobservation & | app | ) |
Copy constructor.
[in] | app | Observation tool. |
Constructs an instance of a observation tool by copying information from another observation tool.
Definition at line 148 of file ctobservation.cpp.
References copy_members(), and init_members().
|
virtual |
Destructor.
Destructs the observation tool.
Definition at line 166 of file ctobservation.cpp.
References free_members().
|
pure virtual |
Implements ctool.
Implemented in ctbin, ctbutterfly, cttsmap, ctmodel, ctobssim, ctulimit, ctlikelihood, ctphase, ctcubemask, ctfindvar, ctprob, ctselect, ctskymap, ctbkgcube, ctedispcube, ctexpcube, ctpsfcube, ctool_like, ctool_obs, cterror, and ctlike.
|
protected |
Copy class members.
[in] | app | Observation tool. |
Definition at line 769 of file ctobservation.cpp.
References m_index_unbinned, m_obs, m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, and m_ogip_tstop.
Referenced by ctobservation(), and operator=().
|
inlineprotected |
Return first unbinned CTA observation.
Returns a pointer to the first unbinned CTA observation in the container. If no CTA observation exists a NULL pointer is returned.
The method calls next_unbinned_observation(). See the method for details.
Definition at line 152 of file ctobservation.hpp.
Referenced by ctskymap::fill_maps(), ctprob::process(), ctphase::process(), ctbin::process(), save_events_fits(), and save_events_xml().
|
protected |
Return first unbinned CTA observation (const version)
Returns a const pointer to the first unbinned CTA observation in the container. If no CTA observation exists a NULL pointer is returned.
The method calls next_unbinned_observation(). See the method for details.
Definition at line 237 of file ctobservation.cpp.
References m_index_unbinned, m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, m_ogip_tstop, next_unbinned_observation(), and obs().
|
protected |
Delete class members.
Definition at line 792 of file ctobservation.cpp.
Referenced by cterror::clear(), ctlike::clear(), ctool_obs::clear(), ctedispcube::clear(), ctbkgcube::clear(), ctexpcube::clear(), ctpsfcube::clear(), ctskymap::clear(), ctfindvar::clear(), ctprob::clear(), ctselect::clear(), ctcubemask::clear(), ctphase::clear(), ctulimit::clear(), ctobssim::clear(), ctmodel::clear(), cttsmap::clear(), ctbutterfly::clear(), ctbin::clear(), operator=(), and ~ctobservation().
|
protected |
Initialise class members.
Definition at line 744 of file ctobservation.cpp.
References m_index_unbinned, m_obs, m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, and m_ogip_tstop.
Referenced by cterror::clear(), ctlike::clear(), ctool_obs::clear(), ctedispcube::clear(), ctbkgcube::clear(), ctexpcube::clear(), ctpsfcube::clear(), ctskymap::clear(), ctfindvar::clear(), ctprob::clear(), ctselect::clear(), ctcubemask::clear(), ctphase::clear(), ctulimit::clear(), ctobssim::clear(), ctmodel::clear(), cttsmap::clear(), ctbutterfly::clear(), ctbin::clear(), ctobservation(), and operator=().
|
inlineprotected |
Return next unbinned CTA observation.
Returns a pointer to the next unbinned CTA observation in the container. If no CTA observation exists any more a NULL pointer is returned.
The method writes for each encountered observation a level 3 header into the logger. It will also signal when an observation was skipped because it either was not a CTA observation or not an unbinned observation.
Definition at line 173 of file ctobservation.hpp.
Referenced by ctskymap::fill_maps(), first_unbinned_observation(), ctprob::process(), ctphase::process(), ctbin::process(), save_events_fits(), and save_events_xml().
|
protected |
Return next unbinned CTA observation (const version)
Returns a const pointer to the next unbinned CTA observation in the container. If no CTA observation exists any more a NULL pointer is returned.
The method writes for each encountered observation a level 3 header into the logger. It will also signal when an observation was skipped because it either was not a CTA observation or not an unbinned observation.
Definition at line 274 of file ctobservation.cpp.
References ctool::get_obs_header(), m_index_unbinned, m_obs, m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, m_ogip_tstop, and obs().
|
inline |
Set observation container.
[in] | obs | Observation container. |
Set observation container.
Definition at line 120 of file ctobservation.hpp.
Referenced by cscripts.cslightcrv.cslightcrv::_adjust_model_pars(), cscripts.csscs.csscs::_adjust_model_pars(), cscripts.csspec.csspec::_adjust_model_pars(), cscripts.cstsmapsplit.cstsmapsplit::_compute_null_hypothesis(), cscripts.csphasecrv.csphasecrv::_create_fits_table(), cscripts.cslightcrv.cslightcrv::_create_fits_table(), cscripts.cslightcrv.cslightcrv::_create_tbounds(), cscripts.csspec.csspec::_fit_model(), cscripts.csbkgmodel.csbkgmodel::_generate_runwise_bkg(), cscripts.csphasecrv.csphasecrv::_get_free_par_names(), cscripts.cslightcrv.cslightcrv::_get_free_par_names(), cscripts.csbkgmodel.csbkgmodel::_get_instrument(), cscripts.csobsselect.csobsselect::_get_parameters(), cscripts.csebins.csebins::_get_parameters(), cscripts.csmodelselect.csmodelselect::_get_parameters(), cscripts.csresmap.csresmap::_get_parameters(), cscripts.csresspec.csresspec::_get_parameters(), cscripts.csobsinfo.csobsinfo::_get_parameters(), cscripts.cstsmapsplit.cstsmapsplit::_get_parameters(), cscripts.csobs2caldb.csobs2caldb::_get_parameters(), cscripts.csbkgmodel.csbkgmodel::_get_parameters(), cscripts.cspull.cspull::_get_parameters(), cscripts.cstsdist.cstsdist::_get_parameters(), cscripts.csspec.csspec::_get_parameters(), cscripts.cssens.cssens::_get_parameters(), cscripts.csphasecrv.csphasecrv::_get_parameters(), cscripts.cslightcrv.cslightcrv::_get_parameters(), cscripts.csscs.csscs::_get_parameters(), cscripts.csphagen.csphagen::_get_parameters(), cscripts.csphagen.csphagen::_get_parameters_bkgmethod_custom(), cscripts.csphagen.csphagen::_get_parameters_bkgmethod_off(), cscripts.cssens.cssens::_get_sensitivity(), cscripts.csspec.csspec::_log_spectral_binning(), cscripts.csscs.csscs::_mask_observations(), cscripts.csphasecrv.csphasecrv::_phase_bin(), cscripts.csphagen.csphagen::_process_observation(), cscripts.csspec.csspec::_select_obs(), cscripts.csspec.csspec::_set_ebounds(), cscripts.cssens.cssens::_set_obs_ebounds(), cscripts.csspec.csspec::_set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec::_set_replace_src_spectrum_by_nodes(), cscripts.cssens.cssens::_set_source(), cscripts.cssens.cssens::_set_src_prefactor(), cscripts.cstsdist.cstsdist::_sim(), cscripts.cssens.cssens::_sim_evt_excess(), cscripts.cslightcrv.cslightcrv::_timebin(), cscripts.cspull.cspull::_trial(), cscripts.csresmap.csresmap::models(), cscripts.cstsdist.cstsdist::models(), cscripts.cspull.cspull::models(), cscripts.cslightcrv.cslightcrv::models(), cscripts.csspec.csspec::models(), cscripts.csobsinfo.csobsinfo::process(), cscripts.cstsmapsplit.cstsmapsplit::process(), cscripts.csresmap.csresmap::process(), cscripts.csmodelselect.csmodelselect::process(), cscripts.csebins.csebins::process(), cscripts.csobsselect.csobsselect::process(), cscripts.cstsdist.cstsdist::process(), cscripts.cspull.cspull::process(), cscripts.csbkgmodel.csbkgmodel::process(), cscripts.csphasecrv.csphasecrv::process(), cscripts.cslightcrv.cslightcrv::process(), cscripts.csresspec.csresspec::process(), cscripts.csscs.csscs::process(), cscripts.csphagen.csphagen::process(), cscripts.cssens.cssens::process(), cscripts.csspec.csspec::process(), cscripts.csobsselect.csobsselect::save(), and cscripts.csphagen.csphagen::save().
|
inline |
Return observation container.
Returns a reference to the observation container.
Definition at line 135 of file ctobservation.hpp.
References m_obs.
Referenced by cscripts.cslightcrv.cslightcrv::_adjust_model_pars(), cscripts.csscs.csscs::_adjust_model_pars(), cscripts.csspec.csspec::_adjust_model_pars(), cscripts.cstsmapsplit.cstsmapsplit::_compute_null_hypothesis(), cscripts.csphasecrv.csphasecrv::_create_fits_table(), cscripts.cslightcrv.cslightcrv::_create_fits_table(), cscripts.cslightcrv.cslightcrv::_create_tbounds(), cscripts.csspec.csspec::_fit_model(), cscripts.csbkgmodel.csbkgmodel::_generate_runwise_bkg(), cscripts.csphasecrv.csphasecrv::_get_free_par_names(), cscripts.cslightcrv.cslightcrv::_get_free_par_names(), cscripts.csbkgmodel.csbkgmodel::_get_instrument(), cscripts.csobsselect.csobsselect::_get_parameters(), cscripts.csebins.csebins::_get_parameters(), cscripts.csmodelselect.csmodelselect::_get_parameters(), cscripts.csresmap.csresmap::_get_parameters(), cscripts.csresspec.csresspec::_get_parameters(), cscripts.csobsinfo.csobsinfo::_get_parameters(), cscripts.cstsmapsplit.cstsmapsplit::_get_parameters(), cscripts.csobs2caldb.csobs2caldb::_get_parameters(), cscripts.csbkgmodel.csbkgmodel::_get_parameters(), cscripts.cspull.cspull::_get_parameters(), cscripts.cstsdist.cstsdist::_get_parameters(), cscripts.csspec.csspec::_get_parameters(), cscripts.cssens.cssens::_get_parameters(), cscripts.csphasecrv.csphasecrv::_get_parameters(), cscripts.cslightcrv.cslightcrv::_get_parameters(), cscripts.csscs.csscs::_get_parameters(), cscripts.csphagen.csphagen::_get_parameters(), cscripts.csphagen.csphagen::_get_parameters_bkgmethod_custom(), cscripts.csphagen.csphagen::_get_parameters_bkgmethod_off(), cscripts.cssens.cssens::_get_sensitivity(), cscripts.csspec.csspec::_log_spectral_binning(), cscripts.csscs.csscs::_mask_observations(), cscripts.csphasecrv.csphasecrv::_phase_bin(), cscripts.csphagen.csphagen::_process_observation(), cscripts.csspec.csspec::_select_obs(), cscripts.csspec.csspec::_set_ebounds(), cscripts.cssens.cssens::_set_obs_ebounds(), cscripts.csspec.csspec::_set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec::_set_replace_src_spectrum_by_nodes(), cscripts.cssens.cssens::_set_source(), cscripts.cssens.cssens::_set_src_prefactor(), cscripts.cstsdist.cstsdist::_sim(), cscripts.cssens.cssens::_sim_evt_excess(), cscripts.cslightcrv.cslightcrv::_timebin(), cscripts.cspull.cspull::_trial(), ctfindvar::create_cube(), ctobservation(), ctskymap::fill_maps(), first_unbinned_observation(), ctfindvar::get_alphas(), ctmodel::get_parameters(), ctfindvar::get_tstart(), ctfindvar::get_tstop(), ctfindvar::init_gtis(), cscripts.csresmap.csresmap::models(), cscripts.cstsdist.cstsdist::models(), cscripts.cspull.cspull::models(), cscripts.cslightcrv.cslightcrv::models(), cscripts.csspec.csspec::models(), next_unbinned_observation(), obs(), ctbin::obs_cube_stacked(), ctselect::process(), ctprob::process(), ctcubemask::process(), ctphase::process(), ctobssim::process(), ctmodel::process(), ctbutterfly::process(), ctbin::process(), cscripts.csobsinfo.csobsinfo::process(), cscripts.cstsmapsplit.cstsmapsplit::process(), cscripts.csresmap.csresmap::process(), cscripts.csmodelselect.csmodelselect::process(), cscripts.csebins.csebins::process(), cscripts.csobsselect.csobsselect::process(), cscripts.cstsdist.cstsdist::process(), cscripts.cspull.cspull::process(), cscripts.csbkgmodel.csbkgmodel::process(), cscripts.csphasecrv.csphasecrv::process(), cscripts.cslightcrv.cslightcrv::process(), cscripts.csresspec.csresspec::process(), cscripts.csscs.csscs::process(), cscripts.csphagen.csphagen::process(), cscripts.cssens.cssens::process(), cscripts.csspec.csspec::process(), ctprob::publish(), ctselect::publish(), ctcubemask::publish(), ctphase::publish(), ctobssim::publish(), ctbin::save(), cscripts.csobsselect.csobsselect::save(), cscripts.csphagen.csphagen::save(), save_events_fits(), save_events_xml(), ctcubemask::save_fits(), ctselect::save_fits(), ctobssim::save_fits(), ctcubemask::save_xml(), ctselect::save_xml(), ctobssim::save_xml(), and set_obs_bounds().
ctobservation & ctobservation::operator= | ( | const ctobservation & | app | ) |
Assignment operator.
[in] | app | Observation tool. |
Assigns a observation tool.
Definition at line 190 of file ctobservation.cpp.
References copy_members(), free_members(), init_members(), and ctool::operator=().
Referenced by ctool_obs::operator=(), ctedispcube::operator=(), ctexpcube::operator=(), ctpsfcube::operator=(), ctbkgcube::operator=(), ctskymap::operator=(), ctselect::operator=(), ctprob::operator=(), ctfindvar::operator=(), ctcubemask::operator=(), ctphase::operator=(), ctobssim::operator=(), ctlikelihood::operator=(), ctmodel::operator=(), and ctbin::operator=().
|
pure virtual |
Implements ctool.
Implemented in ctbin, ctbutterfly, cttsmap, ctmodel, ctobssim, ctulimit, ctlikelihood, ctphase, ctcubemask, ctfindvar, ctprob, ctselect, ctskymap, ctbkgcube, ctedispcube, ctexpcube, ctpsfcube, ctool_like, ctool_obs, cterror, and ctlike.
|
protected |
Read OGIP keywords from FITS HDU.
[in,out] | hdu | Pointer to FITS HDU. |
Read OGIP keywords from FITS HDU.
Definition at line 353 of file ctobservation.cpp.
References m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, and m_ogip_tstop.
Referenced by ctskymap::get_parameters().
|
pure virtual |
Implements ctool.
Implemented in ctbin, ctbutterfly, cttsmap, ctmodel, ctobssim, ctulimit, ctlikelihood, ctphase, ctcubemask, ctfindvar, ctprob, ctselect, ctskymap, ctbkgcube, ctedispcube, ctexpcube, ctpsfcube, ctool_like, ctool_obs, cterror, and ctlike.
|
protected |
Save event list in FITS format.
Save the event list as a FITS file. The file name of the FITS file is specified by the outobs
parameter.
Definition at line 621 of file ctobservation.cpp.
References first_unbinned_observation(), m_obs, next_unbinned_observation(), obs(), and ctool::save_event_list().
Referenced by ctprob::save(), and ctphase::save().
|
protected |
Save event list(s) in XML format.
Save the event list(s) into FITS files and write the file path information into a XML file. The filename of the XML file is specified by the outobs
parameter, the filename(s) of the event lists are built by prepending a prefix to the input event list filenames. Any path present in the input filename will be stripped, i.e. the event list(s) will be written in the local working directory (unless a path is specified in the prefix).
Definition at line 683 of file ctobservation.cpp.
References first_unbinned_observation(), ctool::get_gtiname(), m_obs, next_unbinned_observation(), obs(), ctool::save_event_list(), ctool::set_outfile_name(), and ctool::warn_xml_suffix().
Referenced by ctprob::save(), and ctphase::save().
|
protected |
Set observation boundaries for CTA observations.
Sets the observation boundaries for all CTA observations that contain event lists if they do not yet exist.
If the event list does not contain any Good Time Intervals, they are derived from the time limits provided by the tmin and tmax user parameters if they exist and are valid. Furthermore, the reference time for the Good Time Intervals is inferred from the mjdref
parameter if it exists. Otherwise, G_CTA_MJDREF is used as reference time.
If the event list does not contain energy boundaries, they are derived from the energy limits provided by the emin and emax user parameters if they exist and are valid.
If the event list does not contain a valid ROI, the ROI radius is determined by the rad user parameter if it exists and is valid. The center is either taken from the pointing direction, and if this is not valid, it is set from the ra and dec user parameters if they exist and are valid.
Definition at line 514 of file ctobservation.cpp.
Referenced by ctmodel::get_obs(), and ctobssim::get_parameters().
|
protected |
Set fit statistic for CTA observations.
[in] | statistic | Requested fit statistic. |
Sets the fit statistic for all CTA observations. The method handles regular CTA observations as well as On/Off observations.
For regular CTA observations of type GCTAObservation the fit statistic is only set for binned or stacked observations. Possible values are POISSON
, GAUSSIAN
or CHI2
(case insensitive).
For On/Off CTA observations of type GCTAOnOffObservation the fit statistic is always set. Possible values are POISSON
, CSTAT
or WSTAT
(case insensitive).
If statistic
is any other string the fit statistic of the observations will not be modified.
Definition at line 455 of file ctobservation.cpp.
References m_obs.
Referenced by cterror::get_parameters(), ctlike::get_parameters(), ctulimit::get_parameters(), ctbutterfly::get_parameters(), and cttsmap::get_parameters().
|
protected |
Write OGIP keywords in FITS HDU.
[in,out] | hdu | Pointer to FITS HDU. |
Writes OGIP keywords in FITS HDU.
Definition at line 395 of file ctobservation.cpp.
References m_ogip_exposure, m_ogip_livetime, m_ogip_ontime, m_ogip_telapse, m_ogip_telescope, m_ogip_tstart, and m_ogip_tstop.
Referenced by ctskymap::write_map().
|
mutableprivate |
Current index of unbinned observation.
Definition at line 108 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), and next_unbinned_observation().
|
protected |
Observation container.
Definition at line 97 of file ctobservation.hpp.
Referenced by ctbutterfly::check_model(), copy_members(), ctfindvar::create_cube(), ctobservation(), ctlikelihood::evaluate(), ctprob::evaluate_probability(), ctskymap::fill_maps(), ctbutterfly::gaussian_error_propagation(), ctfindvar::get_alphas(), ctulimit::get_model_parameter(), ctmodel::get_obs(), ctulimit::get_parameter_brackets(), cterror::get_parameters(), ctedispcube::get_parameters(), ctpsfcube::get_parameters(), ctlike::get_parameters(), ctexpcube::get_parameters(), ctfindvar::get_parameters(), ctselect::get_parameters(), ctprob::get_parameters(), ctbkgcube::get_parameters(), ctcubemask::get_parameters(), ctphase::get_parameters(), ctskymap::get_parameters(), ctulimit::get_parameters(), ctobssim::get_parameters(), ctbutterfly::get_parameters(), cttsmap::get_parameters(), ctmodel::get_parameters(), ctbin::get_parameters(), ctfindvar::get_tstart(), ctfindvar::get_tstop(), ctedispcube::init_cube(), ctpsfcube::init_cube(), ctexpcube::init_cube(), ctfindvar::init_gtis(), init_members(), ctbin::init_sky_dir_cache(), ctmodel::models(), next_unbinned_observation(), obs(), ctbin::obs_cube_stacked(), ctlike::optimize_lm(), ctlike::process(), cterror::process(), ctool_obs::process(), ctool_like::process(), ctedispcube::process(), ctexpcube::process(), ctbkgcube::process(), ctpsfcube::process(), ctfindvar::process(), ctprob::process(), ctselect::process(), ctcubemask::process(), ctphase::process(), ctobssim::process(), ctulimit::process(), ctmodel::process(), cttsmap::process(), ctbutterfly::process(), ctbin::process(), ctselect::publish(), ctprob::publish(), ctcubemask::publish(), ctphase::publish(), ctobssim::publish(), ctlike::refit(), ctlike::reoptimize_lm(), cterror::save(), ctlike::save(), ctselect::save(), ctprob::save(), ctcubemask::save(), ctphase::save(), ctobssim::save(), ctbin::save(), save_events_fits(), save_events_xml(), ctcubemask::save_fits(), ctselect::save_fits(), ctobssim::save_fits(), ctcubemask::save_xml(), ctselect::save_xml(), ctobssim::save_xml(), set_obs_bounds(), set_obs_statistic(), ctulimit::ulimit_bisection(), and ctlike::xml_result().
|
mutableprivate |
Exposure time.
Definition at line 105 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Livetime for OGIP keywords.
Definition at line 107 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Ontime for OGIP keywords.
Definition at line 106 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Elapsed time.
Definition at line 104 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Name of telescope.
Definition at line 101 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Start time for OGIP keywords.
Definition at line 102 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().
|
mutableprivate |
Stop time for OGIP keywords.
Definition at line 103 of file ctobservation.hpp.
Referenced by copy_members(), first_unbinned_observation(), init_members(), next_unbinned_observation(), read_ogip_keywords(), and write_ogip_keywords().