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

◆ outputmodifiers()

options::SUHeaderControl datrw::su::outputmodifiers ( const std::string &  modifier,
const bool &  debug 
)

evaluate output stream format modifiers

Definition at line 122 of file suformat.cc.

References datrw::su::options::SpatialSampling::bestrict, datrw::su::subformat::key::coodigits, datrw::su::options::SpatialSampling::coodigits, DATRW_assert, DATRW_assert_modifiers_are_recognized, DATRW_debug, DATRW_value, fixscalevalue(), datrw::su::subformat::key::forceseismic, datrw::su::options::TemporalSampling::forceseismic, datrw::su::subformat::key::forceultrasonic, datrw::su::options::TemporalSampling::forceultrasonic, datrw::su::options::TemporalSampling::isconsistent(), datrw::Subformat::isset(), datrw::su::subformat::key::scalco, datrw::su::options::SpatialSampling::scalco, datrw::su::options::SUHeaderControl::spatialsampling, and datrw::su::options::SUHeaderControl::temporalsampling.

Referenced by main(), and datrw::osustream::osustream().

124  {
125  options::SUHeaderControl retval;
126  datrw::Subformat subformat(modifier);
127  retval.temporalsampling.forceultrasonic
129  retval.temporalsampling.forceseismic
130  =subformat.isset(datrw::su::subformat::key::forceseismic);
131  if (subformat.isset(datrw::su::subformat::key::coodigits))
132  {
134  >> retval.spatialsampling.coodigits;
135  }
136  if (subformat.isset(datrw::su::subformat::key::scalco))
137  {
139  >> retval.spatialsampling.scalco;
140  }
141  datrw::su::fixscalevalue(retval.spatialsampling.scalco);
142  DATRW_assert(retval.temporalsampling.isconsistent(),
143  "su::outputmodifiers(): "
144  "used format modifiers are in conflict");
146  "su::outputmodifiers()");
147  DATRW_debug(debug,
148  "su::outputmodifiers()",
149  DATRW_value(retval.temporalsampling.forceultrasonic)
150  << "\n" <<
151  DATRW_value(retval.temporalsampling.forceseismic)
152  << "\n" <<
153  DATRW_value(retval.spatialsampling.bestrict)
154  << "\n" <<
155  DATRW_value(retval.spatialsampling.scalco)
156  << "\n" <<
157  DATRW_value(retval.spatialsampling.coodigits));
158  return(retval);
159  } // options::SUHeaderControl outputmodifiers(const std::string& mf)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:92
const char *const scalco
set desired scalco value
Definition: suformat.cc:64
const char *const forceseismic
understand data file as seismic data file in any case
Definition: suformat.cc:61
#define DATRW_assert_modifiers_are_recognized(S, F)
abort if user passed unused modifiers
const char *const forceultrasonic
understand data file as ultrasonic data file in any case
Definition: suformat.cc:62
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
Class to handle format modifiersThis class is used to parse a format modifier string. Detailed instructions will be given upon request. For some hints have a look at tests/libdatrwxxtests.c.
const char *const coodigits
maximum number of significant digits to be used
Definition: suformat.cc:63
#define DATRW_value(V)
report value
Definition: debug.h:65
void fixscalevalue(short &s, const bool &strict)
fix a SeismicUn*x scale value
Definition: sucomanager.cc:498
Here is the call graph for this function:
Here is the caller graph for this function: