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

◆ translationisunique()

bool datrw::tsoft::translationisunique ( const bool &  verbose)

check uniqueness of translation table

Definition at line 313 of file channeltranslation.cc.

References datrw::tsoft::SFFchannelid::auxid, datrw::tsoft::SFFchannelid::channel, datrw::tsoft::TSOFTchannelid::datatype, datrw::tsoft::TSOFTchannelid::instrument, datrw::tsoft::SFFchannelid::instrument, datrw::tsoft::TSOFTchannelid::location, schannelid(), datrw::tsoft::SFFchannelid::station, tchannelid(), translationtable, and datrw::tsoft::Channel::TSOFTname.

Referenced by datrw::itsoftstream::help(), and main().

314  {
315  bool retval=true;
316  const Channel* pc1=translationtable;
317  while (pc1->TSOFTname != NULL)
318  {
319  TSOFTchannelid tci1=tchannelid(*pc1);
320  SFFchannelid sci1=schannelid(*pc1);
321  const Channel* pc2=pc1;
322  ++pc2;
323  while (pc2->TSOFTname != NULL)
324  {
325  TSOFTchannelid tci2=tchannelid(*pc2);
326  SFFchannelid sci2=schannelid(*pc2);
327  if ((tci1.location==tci2.location)
328  && (tci1.instrument==tci2.instrument)
329  && (tci1.datatype==tci2.datatype))
330  {
331  std::cout << "ATTENTION: "
332  << "TSOFT entry appears twice in translation table:"
333  << std::endl;
334  std::cout << " "
335  << tci1.location << ":"
336  << tci1.instrument << ":"
337  << tci1.datatype << std::endl;
338  retval=false;
339  }
340  if ((sci1.station==sci2.station)
341  && (sci1.channel==sci2.channel)
342  && (sci1.instrument==sci2.instrument)
343  && (sci1.auxid==sci2.auxid))
344  {
345  std::cout << "ATTENTION: "
346  << "SFF entry appears twice in translation table:"
347  << std::endl;
348  std::cout << " "
349  << sci1.station << ":"
350  << sci1.channel << ":"
351  << sci1.instrument << ":"
352  << sci1.auxid << std::endl;
353  retval=false;
354  }
355  ++pc2;
356  }
357  ++pc1;
358  }
359  return(retval);
360  } // bool translationisunique(const bool& verbose)
const Channel translationtable[]
global variable: channel name translation tableThis table is specific for SG056 at BFO...
SFFchannelid schannelid(const Channel &ci)
split SFF channel description
TSOFTchannelid tchannelid(const Channel &ci)
split TSOFT channel description
Here is the call graph for this function:
Here is the caller graph for this function: