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

◆ isultrasonic()

bool datrw::su::SUheader::isultrasonic ( ) const

true if header defines sampling of ultrasonic data

true if header defines ultrasonic data sampling

Definition at line 166 of file suheader.cc.

References datrw::su::TraceHeaderStruct::d1, DATRW_assert, datrw::su::TraceHeaderStruct::dt, Mheader, datrw::su::subformat::def::thresholdcmp, and datrw::su::subformat::def::thresholdzero.

Referenced by delay(), and dt().

167  {
168  bool retval=false;
169  DATRW_assert(Mheader.d1>=0.,
170  "negative d1 value (header byte offset 180) is illegal");
172  {
173  float seismicdt=static_cast<double>(Mheader.dt)*1.e-6;
174  float ultrasonicdt=static_cast<double>(Mheader.dt)*1.e-9;
175  float seismicres=1.-(seismicdt/Mheader.d1);
176  float ultrasonicres=1.-(ultrasonicdt/Mheader.d1);
177  seismicres=seismicres<0 ? -seismicres : seismicres;
178  ultrasonicres=ultrasonicres<0 ? -ultrasonicres : ultrasonicres;
179  if (seismicres > subformat::def::thresholdcmp)
180  {
182  "d1 value (header byte offset 180) neither matches "
183  "seismic nor ultrasonic data");
184  retval=true;
185  }
186  }
187  return(retval);
188  } // bool SUheader::isultrasonic() const
float d1
sample spacing for non-seismic data
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:92
const double thresholdzero
Definition: suformat.cc:75
unsigned short dt
sample interval; in micro-seconds
const double thresholdcmp
Definition: suformat.cc:76
TraceHeaderStruct Mheader
the actual data fields are provided for public access
Definition: suheader.h:239
Here is the caller graph for this function: