readtsdata.h 4 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
/*! \file readtsdata.h
thomas.forbriger's avatar
GPL    
thomas.forbriger committed
2
3
 * \brief read waveform data through the interface provided by libdatreadxx 
 * (prototypes)
thomas.forbriger's avatar
thomas.forbriger committed
4
5
6
 * 
 * ----------------------------------------------------------------------------
 * 
thomas.forbriger's avatar
thomas.forbriger committed
7
 * $Id: readtsdata.h,v 1.4 2007-02-12 10:27:04 tforb Exp $
thomas.forbriger's avatar
thomas.forbriger committed
8
9
10
 * \author Thomas Forbriger
 * \date 31/01/2007
 * 
thomas.forbriger's avatar
GPL    
thomas.forbriger committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * read waveform data through the interface provided by libdatreadxx 
 * (prototypes)
 *
 * ----
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. 
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * ----
thomas.forbriger's avatar
thomas.forbriger committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 * 
 * Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach) 
 * 
 * REVISIONS and CHANGES 
 *  - 31/01/2007   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */

// include guard
#ifndef TF_READTSDATA_H_VERSION

#define TF_READTSDATA_H_VERSION \
  "TF_READTSDATA_H   V1.0   "
#define TF_READTSDATA_H_CVSID \
thomas.forbriger's avatar
thomas.forbriger committed
44
45
46
47
48
49
50
51
52
  "$Id: readtsdata.h,v 1.4 2007-02-12 10:27:04 tforb Exp $"

#include<tfxx/rangelist.h>
#include<tfxx/xcmdline.h>
#include<tfxx/rangestring.h>
#include<datreadxx/readany.h>
#include<tsxx/sffheaders.h>
#include<iostream>
#include<fstream>
thomas.forbriger's avatar
thomas.forbriger committed
53

thomas.forbriger's avatar
thomas.forbriger committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*! \defgroup group_readtsdata Reading of time series data.
 * \brief Read a complete set of time series including the selection of
 *   traces.
 *
 * The module is presented in namespace tfxx::tsio.
 *
 */

/*! \brief Interface provided through readtsdata.h
 *
 * \defgroup readtsdata_h Interface provided through readtsdata.h
 * 
 * \ingroup group_readtsdata
 */
namespace tfxx {

/*! \namespace tfxx::tsio
 * \brief Namespace containing all components of module readtsdata.
 * \ingroup group_readtsdata, readtsdata_h
 */
  namespace tsio {

    //! type of trace selection list
    typedef tfxx::RangeList<int> Ttracelist;

    //! type of trace selection key
thomas.forbriger's avatar
thomas.forbriger committed
80
    typedef const char* Ttracelistkey;
thomas.forbriger's avatar
thomas.forbriger committed
81
82

    //! structure to contain file data together with command line arguments
thomas.forbriger's avatar
thomas.forbriger committed
83
84
85
86
87
88
89
90
91
    struct DFile {
      // provides reading into doubles
      typedef double Tvalue;
      // container to be used
      typedef aff::Series<Tvalue> Tseries;
      // file container
      typedef ts::sff::File<Tseries> Tfile;
      //! rangelist
      typedef Tfile::Trangelist Trangelist;
thomas.forbriger's avatar
thomas.forbriger committed
92
93
94
      // command line arguments
      tfxx::cmdline::Filename arguments;
      // container to hold samples
thomas.forbriger's avatar
thomas.forbriger committed
95
      ts::sff::File<Tseries> data;
thomas.forbriger's avatar
thomas.forbriger committed
96
    }; // struct File
thomas.forbriger's avatar
thomas.forbriger committed
97
98
99

    //! complete list of files
    typedef std::list<DFile> TDFileList;
thomas.forbriger's avatar
thomas.forbriger committed
100
101
    
    //! read complete SFF file
thomas.forbriger's avatar
thomas.forbriger committed
102
    DFile readDSFF(const std::string& filename);
thomas.forbriger's avatar
thomas.forbriger committed
103
104

    //! read complete SFF file with trace selection
thomas.forbriger's avatar
thomas.forbriger committed
105
106
107
108
    DFile readDSFF(const std::string& filename,
                   const DFile::Trangelist& selection,
                   const bool& verbose=false,
                   const datread::Eformat& format=datread::Fsff);
thomas.forbriger's avatar
thomas.forbriger committed
109
110

    //! read complete SFF file with trace selection
thomas.forbriger's avatar
thomas.forbriger committed
111
112
113
114
    DFile readDSFF(const tfxx::cmdline::Filename& filename,
                   const bool& verbose=false,
                   Ttracelistkey="t",
                   const datread::Eformat& format=datread::Fsff);
thomas.forbriger's avatar
thomas.forbriger committed
115
116

    //! read complete list of SFF files with trace selection
thomas.forbriger's avatar
thomas.forbriger committed
117
118
119
120
    TDFileList readDSFF(const tfxx::cmdline::Tparsed& flist,
                        const bool& verbose=false,
                        Ttracelistkey="t",
                        const datread::Eformat& format=datread::Fsff);
thomas.forbriger's avatar
thomas.forbriger committed
121
122
123


  } // namespace tsio
thomas.forbriger's avatar
thomas.forbriger committed
124

thomas.forbriger's avatar
thomas.forbriger committed
125
} // namespace tfxx
thomas.forbriger's avatar
thomas.forbriger committed
126
127
128
129

#endif // TF_READTSDATA_H_VERSION (includeguard)

/* ----- END OF readtsdata.h ----- */