43 #define G_RESPONSE "GSPIObservation::response(GResponse&)"
44 #define G_READ "GSPIObservation::read(GXmlElement&)"
45 #define G_READ_FITS "GSPIObservation::read(GFits&)"
46 #define G_WRITE "GSPIObservation::write(GXmlElement&)"
244 if (spirsp == NULL) {
245 std::string cls = std::string(
typeid(&rsp).
name());
246 std::string msg =
"Response of type \""+cls+
"\" is "
247 "not a INTEGRAL/SPI response. Please specify a "
248 "INTEGRAL/SPI response as argument.";
461 #pragma omp critical(GSPIObservation_load)
467 GFits fits(filename);
496 result.append(
"=== GSPIObservation ===");
522 if (reduced_chatter >
SILENT) {
virtual double ontime(void) const
Return ontime.
const std::string & statistic(void) const
Return optimizer statistic.
virtual void read(const GFits &file)
Read INTEGRAL/SPI event cube from Observation Group FITS file.
virtual GSPIObservation * clone(void) const
Clone INTEGRAL/SPI observation.
virtual void clear(void)
Clear instance.
void rspname(const GFilename &rspname)
Set response name.
virtual void clear(void)
Clear INTEGRAL/SPI observation.
virtual ~GSPIObservation(void)
Destructor.
GEvents * m_events
Pointer to event container.
GFilename m_filename
OG FITS filename.
double m_ontime
Ontime (sec)
bool is_empty(void) const
Signal if filename is empty.
INTEGRAL/SPI event bin container class definition.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print INTEGRAL/SPI response information.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print observation information.
GSPIObservation(void)
Void constructor.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
void free_members(void)
Delete class members.
virtual void write(GXmlElement &xml) const
Write INTEGRAL/SPI observation into XML element.
void free_members(void)
Delete class members.
const GSPIObservation g_obs_spi_seed
INTEGRAL/SPI event bin container class.
GFilename m_rsp_filename
Response FITS filename (optional)
const GXmlAttribute * attribute(const int &index) const
Return attribute.
double m_livetime
Livetime (sec)
bool has_attribute(const std::string &name) const
Check if element has a given attribute.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
Interface definition for the observation registry class.
GSPIResponse m_response
Response functions.
const std::string & name(void) const
Return observation name.
void copy_members(const GSPIObservation &obs)
Copy class members.
Observation registry class definition.
double livetime(void) const
Return total livetime.
virtual std::string instrument(void) const
Return instrument.
void init_members(void)
Initialise class members.
void init_members(void)
Initialise class members.
Abstract observation base class.
virtual const GSPIResponse * response(void) const
Return pointer to response function.
void load(const GFilename &filename)
Load Observation Group.
virtual GSPIObservation & operator=(const GSPIObservation &obs)
Assignment operator.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
INTEGRAL/SPI observation class.
double m_deadc
Deadtime correction.
std::string url(void) const
Return Uniform Resource Locator (URL)
void clear(void)
Clear file name.
INTEGRAL/SPI observation class definition.
GFilename m_rsp_grpname
Response group FITS filename (optional)
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
virtual GEvents * events(void)
Return events.
Exception handler interface definition.
std::string m_instrument
Instrument name.
INTEGRAL/SPI instrument response function class.
double ontime(void) const
Return total ontime.
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.
virtual void read(const GXmlElement &xml)
Read INTEGRAL/SPI observation from XML element.
void load(const GFilename &filename)
Load SPI response from file.
Abstract instrument response base class.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void close(void)
Close FITS file.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
virtual double livetime(void) const
Return livetime.
const double & energy_keV(void) const
Return line IRF energy in keV.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
double todouble(const std::string &arg)
Convert string into double precision value.
Class that handles energies in a unit independent way.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
void set(const GSPIObservation &obs, const GEnergy &energy=GEnergy())
Set response for a specific observation.