DATRW++ library: seismic data I/O with multiple formats
mseed_record_read.cc
Go to the documentation of this file.
1 /*! \file mseed_record_read.cc
2  * \brief reading function of class datrw::mseed::Record (implementation)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 23/06/2016
8  *
9  * reading function of class datrw::mseed::Record (implementation)
10  *
11  * Copyright (c) 2016 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, see <http://www.gnu.org/licenses/>.
26 
27  * ----
28  *
29  * REVISIONS and CHANGES
30  * - 23/06/2016 V1.0 Thomas Forbriger
31  * - 05/07/2016 V1.1 pass check flags to MiniSEEDrecord
32  *
33  * ============================================================================
34  */
35 #define DATRW_MSEED_RECORD_READ_CC_VERSION \
36  "DATRW_MSEED_RECORD_READ_CC V1.1"
37 
38 #include <datrwxx/mseed.h>
39 #include <datrwxx/mseedread.h>
40 
41 namespace datrw {
42 
43  namespace mseed {
44 
45  //! read and decode a record to SFF
46  void Record::read(std::istream& is,
47  const bool& dumpascii,
48  const bool& estimateNframes,
49  const ConsistencyChecks& checks)
50  {
52  seedrecord.checks(checks);
53  seedrecord.estimateNframes(estimateNframes);
55  is >> seedrecord;
56  this->wid2.date=seedrecord.date();
57  this->wid2.station=seedrecord.station();
58  this->wid2.channel=seedrecord.channel();
59  this->wid2.auxid=seedrecord.network()+":"+seedrecord.location();
60  this->wid2.nsamples=seedrecord.nsamples();
61  this->wid2.dt=seedrecord.dt();
62  this->data=seedrecord.data();
63  this->valid=seedrecord.valid();
64  this->xm1=seedrecord.xm1();
65  } // void Record::read(std::istream& is, const bool& dumpascii)
66 
67  } // namespace mseed
68 
69 } // namespace datrw
70 
71 /* ----- END OF mseed_record_read.cc ----- */
void checks(const ConsistencyChecks &flags)
adjust flags consistency checks
Definition: mseedread.h:219
void read(std::istream &is, const bool &dumpascii=false, const bool &estimateNframes=false, const ConsistencyChecks &checks=ConsistencyChecks(true, true))
read and decode a record to SFF
Tiseries data
Definition: mseed.h:146
const char *const dumpascii
keywords for format modifiers
::sff::WID2 wid2
Definition: mseed.h:144
Root namespace of library.
Definition: aalibdatrwxx.cc:16
Debug & debug()
return reference to debug flags
Definition: mseedread.h:214
void estimateNframes(const bool &flag)
adjust flag for estimation of frame count
Definition: mseedread.h:216
provide mini-SEED data (prototypes)
bool report_ascii_data_to_stdout
report ASCII lines
Definition: mseedread.h:136
const char *const estimateNframes
keywords for format modifiers