DATRW++ library: seismic data I/O with multiple formats
thiesdl1format.cc
Go to the documentation of this file.
1 /*! \file thiesdl1format.cc
2  * \brief format definitions for ThiesDL1 files (implementation)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 13/09/2011
8  *
9  * format definitions for ThiesDL1 files (implementation)
10  *
11  * Copyright (c) 2011 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  * REVISIONS and CHANGES
30  * - 13/09/2011 V1.0 Thomas Forbriger
31  *
32  * ============================================================================
33  */
34 #define DATRW_THIESDL1FORMAT_CC_VERSION \
35  "DATRW_THIESDL1FORMAT_CC V1.0 "
36 
37 #include <datrwxx/thiesdl1.h>
38 
39 namespace datrw {
40 
41  /*! \brief all the stuff to read Thies DL1 data
42  *
43  * \defgroup group_thiesdl1 Reading module for: Thies DL1 data
44  *
45  * Thies/DL1 is the type fo pluviometer operated at BFO.
46  * \sa \ref page_thiesdl1_format
47  */
48 
49  /*! \brief Format properties
50  * \ingroup group_thiesdl1
51  * @{
52  */
53  const bool thiesdl1::isbinary=false;
54  const char* const thiesdl1::streamID="thiesdl1";
55  /**@}*/
56 
57 /*======================================================================*/
58 
59  /*! \page page_thiesdl1_format Definition of the ThiesDL1 file format
60  *
61  * This file format is used to store data of the Thies DL1/N pluviometer at
62  * BFO.
63  * The files are produced by program DL1logger, which accomplishes data
64  * acquisition by controlling the Thies DL1/N data logger and reading the
65  * data from the logger.
66  *
67  * Sections in this page:
68  * - \ref sec_page_thiesdl1_formatdefinition
69  * - \ref sec_page_thiesdl1_midnight
70  * - \ref sec_page_thiesdl1_current
71  * - \ref sec_page_thiesdl1_references
72  *
73  * \section sec_page_thiesdl1_formatdefinition Structure of a data file
74  * A typical data file stored by DL1logger is 20110911.asc:
75  * \verbatim
76 # Logger status :
77 # ---------------
78 # Date: 12.09.11
79 # Time: 1:01:15
80 # Battery : BAT OK
81 # MemCycle: Event
82 # ERROR: duplicate sample (index 1439): 24.000 0.0 11.09.11 24:00
83 # earliest date: 254 11.09.2011 00:00:00.000000
84 # latest date: 255 12.09.2011 00:00:00.000000
85 # creation date: 255 12.09.2011 01:01:19.000000
86 # initial line: Data : 11.09.11 0:00
87 # final line: END OF DATA BFO 1 DL1/N V1.10a
88 Data : 11.09.11 0:00
89 16.233 0.1 11.09.11 16:14
90 16.250 0.2 11.09.11 16:15
91 16.267 0.1 11.09.11 16:16
92 16.283 0.1 11.09.11 16:17
93 16.317 0.1 11.09.11 16:19
94 16.617 0.1 11.09.11 16:37
95 16.650 0.1 11.09.11 16:39
96 16.667 0.1 11.09.11 16:40
97 16.683 0.1 11.09.11 16:41
98 16.867 0.1 11.09.11 16:52
99 17.483 0.1 11.09.11 17:29
100 19.417 0.1 11.09.11 19:25
101 19.483 0.2 11.09.11 19:29
102 19.500 0.1 11.09.11 19:30
103 19.517 0.1 11.09.11 19:31
104 19.566 0.1 11.09.11 19:34
105 19.600 0.1 11.09.11 19:36
106 19.633 0.1 11.09.11 19:38
107 19.800 0.1 11.09.11 19:48
108 19.850 0.1 11.09.11 19:51
109 19.883 0.1 11.09.11 19:53
110 19.983 0.1 11.09.11 19:59
111 20.050 0.1 11.09.11 20:03
112 20.067 0.1 11.09.11 20:04
113 20.117 0.1 11.09.11 20:07
114 20.150 0.1 11.09.11 20:09
115 20.333 0.1 11.09.11 20:20
116 20.600 0.1 11.09.11 20:36
117 20.717 0.1 11.09.11 20:43
118 21.533 0.1 11.09.11 21:32
119 24.000 0.0 11.09.11 24:00
120 24.000 0.0 11.09.11 24:00
121 END OF DATA BFO 1 DL1/N V1.10a
122 \endverbatim
123  *
124  * It begins with a header produced by DL1logger, first reporting the
125  * current status when creating the data file:
126  * \verbatim
127 # Logger status :
128 # ---------------
129 # Date: 12.09.11
130 # Time: 1:01:15
131 # Battery : BAT OK
132 # MemCycle: Event
133 \endverbatim
134  *
135  * Then reporting log messages or error conditions produced while decoding
136  * the data stream:
137  * \verbatim
138 # ERROR: duplicate sample (index 1439): 24.000 0.0 11.09.11 24:00
139 \endverbatim
140  *
141  * This is followed by a statement indicating the time span for which data
142  * was requested from the data logger, the time of creation of the data file
143  * and the first and final line sent by the logger:
144  * \verbatim
145 # earliest date: 254 11.09.2011 00:00:00.000000
146 # latest date: 255 12.09.2011 00:00:00.000000
147 # creation date: 255 12.09.2011 01:01:19.000000
148 # initial line: Data : 11.09.11 0:00
149 # final line: END OF DATA BFO 1 DL1/N V1.10a
150 \endverbatim
151  *
152  * All these header lines have a \c # in the first column.
153  * After the header, the actual data sent by the Thies DL1/N logger is
154  * dumped.
155  * It starts with the initial line sent by the logger:
156  * \verbatim
157 Data : 11.09.11 0:00
158 \endverbatim
159  *
160  * After the initial line, the logger produced one data line for each minute
161  * for which precipitation was recorded.
162  * Minutes for which no precipitation has occured, no lines are present.
163  * Each line consists of four fields. For example:
164  * \verbatim
165 16.233 0.1 11.09.11 16:14
166 \endverbatim
167  * The fields are:
168  * -# the time in decimal hours (in UT)
169  * -# the recorded precipitation for the reported minute in mm
170  * -# the date in format DD.MM.YY
171  * -# the time in format HH:MM (in UT)
172  *
173  * The data file is finished with the final line sent by the logger:
174  * \verbatim
175 END OF DATA BFO 1 DL1/N V1.10a
176 \endverbatim
177  * This line indicates the station for which data was recorded (here: BFO)
178  * and the type of instrument used (here: DL1/N).
179  *
180  * \section sec_page_thiesdl1_midnight Timing at end of day
181  * The time reported in the data line is the time when the current
182  * precipitaion count interval ended.
183  * A line for 22:46 provides the amount of precipitation recorded for the
184  * time interval from 22:45 to 22:46.
185  * Consequently the last line in a file is for 24:00.
186  * For example the file 20090714.asc ends with
187  * \verbatim
188 ...
189 23.917 0.2 14.07.09 23:55
190 23.933 0.3 14.07.09 23:56
191 23.950 0.7 14.07.09 23:57
192 23.967 0.7 14.07.09 23:58
193 23.983 0.6 14.07.09 23:59
194 24.000 0.7 14.07.09 24:00
195 END OF DATA BFO 1 DL1/N V1.10a
196 \endverbatim
197  * The next file (20090715.asc) starts with
198  * \verbatim
199 # Logger status :
200 # ---------------
201 # Date: 16.07.09
202 # Time: 1:01:17
203 # Battery : BAT OK
204 # MemCycle: Event
205 # earliest date: 196 15.07.2009 00:00:00.000000
206 # latest date: 197 16.07.2009 00:00:00.000000
207 # creation date: 197 16.07.2009 01:01:19.000000
208 # initial line: Data : 15.07.09 0:00
209 # final line: END OF DATA BFO 1 DL1/N V1.10a
210 Data : 15.07.09 0:00
211 00.017 1.2 15.07.09 00:01
212 00.033 0.8 15.07.09 00:02
213 00.050 0.7 15.07.09 00:03
214 00.067 0.5 15.07.09 00:04
215 00.083 0.5 15.07.09 00:05
216 ...
217 \endverbatim
218  *
219  * \section sec_page_thiesdl1_current File for the current hour
220  * Files for the current hour (i.e. hours not yet completed) are given the
221  * name \c active.asc.
222  * An example is
223  * \verbatim
224 # Logger status :
225 # ---------------
226 # Date: 13.09.11
227 # Time: 7:55:02
228 # Battery : BAT OK
229 # MemCycle: Event
230 # earliest date: 256 13.09.2011 00:00:00.000000
231 # latest date: 256 13.09.2011 07:57:02.000000
232 # creation date: 256 13.09.2011 07:55:05.000000
233 # initial line: Data : 13.09.11 0:00
234 # final line: END OF DATA BFO 1 DL1/N V1.10a
235 Data : 13.09.11 0:00
236 03.383 0.1 13.09.11 03:23
237 04.400 0.1 13.09.11 04:24
238 END OF DATA BFO 1 DL1/N V1.10a
239 \endverbatim
240  * The time span for which this file is valid is only apparent from the file
241  * header.
242  *
243  * \section sec_page_thiesdl1_references References
244  * \sa Product page of the Thies company:
245  * http://www.thiesclima.com/Datalogger%20DL1%20N.html
246  * \sa Thies DL1 data acquisition program:
247  * https://git.scc.kit.edu/Seitosh/Seitosh/tree/master/src/conv/ThiesDL1
248  * \sa \ref group_thiesdl1
249  */
250 
251 } // namespace datrw
252 
253 /* ----- END OF thiesdl1format.cc ----- */
const char *const streamID
Format properties.
const bool isbinary
Format properties.
Root namespace of library.
Definition: aalibdatrwxx.cc:16
module to read ThiesDL1 data files (prototypes)