42#define G_AT "GCOMBvcs::at(int&)"
43#define G_INSERT "GCOMBvcs::insert(int&, GCOMBvc&)"
44#define G_REMOVE "GCOMBvcs::remove(int&)"
45#define G_READ "GCOMBvcs::read(GFitsTable&)"
46#define G_TDELTA "GCOMBvcs::tdelta(GSkyDir&, GTime&)"
209 if (index < 0 || index >=
size()) {
233 if (index < 0 || index >=
size()) {
277 #if defined(G_RANGE_CHECK)
281 "Solar System Barycentre Data index",
286 if (index < 0 || index >=
size()) {
288 "Solar System Barycentre Data index",
315 #if defined(G_RANGE_CHECK)
316 if (index < 0 || index >=
size()) {
318 "Solar System Barycentre Data index",
346 int num = bvcs.
size();
352 for (
int i = 0; i < num; ++i) {
353 m_bvcs.push_back(bvcs[i]);
373 GFits fits(filename);
402 int num = table.
nrows();
419 for (
int i = 0; i < num; ++i) {
426 int tics = ptr_tics->
integer(i);
479 int oad_tjd = oad.
tjd();
480 int oad_tics = oad.
tics() + 65536;
485 int max_tics_difference = 700000000;
487 for (
int i = 0; i <
size; ++i) {
488 if (
m_bvcs[i].tjd() == oad_tjd) {
489 int tics_difference = std::abs(
m_bvcs[i].tics() - oad_tics);
490 if (tics_difference < max_tics_difference) {
492 max_tics_difference = tics_difference;
502 if (max_tics_difference < 131072) {
567 const double t_sun = 4.92549089483e-6;
579 "least two vectors are needed to compute the time "
580 "delay. Please load SSB vectors from a BVC file "
581 "before calling this method.";
587 if (time <
m_bvcs[0].time()) {
590 double wlow = (
m_bvcs[iup].time() - time) / (
m_bvcs[iup].time() -
m_bvcs[ilow].time());
591 double wup = 1.0 - wlow;
592 ssb = wlow *
m_bvcs[ilow].ssb() + wup *
m_bvcs[iup].ssb();
601 double wlow = (
m_bvcs[iup].time() - time) / (
m_bvcs[iup].time() -
m_bvcs[ilow].time());
602 double wup = 1.0 - wlow;
603 ssb = wlow *
m_bvcs[ilow].ssb() + wup *
m_bvcs[iup].ssb();
618 int max_tics_difference = 700000000;
620 for (
int i = 0; i <
size; ++i) {
621 if (
m_bvcs[i].tjd() == tjd) {
622 int tics_difference = std::abs(
m_bvcs[i].tics() - tics);
623 if (tics_difference < max_tics_difference) {
625 max_tics_difference = tics_difference;
635 if (
m_bvcs[ibest].tics() <= tics) {
637 if (ibest <
size-1) {
661 ssb = wlow *
m_bvcs[ilow].ssb() + wup *
m_bvcs[iup].ssb();
671 double travt = ssb * n * 1.0e-6;
674 double r =
norm(ssb) * 1.0e-6;
675 double relat = -2.0 * t_sun * std::log(1.0 + (travt/r));
701 result.append(
"=== GCOMBvcs ===");
713 result.append(
" - ");
719 result.append(
" - ");
721 result.append(
" days");
723 result.append(
m_bvcs[0].time().utc());
724 result.append(
" - ");
729 if (reduced_chatter >
SILENT) {
734 for (
int i = 0; i <
size(); ++i) {
735 if (
m_bvcs[i].tjd() != tjd) {
COMPTEL Solar System Barycentre Data container class definition.
COMPTEL Orbit Aspect Data class definition.
Implementation of support function used by COMPTEL classes.
Exception handler interface definition.
FITS table abstract base class interface definition.
FITS file class interface definition.
Mathematical function definitions.
double norm(const GVector &vector)
Computes vector norm.
COMPTEL Solar System Barycentre Data class.
const int & tics(void) const
Return tics of Solar System Barycentre Data.
const int & tjd(void) const
Return Truncated Julian Days of Solar System Barycentre Data.
const GVector & ssb(void) const
Return Solar System Barycentre vector.
const double & tdelta(void) const
Return TDB-UTC time difference.
const GTime & time(void) const
Return time of Solar System Barycentre Data.
COMPTEL Solar System Barycentre Data container class.
int size(void) const
Return number of Solar System Barycentre Data in container.
std::vector< GCOMBvc > m_bvcs
Solar System Barycentre Data records.
virtual ~GCOMBvcs(void)
Destructor.
void extend(const GCOMBvcs &bvcs)
Append Solar System Barycentre Data container.
void clear(void)
Clear COMPTEL Solar System Barycentre Data container.
const GCOMBvc * find(const GCOMOad &oad) const
Find Solar System Barycentre Data for Orbit Aspect Data.
void remove(const int &index)
Remove Solar System Barycentre Data from container.
void load(const GFilename &filename)
Load COMPTEL Solar System Barycentre Data FITS file.
GCOMBvcs & operator=(const GCOMBvcs &bvcs)
Assignment operator.
GCOMBvc & at(const int &index)
Return reference to Solar System Barycentre Data.
GCOMBvcs(void)
Void constructor.
void free_members(void)
Delete class members.
void reserve(const int &num)
Reserves space for Solar System Barycentre Data in container.
GCOMBvc & insert(const int &index, const GCOMBvc &bvc)
Insert Solar System Barycentre Data into container.
GCOMBvcs * clone(void) const
Clone COMPTEL Solar System Barycentre Data container.
bool is_empty(void) const
Signals if there are no Solar System Barycentre Data in container.
GCOMBvc & append(const GCOMBvc &bvc)
Append Solar System Barycentre Data to container.
void read(const GFitsTable &table)
Read COMPTEL Solar System Barycentre Data FITS table.
void init_members(void)
Initialise class members.
void copy_members(const GCOMBvcs &bvcs)
Copy class members.
double tdelta(const GSkyDir &dir, const GTime &time) const
Return time difference between photon arrival time at CGRO and the Solar System Barycentre (SSB)
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Solar System Barycentre Data container.
COMPTEL Orbit Aspect Data class.
const int & tjd(void) const
Return Truncated Julian Days of Orbit Aspect Record.
const int & tics(void) const
Return tics of Orbit Aspect Record.
Abstract interface for FITS table column.
virtual int integer(const int &row, const int &inx=0) const =0
virtual double real(const int &row, const int &inx=0) const =0
Abstract interface for FITS table.
const int & nrows(void) const
Return number of rows in table.
void close(void)
Close FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
void celvector(const GVector &vector)
Set sky direction from 3D vector in celestial coordinates.
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.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.
GTime com_time(const int &tjd, const int &tics)
Convert TJD and COMPTEL tics in GTime object.