40#define G_NAXIS "GCOMEventCube::naxis(int)"
41#define G_SET_SCATTER_DIRECTIONS "GCOMEventCube::set_scatter_directions()"
42#define G_SET_ENERGIES "GCOMEventCube::set_energies()"
43#define G_SET_TIMES "GCOMEventCube::set_times()"
44#define G_SET_BIN "GCOMEventCube::set_bin(int&)"
296 #if defined(G_RANGE_CHECK)
297 if (axis < 0 || axis >=
dim()) {
331 GFits fits(filename);
361 fits.
saveto(filename, clobber);
449 result.append(
"=== GCOMEventCube ===");
471 result.append(
tstart().utc()+
" - ");
472 result.append(
tstop().utc());
641 std::string msg =
"No sky pixels have been found in event cube. "
642 "Every COMPTEL event cube needs a definition of "
656 for (
int iy = 0; iy <
m_dri.
npsi(); ++iy) {
657 for (
int ix = 0; ix <
m_dri.
nchi(); ++ix) {
705 std::string msg =
"No energy boundaries have been found in event "
706 "cube. Every COMPTEL event cube needs a definition "
707 "of the energy boundaries.";
736 std::string msg =
"No Good Time Intervals have been found in event "
737 "cube. Every COMPTEL event cube needs a definition "
738 "of the Good Time Intervals.";
797 #if defined(G_RANGE_CHECK)
798 if (index < 0 || index >=
size()) {
805 std::string msg =
"Sky direction vector has not been setup for "
806 "event cube. Every COMPTEL event cube needs an "
807 "internal vector of sky directions.";
812 int ipix = index %
m_npix;
813 int iphi = index /
m_npix;
#define G_SET_SCATTER_DIRECTIONS
COMPTEL event bin container class interface definition.
Implementation of support function used by COMPTEL classes.
Exception handler interface definition.
Filename class interface definition.
FITS file class interface definition.
COMPTEL Data Space class.
const GEbounds & ebounds(void) const
Return energy boundaries of DRI cube.
virtual void clear(void)
Clear COMPTEL Data Space.
const double & phase_correction(void) const
Return pulsar phase correction factor.
int nchi(void) const
Return number of Chi bins.
const double & tof_correction(void) const
Return ToF correction factor.
const GGti & gti(void) const
Return Good Time Intervals of DRI cube.
const double & phibin(void) const
Return Compton scatter angle bin of DRI cube.
const GSkyMap & map(void) const
Return DRI sky map.
const double & phimin(void) const
Return minimum Compton scatter angle of DRI cube.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Data Space.
int npsi(void) const
Return number of Psi bins.
int size(void) const
Return number of bins.
void write(GFits &fits, const std::string &extname="") const
Write COMPTEL Data Space into FITS image.
int nphibar(void) const
Return number of Phibar bins.
void read(const GFitsImage &image)
Read COMPTEL Data Space from DRI FITS image.
GEnergy * m_ewidth
Pointer to energy width of bin.
double * m_counts
Pointer to number of counts.
GTime * m_time
Pointer to bin time.
GCOMInstDir * m_dir
Pointer to bin direction.
double * m_ontime
Pointer to ontime of bin (seconds)
double * m_solidangle
Pointer to solid angle of pixel (sr)
int m_index
Dataspace index.
virtual void clear(void)
Clear instance.
GEnergy * m_energy
Pointer to bin energy.
void free_members(void)
Delete class members.
COMPTEL event bin container class.
virtual void set_times(void)
Set mean event time and ontime of event cube.
int m_npix
Number of DRI pixels.
GEnergy m_ewidth
Event cube energy bin width.
virtual int dim(void) const
Return dimension of event cube.
virtual void load(const GFilename &filename)
Load COMPTEL event cube from FITS file.
std::vector< double > m_phibar
Array of event scatter angles.
virtual int number(void) const
Return number of events in cube.
virtual GCOMEventBin * operator[](const int &index)
Event bin access operator.
virtual int size(void) const
Return number of bins in event cube.
void free_members(void)
Delete class members.
std::vector< double > m_solidangle
Array of solid angles (sr)
void set_scatter_directions(void)
Set sky directions and solid angles of events cube.
virtual ~GCOMEventCube(void)
Destructor.
void init_members(void)
Initialise class members.
virtual GCOMEventCube * clone(void) const
Clone instance.
GTime m_time
Event cube mean time.
GCOMEventCube(void)
Void constructor.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save COMPTEL event cube into FITS file.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print event cube information.
virtual void read(const GFits &file)
Read COMPTEL event cube from FITS file.
void set_scatter_angles(void)
Set Compton scatter angles of event cube.
const GCOMDri & dre(void) const
Return reference to DRE data.
void init_bin(void)
Initialise event bin.
std::vector< GSkyDir > m_dirs
Array of event scatter directions.
double m_ontime
Event cube ontime (sec)
virtual GCOMEventCube & operator=(const GCOMEventCube &cube)
Assignment operator.
virtual void clear(void)
Clear instance.
void init_cube(void)
Initialise event cube.
virtual void set_energies(void)
Set log mean energy and energy width of event cube.
GEnergy m_energy
Event cube mean energy.
virtual void write(GFits &file) const
Write COMPTEL event cube into FITS file.
void copy_members(const GCOMEventCube &cube)
Copy class members.
GCOMEventBin m_bin
Actual event bin.
virtual int naxis(const int &axis) const
Return number of bins in axis.
void set_bin(const int &index)
Set event bin.
GCOMInstDir m_dir
Actual event direction.
void dir(const GSkyDir &dir)
Set event scatter direction.
virtual void clear(void)
Clear instance.
void phibar(const double &phibar)
Set event Compton scatter angle.
const GEnergy & emax(void) const
Return maximum energy of all intervals.
int size(void) const
Return number of energy boundaries.
GEnergy elogmean(const int &index) const
Returns logarithmic mean energy for a given energy interval.
const GEnergy & emin(void) const
Return minimum energy of all intervals.
std::string print(const GChatter &chatter=NORMAL) const
Print energy.
void clear(void)
Clear instance.
Abstract event bin container class.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
virtual GEventCube & operator=(const GEventCube &cube)
Assignment operator.
void free_members(void)
Delete class members.
GGti m_gti
Good time intervals covered by events.
const GTime & tstart(void) const
Return start time.
GEbounds m_ebounds
Energy boundaries covered by events.
const GGti & gti(void) const
Return Good Time Intervals.
void init_members(void)
Initialise class members.
const GTime & tstop(void) const
Return stop time.
const GEbounds & ebounds(void) const
Return energy boundaries.
const GEnergy & emax(void) const
Return maximum energy.
const GEnergy & emin(void) const
Return minimum energy.
Abstract FITS image base class.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
GFitsImage * image(const int &extno)
Get pointer to image HDU.
void close(void)
Close FITS file.
const GTime & tstop(void) const
Returns latest stop time in Good Time Intervals.
int size(void) const
Return number of Good Time Intervals.
const double & ontime(void) const
Returns ontime.
const GTime & tstart(void) const
Returns earliest start time in Good Time Intervals.
double solidangle(const int &index) const
Returns solid angle of pixel.
GSkyDir pix2dir(const GSkyPixel &pixel) const
Returns sky direction of pixel.
void clear(void)
Clear time.
std::string print(const GChatter &chatter=NORMAL) const
Print time.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
int com_tics(const GTime &time)
Convert GTime in COMPTEL tics.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.