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

INTEGRAL/SPI data space model. More...

#include <GSPIModelDataSpace.hpp>

Inheritance diagram for GSPIModelDataSpace:
GModelData GModel GBase

Public Member Functions

 GSPIModelDataSpace (void)
 Void constructor. More...
 
 GSPIModelDataSpace (const GSPIObservation &obs, const std::string &name, const std::string &method, const int &index)
 Model and method constructor. More...
 
 GSPIModelDataSpace (const GXmlElement &xml)
 XML constructor. More...
 
 GSPIModelDataSpace (const GSPIModelDataSpace &model)
 Copy constructor. More...
 
virtual ~GSPIModelDataSpace (void)
 Destructor. More...
 
virtual GSPIModelDataSpaceoperator= (const GSPIModelDataSpace &model)
 Assignment operator. More...
 
virtual void clear (void)
 Clear instance. More...
 
virtual GSPIModelDataSpaceclone (void) const
 Clone instance. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual std::string type (void) const
 Return model type. More...
 
virtual bool is_constant (void) const
 Signal if model is temporally constant. More...
 
virtual double eval (const GEvent &event, const GObservation &obs, const bool &gradients=false) const
 Evaluate function. More...
 
virtual double npred (const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const
 Return spatially integrated data model. More...
 
virtual GSPIEventCubemc (const GObservation &obs, GRan &ran) const
 Return simulated list of events. More...
 
virtual void read (const GXmlElement &xml)
 Read model from XML element. More...
 
virtual void write (GXmlElement &xml) const
 Write model into XML element. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print model information. More...
 
- Public Member Functions inherited from GModelData
 GModelData (void)
 Void constructor. More...
 
 GModelData (const GXmlElement &xml)
 XML constructor. More...
 
 GModelData (const GModelData &model)
 Copy constructor. More...
 
virtual ~GModelData (void)
 Destructor. More...
 
virtual GModelDataoperator= (const GModelData &model)
 Assignment operator. More...
 
virtual GVector eval (const GObservation &obs, GMatrixSparse *gradients=NULL) const
 Return model values and gradients. More...
 
- Public Member Functions inherited from GModel
 GModel (void)
 Void constructor. More...
 
 GModel (const GXmlElement &xml)
 XML constructor. More...
 
 GModel (const GModel &model)
 Copy constructor. More...
 
virtual ~GModel (void)
 Destructor. More...
 
virtual GModeloperator= (const GModel &model)
 Assignment operator. More...
 
virtual GModelParoperator[] (const int &index)
 Returns reference to model parameter by index. More...
 
virtual const GModelParoperator[] (const int &index) const
 Returns reference to model parameter by index (const version) More...
 
virtual GModelParoperator[] (const std::string &name)
 Returns reference to model parameter by name. More...
 
virtual const GModelParoperator[] (const std::string &name) const
 Returns reference to model parameter by name const version) More...
 
int size (void) const
 Return number of parameters in model. More...
 
int scales (void) const
 Return number of scale parameters in model. More...
 
GModelParat (const int &index)
 Returns reference to model parameter by index. More...
 
const GModelParat (const int &index) const
 Returns reference to model parameter by index (const version) More...
 
bool has_par (const std::string &name) const
 Checks if parameter name exists. More...
 
bool has_scales (void) const
 Signals that model has scales. More...
 
const std::string & name (void) const
 Return parameter name. More...
 
void name (const std::string &name)
 Set parameter name. More...
 
const double & ts (void) const
 Return Test Statistic value. More...
 
void ts (const double &ts)
 Set Test Statistic value. More...
 
const bool & tscalc (void) const
 Return Test Statistic computation flag. More...
 
void tscalc (const bool &tscalc)
 Set Test Statistic computation flag. More...
 
const bool & has_ts (void) const
 Signals that model has Test Statistics value. More...
 
std::string instruments (void) const
 Returns instruments to which model applies. More...
 
void instruments (const std::string &instruments)
 Set instruments to which model applies. More...
 
GModelParscale (const int &index)
 Returns reference to scale parameter by index. More...
 
const GModelParscale (const int &index) const
 Returns reference to scale parameter by index (const version) More...
 
GModelPar scale (const std::string &instrument) const
 Returns model scale factor for a given instrument. More...
 
void scale (const GModelPar &par)
 Set model scale factor for a given instrument. More...
 
std::string ids (void) const
 Returns observation identifiers to which model applies. More...
 
void ids (const std::string &ids)
 Set observation identifiers to which model applies. More...
 
bool is_valid (const std::string &instruments, const std::string &ids) const
 Verifies if model is valid for a given instrument and identifier. More...
 
const GModelAssociationsassociations (void) const
 Return model associations. More...
 
void associations (const GModelAssociations &associations)
 Set model associations. More...
 
const bool & has_eval_indices (void) const
 Signals that parameter indices updated by eval() method were set. More...
 
const std::vector< int > & eval_indices (void) const
 Return vector of parameter indices updated by eval() method. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GSPIModelDataSpace &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void set_pointers (void)
 Set pointers. More...
 
void setup_model (const GObservation &obs) const
 Setup model. More...
 
void setup_pars (GSPIEventCube *cube)
 Setup parameters. More...
 
void setup_pointing_indices (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup pointing indices. More...
 
void setup_detector_indices (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup detector indices. More...
 
void setup_energy_indices (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup energy indices. More...
 
void setup_point (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup pointing indices and names for "point" method. More...
 
void setup_orbit (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup pointing indices and names for "orbit" method. More...
 
void setup_date (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names, const double &time)
 Setup pointing indices and names for "date" method. More...
 
void add_gedfail (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Modify pointing indices and names for "gedfail" method. More...
 
void add_gedanneal (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Modify pointing indices and names for "gedanneal" method. More...
 
void setup_dete (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup detector indices and names for "dete" method. More...
 
void setup_evtclass (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup detector indices and names for "evtclass" method. More...
 
void setup_ebin (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names)
 Setup energy indices and names for "ebin" method. More...
 
double get_date_time (const std::string &method) const
 Get time scale from method string. More...
 
void split_pointing_indices (GSPIEventCube *cube, std::vector< int > *indices, std::vector< std::string > *names, const GTime &time, const std::string &reason) const
 Split pointing indices and names at given time. More...
 
- Protected Member Functions inherited from GModelData
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GModelData &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GModel
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GModel &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void read_attributes (const GXmlElement &xml)
 Read model attributes. More...
 
void write_attributes (GXmlElement &xml) const
 Write model attributes. More...
 
std::string print_attributes (void) const
 Print model attributes. More...
 
void read_scales (const GXmlElement &xml)
 Read instrument scales from XML element. More...
 
void write_scales (GXmlElement &xml) const
 Write instrument scales into XML element. More...
 

Protected Attributes

GSPIObservationm_obs
 SPI observation. More...
 
std::string m_method
 Fitting method. More...
 
int m_index
 Index of model in event bins. More...
 
int m_map_size
 Size of parameter map. More...
 
int * m_map
 Parameter map. More...
 
std::vector< GModelParm_parameters
 Model parameters. More...
 
- Protected Attributes inherited from GModel
std::string m_name
 Model name. More...
 
std::vector< std::string > m_instruments
 Instruments to which model applies. More...
 
std::vector< GModelParm_scales
 Model instrument scale factors. More...
 
std::vector< std::string > m_ids
 Identifiers to which model applies. More...
 
std::vector< GModelPar * > m_pars
 Pointers to all model parameters. More...
 
GModelAssociations m_associations
 Model associations. More...
 
bool m_has_ts
 Signals if TS is available. More...
 
bool m_has_tscalc
 Signals if tscalc attribute is available. More...
 
bool m_tscalc
 Signals if TS should be computed. More...
 
double m_ts
 Test Statistic of the model. More...
 
bool m_has_eval_inx
 
std::vector< int > m_eval_inx
 

Detailed Description

INTEGRAL/SPI data space model.

This class implements an INTEGRAL/SPI data space model that is based on model values that are found in the INTEGRAL/SPI event cube.

Definition at line 57 of file GSPIModelDataSpace.hpp.

Constructor & Destructor Documentation

GSPIModelDataSpace::GSPIModelDataSpace ( void  )

Void constructor.

Constructs an empty INTEGRAL/SPI data space model.

Definition at line 78 of file GSPIModelDataSpace.cpp.

References init_members().

Referenced by clone().

GSPIModelDataSpace::GSPIModelDataSpace ( const GSPIObservation obs,
const std::string &  name,
const std::string &  method,
const int &  index 
)

Model and method constructor.

Parameters
[in]obsINTEGRAL/SPI observation.
[in]nameModel name.
[in]methodFit method.
[in]indexModel index.
Exceptions
GException::out_of_rangeModel index out of range.

Constructs an INTEGRAL/SPI data space model by setting the fit method and the model index.

The constructor uses the INTEGRAL/SPI observation to setup the model parameters and the mapping of parameters to the data space.

Definition at line 105 of file GSPIModelDataSpace.cpp.

References GObservation::events(), G_CONSTRUCTOR, init_members(), m_index, m_method, GModel::m_name, m_obs, GSPIEventCube::models(), GModel::name(), and setup_model().

GSPIModelDataSpace::GSPIModelDataSpace ( const GXmlElement xml)
explicit

XML constructor.

Parameters
[in]xmlXML element.

Constructs an INTEGRAL/SPI data space model from the information that is found in an XML element. Please refer to the read() method to learn more about the information that is expected in the XML element.

Definition at line 147 of file GSPIModelDataSpace.cpp.

References init_members(), and read().

GSPIModelDataSpace::GSPIModelDataSpace ( const GSPIModelDataSpace model)

Copy constructor.

Parameters
[in]modelINTEGRAL/SPI data space model.

Constructs an INTEGRAL/SPI data space model by copying information from an existing model. Note that the copy is a deep copy, so the original object can be destroyed after the copy without any loss of information.

Definition at line 170 of file GSPIModelDataSpace.cpp.

References copy_members(), and init_members().

GSPIModelDataSpace::~GSPIModelDataSpace ( void  )
virtual

Destructor.

Destroys an INTEGRAL/SPI data space model.

Definition at line 189 of file GSPIModelDataSpace.cpp.

References free_members().

Member Function Documentation

void GSPIModelDataSpace::add_gedanneal ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Modify pointing indices and names for "gedanneal" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.

Inserts additional model parameters for each pointing where a detector annealing occured.

Definition at line 1298 of file GSPIModelDataSpace.cpp.

References GTimes::size(), gammalib::spi_annealing_start_times(), and split_pointing_indices().

Referenced by setup_pointing_indices().

void GSPIModelDataSpace::add_gedfail ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Modify pointing indices and names for "gedfail" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.

Inserts additional model parameters for each pointing where a detector failure occured.

Definition at line 1271 of file GSPIModelDataSpace.cpp.

References GTimes::size(), gammalib::spi_gedfail_times(), and split_pointing_indices().

Referenced by setup_pointing_indices().

std::string GSPIModelDataSpace::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GSPIModelDataSpace").

Implements GModelData.

Definition at line 155 of file GSPIModelDataSpace.hpp.

void GSPIModelDataSpace::clear ( void  )
virtual

Clear instance.

Resets the object to a clean initial state. All information that resided in the object will be lost.

Implements GModelData.

Definition at line 252 of file GSPIModelDataSpace.cpp.

References GModelData::free_members(), free_members(), GModel::free_members(), GModelData::init_members(), init_members(), and GModel::init_members().

Referenced by read().

GSPIModelDataSpace * GSPIModelDataSpace::clone ( void  ) const
virtual

Clone instance.

Returns
Pointer to deep copy of INTEGRAL/SPI data space model.

Clone an INTEGRAL/SPI data space model. Cloning performs a deep copy of the information, so the original object can be destroyed after cloning without any loss of information.

Implements GModelData.

Definition at line 278 of file GSPIModelDataSpace.cpp.

References GSPIModelDataSpace().

void GSPIModelDataSpace::copy_members ( const GSPIModelDataSpace model)
protected

Copy class members.

Parameters
[in]modelModel.

Definition at line 655 of file GSPIModelDataSpace.cpp.

References m_index, m_map, m_map_size, m_method, m_obs, m_parameters, and set_pointers().

Referenced by GSPIModelDataSpace(), and operator=().

double GSPIModelDataSpace::eval ( const GEvent event,
const GObservation obs,
const bool &  gradients = false 
) const
virtual

Evaluate function.

Parameters
[in]eventObserved event.
[in]obsObservation.
[in]gradientsCompute gradients?
Returns
Model value.
Exceptions
GException::invalid_argumentObservation is not an INTEGRAL/SPI observation. Event is not an INTEGRAL/SPI event bin.

Evaluates the value of the INTEGRAL/SPI data space model for a given event and a given observation.

Implements GModelData.

Definition at line 299 of file GSPIModelDataSpace.cpp.

References GOptimizerPar::factor_gradient(), G_EVAL, GSPIEventBin::index(), GOptimizerPar::is_free(), gammalib::is_infinite(), gammalib::is_notanumber(), GModel::m_eval_inx, GModel::m_has_eval_inx, m_index, m_map, m_parameters, GSPIEventBin::model(), GModel::name(), GOptimizerPar::scale(), GModel::scale(), setup_model(), GSPIEventBin::size(), GModel::size(), and GOptimizerPar::value().

void GSPIModelDataSpace::free_members ( void  )
protected

Delete class members.

Definition at line 683 of file GSPIModelDataSpace.cpp.

References m_map.

Referenced by clear(), operator=(), setup_pars(), and ~GSPIModelDataSpace().

double GSPIModelDataSpace::get_date_time ( const std::string &  method) const
protected

Get time scale from method string.

Parameters
[in]methodMethod string.
Returns
Time scale (seconds).

Get the time scale for the "DATE" method from the method string. The following time units are supported: min, hour, day, week, month or year.

Definition at line 1453 of file GSPIModelDataSpace.cpp.

References G_GET_DATE_TIME, GModel::scale(), and gammalib::todouble().

Referenced by setup_pointing_indices().

void GSPIModelDataSpace::init_members ( void  )
protected

Initialise class members.

Definition at line 631 of file GSPIModelDataSpace.cpp.

References m_index, GModel::m_instruments, m_map, m_map_size, m_method, m_obs, and m_parameters.

Referenced by clear(), GSPIModelDataSpace(), and operator=().

bool GSPIModelDataSpace::is_constant ( void  ) const
inlinevirtual

Signal if model is temporally constant.

Returns
True.

Signals that the data space model is temporally constant.

Implements GModelData.

Definition at line 183 of file GSPIModelDataSpace.hpp.

GSPIEventCube * GSPIModelDataSpace::mc ( const GObservation obs,
GRan ran 
) const
virtual

Return simulated list of events.

Parameters
[in]obsObservation.
[in]ranRandom number generator.

Draws a sample of events from the INTEGRAL/SPI data space model using a Monte Carlo simulation.

Todo:
Implement method.

Implements GModelData.

Definition at line 423 of file GSPIModelDataSpace.cpp.

double GSPIModelDataSpace::npred ( const GEnergy obsEng,
const GTime obsTime,
const GObservation obs 
) const
virtual

Return spatially integrated data model.

Parameters
[in]obsEngMeasured event energy.
[in]obsTimeMeasured event time.
[in]obsObservation.

Spatially integrates the data model for a given measured event energy and event time.

Todo:
Implement method.

Implements GModelData.

Definition at line 400 of file GSPIModelDataSpace.cpp.

GSPIModelDataSpace & GSPIModelDataSpace::operator= ( const GSPIModelDataSpace model)
virtual

Assignment operator.

Parameters
[in]modelINTEGRAL/SPI data space model.
Returns
INTEGRAL/SPI data space model

Assigns the information from an INTEGRAL/SPI data space model to the class instance. Note that a deep copy of the information is performed, so the model instance can be destroyed after the assignment without any loss of information.

Definition at line 216 of file GSPIModelDataSpace.cpp.

References copy_members(), free_members(), init_members(), and GModelData::operator=().

std::string GSPIModelDataSpace::print ( const GChatter chatter = NORMAL) const
virtual

Print model information.

Parameters
[in]chatterChattiness.
Returns
String containing model information.

Implements GModelData.

Definition at line 592 of file GSPIModelDataSpace.cpp.

References m_method, GModel::m_pars, gammalib::parformat(), GModel::print_attributes(), SILENT, GModel::size(), and gammalib::str().

void GSPIModelDataSpace::read ( const GXmlElement xml)
virtual

Read model from XML element.

Parameters
[in]xmlXML element.

Read the INTEGRAL/SPI data space model from an XML element.

The model is composed of a list of scale parameters. The following XML file format is expected:

<source name="Background" type="DataSpace" method="orbit,dete" index="0" instrument="SPI">
  <parameter name="REV0019_DETID00"        .../>
  <parameter name="REV0019_DETID01"        .../>
  ...
</source>

Implements GModelData.

Definition at line 450 of file GSPIModelDataSpace.cpp.

References GXmlElement::attribute(), clear(), GXmlNode::element(), GXmlNode::elements(), m_index, m_method, m_parameters, GModelPar::read(), GModel::read_attributes(), set_pointers(), and gammalib::toint().

Referenced by GSPIModelDataSpace().

void GSPIModelDataSpace::set_pointers ( void  )
protected

Set pointers.

Set pointers to all model parameters. The pointers are stored in a vector that is member of the GModel base class.

Definition at line 702 of file GSPIModelDataSpace.cpp.

References m_parameters, and GModel::m_pars.

Referenced by copy_members(), read(), and setup_pars().

void GSPIModelDataSpace::setup_date ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names,
const double &  time 
)
protected

Setup pointing indices and names for "date" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.
[in]timeTime scale in seconds.

Setup vectors of pointing indices and names for "date" method.

Definition at line 1191 of file GSPIModelDataSpace.cpp.

References GEvents::gti(), and gammalib::str().

Referenced by setup_pointing_indices().

void GSPIModelDataSpace::setup_dete ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup detector indices and names for "dete" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of detector indices.
[in,out]namesVector of detector names.

Setup vectors of detector indices and names for "dete" method.

Definition at line 1324 of file GSPIModelDataSpace.cpp.

References gammalib::str().

Referenced by setup_detector_indices().

void GSPIModelDataSpace::setup_detector_indices ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup detector indices.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of detector indices.
[in,out]namesVector of detector names.

Setup vectors of detector indices and detector names. The length of the vectors correspond to the number of detectors in the observation.

Definition at line 1051 of file GSPIModelDataSpace.cpp.

References gammalib::contains(), m_method, setup_dete(), setup_evtclass(), and gammalib::tolower().

Referenced by setup_pars().

void GSPIModelDataSpace::setup_ebin ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup energy indices and names for "ebin" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of energy indices.
[in,out]namesVector of energy names.

Setup vectors of energy indices and names for "ebin" method.

Definition at line 1426 of file GSPIModelDataSpace.cpp.

References gammalib::str().

Referenced by setup_energy_indices().

void GSPIModelDataSpace::setup_energy_indices ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup energy indices.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of energy indices.
[in,out]namesVector of energy names.

Setup vectors of energy indices and energy names. The length of the vectors correspond to the number of energies in the observation.

Definition at line 1083 of file GSPIModelDataSpace.cpp.

References gammalib::contains(), m_method, setup_ebin(), and gammalib::tolower().

Referenced by setup_pars().

void GSPIModelDataSpace::setup_evtclass ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup detector indices and names for "evtclass" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of detector indices.
[in,out]namesVector of detector names.

Setup vectors of detector indices and names for "evtclass" method.

Definition at line 1351 of file GSPIModelDataSpace.cpp.

References GSPIInstDir::detid(), GSPIEventCube::dir(), and gammalib::str().

Referenced by setup_detector_indices().

void GSPIModelDataSpace::setup_model ( const GObservation obs) const
protected

Setup model.

Parameters
[in]obsObservation.

Setup the model for a given observation.

Definition at line 727 of file GSPIModelDataSpace.cpp.

References GObservation::events(), G_SETUP_MODEL, m_index, m_method, m_obs, GModel::name(), and setup_pars().

Referenced by eval(), and GSPIModelDataSpace().

void GSPIModelDataSpace::setup_orbit ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup pointing indices and names for "orbit" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.

Setup vectors of pointing indices and names for "orbit" method.

Definition at line 1136 of file GSPIModelDataSpace.cpp.

References GSPIEventCube::ptid().

Referenced by setup_pointing_indices().

void GSPIModelDataSpace::setup_pars ( GSPIEventCube cube)
protected

Setup parameters.

Parameters
[in]cubeINTEGRAL/SPI event cube

Setup the parameters for a given model.

We assume that the model index is within the valid range of possible indices and that a method was specified.

Definition at line 814 of file GSPIModelDataSpace.cpp.

References GOptimizerPar::clear(), GOptimizerPar::free(), free_members(), GOptimizerPar::gradient(), GOptimizerPar::has_grad(), GModel::has_par(), m_map, m_map_size, GModel::m_name, m_parameters, GModel::name(), GOptimizerPar::name(), GSPIEventCube::naxis(), GOptimizerPar::scale(), set_pointers(), setup_detector_indices(), setup_energy_indices(), setup_pointing_indices(), and GOptimizerPar::value().

Referenced by setup_model().

void GSPIModelDataSpace::setup_point ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup pointing indices and names for "point" method.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.

Setup vectors of pointing indices and names for "point" method.

Definition at line 1109 of file GSPIModelDataSpace.cpp.

References gammalib::str().

Referenced by setup_pointing_indices().

void GSPIModelDataSpace::setup_pointing_indices ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names 
)
protected

Setup pointing indices.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.

Setup vectors of pointing indices and pointing names. The length of the vectors correspond to the number of pointings in the observation.

Definition at line 1003 of file GSPIModelDataSpace.cpp.

References add_gedanneal(), add_gedfail(), gammalib::contains(), get_date_time(), m_method, setup_date(), setup_orbit(), setup_point(), and gammalib::tolower().

Referenced by setup_pars().

void GSPIModelDataSpace::split_pointing_indices ( GSPIEventCube cube,
std::vector< int > *  indices,
std::vector< std::string > *  names,
const GTime time,
const std::string &  reason 
) const
protected

Split pointing indices and names at given time.

Parameters
[in]cubeEvent cube.
[in,out]indicesVector of pointing indices.
[in,out]namesVector of pointing names.
[in]timeTime of split.
[in]reasonReason for split.

Split the pointing indices at a given time.

Definition at line 1508 of file GSPIModelDataSpace.cpp.

References GEvents::gti().

Referenced by add_gedanneal(), and add_gedfail().

std::string GSPIModelDataSpace::type ( void  ) const
inlinevirtual

Return model type.

Returns
Model type.

Returns "DataSpace" as model type.

Implements GModelData.

Definition at line 169 of file GSPIModelDataSpace.hpp.

Referenced by write().

void GSPIModelDataSpace::write ( GXmlElement xml) const
virtual

Write model into XML element.

Parameters
[in]xmlXML element.
Exceptions
GException::invalid_valueExisting XML element is not of required type Invalid number of model parameters or nodes found in XML element.

Write the INTEGRAL/SPI data space model into an XML element.

The model is composed of a list of scale parameters. The following XML file structure will be written:

<source name="Background" type="DataSpace" method="orbit,dete" index="0" instrument="SPI">
  <parameter name="REV0019_DETID00"        .../>
  <parameter name="REV0019_DETID01"        .../>
  ...
</source>

Implements GModelData.

Definition at line 510 of file GSPIModelDataSpace.cpp.

References GXmlNode::append(), GXmlElement::attribute(), GXmlNode::element(), GXmlNode::elements(), G_WRITE, GModel::instruments(), m_index, m_method, m_parameters, GModel::name(), gammalib::str(), type(), and GModel::write_attributes().

Member Data Documentation

int GSPIModelDataSpace::m_index
protected

Index of model in event bins.

Definition at line 142 of file GSPIModelDataSpace.hpp.

Referenced by copy_members(), eval(), GSPIModelDataSpace(), init_members(), read(), setup_model(), and write().

int* GSPIModelDataSpace::m_map
protected

Parameter map.

Definition at line 144 of file GSPIModelDataSpace.hpp.

Referenced by copy_members(), eval(), free_members(), init_members(), and setup_pars().

int GSPIModelDataSpace::m_map_size
protected

Size of parameter map.

Definition at line 143 of file GSPIModelDataSpace.hpp.

Referenced by copy_members(), init_members(), and setup_pars().

std::string GSPIModelDataSpace::m_method
protected
GSPIObservation* GSPIModelDataSpace::m_obs
mutableprotected

SPI observation.

Definition at line 140 of file GSPIModelDataSpace.hpp.

Referenced by copy_members(), GSPIModelDataSpace(), init_members(), and setup_model().

std::vector<GModelPar> GSPIModelDataSpace::m_parameters
protected

Model parameters.

Definition at line 145 of file GSPIModelDataSpace.hpp.

Referenced by copy_members(), eval(), init_members(), read(), set_pointers(), setup_pars(), and write().


The documentation for this class was generated from the following files: