SFF++ library: reading and writing SFF from C++

◆ operator()()

bool sff::WID2compare::operator() ( const WID2 hd1,
const WID2 hd2 
) const

Definition at line 42 of file wid2compare.cc.

References sff::WID2::auxid, sff::WID2::calib, sff::WID2::calper, sff::WID2::channel, sff::WID2::date, sff::WID2::dt, sff::Fauxid, sff::Fcalib, sff::Fcalper, sff::Fchannel, sff::Fdate, sff::Fdt, sff::Fhang, sff::Finstype, sff::Fnsamples, sff::Fstation, sff::Fvang, sff::WID2::hang, sff::WID2::instype, Mdatetolerance, Mdttolerance, Mflags, sff::WID2::nsamples, sff::WID2::station, and sff::WID2::vang.

43  {
44  bool retval=true;
45  if (Mflags & Fdate) {
46  libtime::TRelativeTime diff=hd2.date-hd1.date;
47  retval=retval && (libtime::time2double(diff)
48  <= ((hd1.dt+hd2.dt)*0.5*Mdatetolerance));
49  }
50  if (Mflags & Fstation) { retval=retval && (hd1.station==hd2.station); }
51  if (Mflags & Fchannel) { retval=retval && (hd1.channel==hd2.channel); }
52  if (Mflags & Fauxid) { retval=retval && (hd1.auxid==hd2.auxid); }
53  if (Mflags & Fnsamples) { retval=retval && (hd1.nsamples==hd2.nsamples); }
54  if (Mflags & Fdt)
55  {
56  double diff=hd1.dt-hd2.dt;
57  diff = diff >= 0. ? diff : -diff;
58  retval=retval && (diff <= (hd1.dt*Mdttolerance));
59  }
60  if (Mflags & Fcalib) { retval=retval && (hd1.calib==hd2.calib); }
61  if (Mflags & Fcalper) { retval=retval && (hd1.calper==hd2.calper); }
62  if (Mflags & Finstype) { retval=retval && (hd1.instype==hd2.instype); }
63  if (Mflags & Fhang) { retval=retval && (hd1.hang==hd2.hang); }
64  if (Mflags & Fvang) { retval=retval && (hd1.vang==hd2.vang); }
65  return(retval);
66  }; // WID2compare::operator()
compare numbers of samples
Definition: sffxx.h:508
compare dates of first sample
Definition: sffxx.h:500
compare sampling intervals
Definition: sffxx.h:510
compare calper fields
Definition: sffxx.h:514
compare station IDs
Definition: sffxx.h:502
double Mdatetolerance
relative to mean sampling interval
Definition: sffxx.h:547
compare vang fields
Definition: sffxx.h:520
compare calib fields
Definition: sffxx.h:512
double Mdttolerance
Definition: sffxx.h:546
compare channel IDs
Definition: sffxx.h:504
compare hang fields
Definition: sffxx.h:518
compare auxilliary IDs
Definition: sffxx.h:506
compare instrument type strings
Definition: sffxx.h:516