DATRW++ library: seismic data I/O with multiple formats
sffwriters.cc
Go to the documentation of this file.
1 /*! \file sffwriters.cc
2  * \brief functions to write sff data (implementation)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 21/02/2010
8  *
9  * functions to write sff data (implementation)
10  *
11  * Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach)
12  *
13  * ----
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27  * ----
28  *
29  *
30  * REVISIONS and CHANGES
31  * - 21/02/2010 V1.0 Thomas Forbriger
32  *
33  * ============================================================================
34  */
35 #define DATRW_SFFWRITERS_CC_VERSION \
36  "DATRW_SFFWRITERS_CC V1.0 "
37 
38 #include <datrwxx/sffwriters.h>
39 #include <datrwxx/datwrite.h>
40 
41 namespace datrw {
42 
43  namespace sff {
44 
45  void writesfftrace(std::ostream& os,
46  const ::sff::TraceHeader& traceheader,
47  const datrw::util::seriesreservoir& series,
48  const ::sff::Enormmode& normmode)
49  {
50  switch(series.valuetype()) {
52  os << ::sff::OutputWaveform<Tdseries>(series.dseries(),
53  traceheader,
54  normmode);
55  break;
57  os << ::sff::OutputWaveform<Tfseries>(series.fseries(),
58  traceheader,
59  normmode);
60  break;
62  os << ::sff::OutputWaveform<Tiseries>(series.iseries(),
63  traceheader,
64  normmode);
65  break;
66  default: DATRW_abort("empty reservoir!");
67  }
68  } // void writesfftrace
69 
70  } // namespace sff
71 
72 } // namespace datrw
73 
74 /* ----- END OF sffwriters.cc ----- */
trace has float data
Definition: binary.h:83
Evaluetype valuetype() const
Definition: reservoir.h:76
Root namespace of library.
Definition: aalibdatrwxx.cc:16
trace has double data
Definition: binary.h:82
single precision floating point
Definition: reservoir.h:55
#define DATRW_abort(M)
Abort and give a message.
Definition: error.h:101
Tdseries::Tcoc dseries() const
Definition: reservoir.cc:67
void writesfftrace(std::ostream &os, const ::sff::TraceHeader &traceheader, const datrw::util::seriesreservoir &series, const ::sff::Enormmode &normmode)
function to write an SFF trace from a series reservoir
Definition: sffwriters.cc:45
Tiseries::Tcoc iseries() const
Definition: reservoir.cc:79
generic interface definition (prototypes)
Tfseries::Tcoc fseries() const
Definition: reservoir.cc:73