DATRW++ library: seismic data I/O with multiple formats

◆ date()

libtime::TAbsoluteTime datrw::mseed::MiniSEEDRecord::date ( ) const

return time of first sample

Definition at line 72 of file mseedread_mseedrecord_other.cc.

References blockette1001(), datrw::mseed::convert(), hasblockette1001(), datrw::mseed::SEED::DataExtensionBlockette::iusec(), recordheader(), datrw::mseed::SEED::FixedDataRecordHeader::tcorr, and datrw::mseed::SEED::ActivityFlags::tcorrapp.

Referenced by readheader().

73  {
74  libtime::TAbsoluteTime retval=convert(this->recordheader().stime);
75  datrw::mseed::SEED::ActivityFlags aflags(this->recordheader().aflags);
76  if (! (aflags.tcorrapp || (this->recordheader().tcorr == 0) ) )
77  {
78  libtime::TRelativeTime corr(0,0,0,0,0,100);
79  //long int tcorr=this->recordheader().tcorr;
80  int tcorr=this->recordheader().tcorr;
81  if (tcorr >= 0)
82  {
83  retval += (corr * tcorr);
84  }
85  else
86  {
87  // result of multiplication of libtime::TAbsoluteTime with
88  // any value (also negative) provides a positive result;
89  // swap sign just to make things clear
90  tcorr *= -1;
91  retval -= (corr * tcorr);
92  }
93  }
94  if (this->hasblockette1001())
95  {
96  int tcorr=this->blockette1001().iusec();
97  if (tcorr != 0)
98  {
99  libtime::TRelativeTime corr(0,0,0,0,0,1);
100  if (tcorr >= 0)
101  {
102  retval += (corr * tcorr);
103  }
104  else
105  {
106  // result of multiplication of libtime::TAbsoluteTime with
107  // any value (also negative) provides a positive result;
108  // swap sign just to make things clear
109  tcorr *= -1;
110  retval -= (corr * tcorr);
111  }
112  }
113  }
114  return(retval);
115  } // libtime::TAbsoluteTime MiniSEEDRecord::date() const
const SEED::FixedDataRecordHeader & recordheader() const
returns Fixed Data Record Header
Definition: mseedread.h:177
const SEED::DataExtensionBlockette & blockette1001() const
returns Data Extension Blockette
Definition: mseedread.h:183
bool hasblockette1001() const
true if Data Extension Blockette is present
Definition: mseedread.h:174
libtime::TAbsoluteTime convert(const SEED::BTIME &t)
convert BTIME structure to libtime structure
Definition: mseedread.cc:166
Here is the call graph for this function:
Here is the caller graph for this function: