DATRW++ library: seismic data I/O with multiple formats
readbonjer.h
Go to the documentation of this file.
1 /*! \file readbonjer.h
2  * \brief read data obtained in ASCII from K. Bonjer (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 30/03/2004
8  *
9  * read data obtained in ASCII from K. Bonjer (prototypes)
10  *
11  * ----
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25  * ----
26  *
27  * Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
28  *
29  * REVISIONS and CHANGES
30  * - 30/03/2004 V1.0 Thomas Forbriger
31  *
32  * ============================================================================
33  */
34 
35 // include guard
36 #ifndef DATRW_READBONJER_H_VERSION
37 
38 #define DATRW_READBONJER_H_VERSION \
39  "DATRW_READBONJER_H V1.0 "
40 
41 #include<aff/series.h>
42 #include<iostream>
43 #include<libtime++.h>
44 
45 namespace datrw {
46 
47  /*! \brief all functions, classes, etc. to read K. Bonjers data format
48  *
49  * \defgroup group_bonjer Reading module for: file format defined by K. Bonjer
50  */
51 
52  /*! \brief all functions, classes, etc. to read K. Bonjers data format
53  *
54  * \ingroup group_bonjer
55  */
56  namespace bonjer {
57 
58  //! hold file header contents
59  struct header {
60  std::string station;
61  int nsamples;
62  std::string filename;
63  std::string component;
64  libtime::TAbsoluteTime date;
65  double rate;
66  std::string sensitivity;
67  std::string units;
68  }; // struct header
69 
70  //! we read the data to a vector
71  typedef aff::Series<double> Tdata;
72 
73  //! function to read the file header
74  header readheader(std::istream& is, const bool& verbose=false);
75  //! function to read the file data
76  Tdata readdata(std::istream& is, const header& hd);
77 
78  } // namespace bonjer
79 
80 } // namespace datrw
81 
82 #endif // DATRW_READBONJER_H_VERSION (includeguard)
83 
84 /* ----- END OF readbonjer.h ----- */
std::string station
Definition: readbonjer.h:60
Tdata readdata(std::istream &is, const header &hd)
function to read the file data
Definition: readbonjer.cc:153
std::string filename
Definition: readbonjer.h:62
libtime::TAbsoluteTime date
Definition: readbonjer.h:64
Root namespace of library.
Definition: aalibdatrwxx.cc:16
std::string sensitivity
Definition: readbonjer.h:66
hold file header contents
Definition: readbonjer.h:59
header readheader(std::istream &is, const bool &verbose)
function to read the file header
Definition: readbonjer.cc:76
std::string units
Definition: readbonjer.h:67
aff::Series< double > Tdata
we read the data to a vector
Definition: readbonjer.h:71
std::string component
Definition: readbonjer.h:63