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

◆ read()

void datrw::su::SUheader::read ( std::istream &  is)

read struct from file

Definition at line 72 of file suheader.cc.

References datrw::su::options::SpatialSampling::bestrict, DATRW_debug, DATRW_Xassert, datrw::su::fixscalevalue(), Mdebug, Mheader, Mheadercontrol, datrw::su::TraceHeaderStruct::scalco, datrw::su::TraceHeaderStruct::scalel, datrw::su::options::SUHeaderControl::spatialsampling, and datrw::su::TraceHeaderStruct::trid.

Referenced by datrw::isustream::isustream(), main(), and datrw::isustream::readheader().

73  {
74  char *ipointer=reinterpret_cast<char *>(&Mheader);
75  DATRW_Xassert(is.read(ipointer, sizeof(TraceHeaderStruct)),
76  "ERROR (SUheader::read): reading SU header",
77  SUReadException);
78  DATRW_debug(Mdebug, "SUheader::read",
79  "some fields upon input:\n"
80  "trid="<<Mheader.trid<<" "
81  "scalco="<<Mheader.scalco<<" "
82  "scalel="<<Mheader.scalel<<"\n");
87  DATRW_debug(Mdebug, "SUheader::read",
88  "some fields upon return:\n"
89  "trid="<<Mheader.trid<<" "
90  "scalco="<<Mheader.scalco<<" "
91  "scalel="<<Mheader.scalel<<"\n");
92  } // void SUheader::read(std::istream& is)
short scalel
Scalar to be applied to the previous 7 entries to give the real value (see details).
bool bestrict
if true: strictly use header definition by SeismicUnix source
Definition: suformat.h:133
#define DATRW_Xassert(C, M, E)
Check an assertion and report by throwing an exception.
Definition: error.h:76
datrw::su::options::SUHeaderControl Mheadercontrol
all options taken from the user
Definition: suheader.h:202
bool Mdebug
be verbose
Definition: suheader.h:204
short trid
Trace identification code (see details).
short scalco
Scalar to be applied to the next 4 entries to give the real value (see details).
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
void fixscalevalue(short &s, const bool &strict)
fix a SeismicUn*x scale value
Definition: sucomanager.cc:498
TraceHeaderStruct Mheader
the actual data fields are provided for public access
Definition: suheader.h:239
Here is the call graph for this function:
Here is the caller graph for this function: