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);
430 return int(number+0.5);
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;
void phibar(const double &phibar)
Set event Compton scatter angle.
void set_scatter_directions(void)
Set sky directions and solid angles of events cube.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print event cube information.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save COMPTEL event cube into FITS file.
const GGti & gti(void) const
Return Good Time Intervals.
Abstract FITS image base class.
void init_members(void)
Initialise class members.
#define G_SET_SCATTER_DIRECTIONS
virtual GCOMEventCube * clone(void) const
Clone instance.
int m_index
Dataspace index.
const double & phimin(void) const
Return minimum Compton scatter angle of DRI cube.
virtual void set_times(void)
Set mean event time and ontime of event cube.
std::vector< GSkyDir > m_dirs
Array of event scatter directions.
int size(void) const
Return number of bins.
int size(void) const
Return number of energy boundaries.
void init_members(void)
Initialise class members.
GCOMInstDir * m_dir
Pointer to bin direction.
void free_members(void)
Delete class members.
virtual int size(void) const
Return number of bins in event cube.
virtual GEventCube & operator=(const GEventCube &cube)
Assignment operator.
GTime * m_time
Pointer to bin time.
const GTime & tstop(void) const
Return stop time.
const double & tof_correction(void) const
Return ToF correction factor.
void init_bin(void)
Initialise event bin.
void clear(void)
Clear time.
GEbounds m_ebounds
Energy boundaries covered by events.
FITS file class interface definition.
int nchi(void) const
Return number of Chi bins.
virtual void read(const GFits &file)
Read COMPTEL event cube from FITS file.
virtual void load(const GFilename &filename)
Load COMPTEL event cube from FITS file.
GCOMInstDir m_dir
Actual event direction.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
virtual void clear(void)
Clear instance.
Implementation of support function used by COMPTEL classes.
int size(void) const
Return number of Good Time Intervals.
virtual int dim(void) const
Return dimension of event cube.
double * m_ontime
Pointer to ontime of bin (seconds)
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
const double & phase_correction(void) const
Return pulsar phase correction factor.
GSkyDir pix2dir(const GSkyPixel &pixel) const
Returns sky direction of pixel.
GEnergy * m_ewidth
Pointer to energy width of bin.
const GEbounds & ebounds(void) const
Return energy boundaries of DRI cube.
void set_scatter_angles(void)
Set Compton scatter angles of event cube.
std::string print(const GChatter &chatter=NORMAL) const
Print energy.
void dir(const GSkyDir &dir)
Set event scatter direction.
GCOMEventCube(void)
Void constructor.
void free_members(void)
Delete class members.
const GEnergy & emin(void) const
Return minimum energy of all intervals.
void write(GFits &fits, const std::string &extname="") const
Write COMPTEL Data Space into FITS image.
void free_members(void)
Delete class members.
const GSkyMap & map(void) const
Return DRI sky map.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.
std::vector< double > m_phibar
Array of event scatter angles.
void init_cube(void)
Initialise event cube.
GGti m_gti
Good time intervals covered by events.
virtual void clear(void)
Clear instance.
GEnergy elogmean(const int &index) const
Returns logarithmic mean energy for a given energy interval.
std::string print(const GChatter &chatter=NORMAL) const
Print time.
GCOMEventBin m_bin
Actual event bin.
double m_ontime
Event cube ontime (sec)
const GTime & tstop(void) const
Returns latest stop time in Good Time Intervals.
const GTime & tstart(void) const
Returns earliest start time in Good Time Intervals.
COMPTEL event bin container class.
virtual void set_energies(void)
Set log mean energy and energy width of event cube.
int nphibar(void) const
Return number of Phibar bins.
const GCOMDri & dre(void) const
Return reference to DRE data.
int m_npix
Number of DRI pixels.
const GGti & gti(void) const
Return Good Time Intervals of DRI cube.
GFitsImage * image(const int &extno)
Get pointer to image HDU.
void copy_members(const GCOMEventCube &cube)
Copy class members.
int com_tics(const GTime &time)
Convert GTime in COMPTEL tics.
virtual void clear(void)
Clear instance.
virtual void clear(void)
Clear COMPTEL Data Space.
const GEnergy & emin(void) const
Return minimum energy.
GEnergy * m_energy
Pointer to bin energy.
void read(const GFitsImage &image)
Read COMPTEL Data Space from DRI FITS image.
int npsi(void) const
Return number of Psi bins.
Exception handler interface definition.
double * m_counts
Pointer to number of counts.
COMPTEL Data Space class.
const GEbounds & ebounds(void) const
Return energy boundaries.
virtual int number(void) const
Return number of events in cube.
GEnergy m_ewidth
Event cube energy bin width.
GEnergy m_energy
Event cube mean energy.
const GEnergy & emax(void) const
Return maximum energy of all intervals.
virtual ~GCOMEventCube(void)
Destructor.
double solidangle(const int &index) const
Returns solid angle of pixel.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
COMPTEL event bin container class interface definition.
const GTime & tstart(void) const
Return start time.
const double & phibin(void) const
Return Compton scatter angle bin of DRI cube.
Abstract event bin container class.
void close(void)
Close FITS file.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Data Space.
virtual int naxis(const int &axis) const
Return number of bins in axis.
const GEnergy & emax(void) const
Return maximum energy.
const double & ontime(void) const
Returns ontime.
virtual GCOMEventBin * operator[](const int &index)
Event bin access operator.
void clear(void)
Clear instance.
virtual GCOMEventCube & operator=(const GCOMEventCube &cube)
Assignment operator.
std::vector< double > m_solidangle
Array of solid angles (sr)
Filename class interface definition.
void set_bin(const int &index)
Set event bin.
double * m_solidangle
Pointer to solid angle of pixel (sr)
GTime m_time
Event cube mean time.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
virtual void write(GFits &file) const
Write COMPTEL event cube into FITS file.