SFF++ library: reading and writing SFF from C++
wid2lastsample.cc
Go to the documentation of this file.
1 
35 #define TF_WID2LASTSAMPLE_CC_VERSION \
36  "TF_WID2LASTSAMPLE_CC V1.1 "
37 
38 #include <sffxx.h>
39 
40 namespace sff {
41 
43  libtime::TAbsoluteTime wid2lastsample(const WID2& wid2)
44  {
45  libtime::TRelativeTime dt=libtime::double2time(wid2.dt);
46  libtime::TAbsoluteTime retval=wid2.date+(dt*(wid2.nsamples-1));
47  return(retval);
48  }
49 
51  libtime::TAbsoluteTime wid2nextdate(const WID2& wid2)
52  {
53  libtime::TRelativeTime dt=libtime::double2time(wid2.dt);
54  libtime::TAbsoluteTime retval=wid2.date+(dt*wid2.nsamples);
55  return(retval);
56  }
57 
58 } // namespace sff
59 
60 /* ----- END OF wid2lastsample.cc ----- */
libtime::TAbsoluteTime wid2lastsample(const WID2 &wid2)
return time of last sample in waveform
all SFF modules
Definition: offset.cc:42
int nsamples
number of samples
Definition: sffxx.h:219
libtime::TAbsoluteTime date
time of first sample
Definition: sffxx.h:215
Waveform Header.
Definition: sffxx.h:209
libtime::TAbsoluteTime wid2nextdate(const WID2 &wid2)
return time of next first sample for contiguous data
double dt
sampling interval (sec)
Definition: sffxx.h:220
SFF library (prototypes)