bufr2synop 0.24.0
metbuoy.h
Go to the documentation of this file.
1/* $Id$ */
2/***************************************************************************
3 * Copyright (C) 2004-2022 by Guillermo Ballester Valor *
4 * gbv@ogimet.com *
5 * *
6 * This file is part of bufr2synop *
7 * *
8 * Ogimet is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * Ogimet is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, see <http://www.gnu.org/licenses/>. *
20 * *
21 ***************************************************************************/
22/*!
23 \file metbuoy.h
24 \brief Main header file for buoy related tasks
25*/
26#ifndef METBUOY_H
27#define METBUOY_H
28
29
30/*! \def BUOY_SEC0
31 \brief mask bit meaning section 0 of buoy is solicited to or parsed with success
32*/
33#define BUOY_SEC0 1
34
35/*! \def BUOY_SEC1
36 \brief mask bit meaning section 1 of buoy is solicited to or parsed with success
37*/
38#define BUOY_SEC1 2
39
40/*! \def BUOY_SEC2
41 \brief mask bit meaning section 2 of buoy is solicited to or parsed with success
42*/
43#define BUOY_SEC2 4
44
45/*! \def BUOY_SEC3
46 \brief mask bit meaning section 3 of buoy is solicited to or parsed with success
47*/
48#define BUOY_SEC3 8
49
50/*! \def BUOY_SEC4
51 \brief mask bit meaning section 4 of buoy is solicited to or parsed with success
52*/
53#define BUOY_SEC4 16
54
55/*! \def BUOY_EXT
56 \brief mask bit meaning date extension is parsed with success
57*/
58#define BUOY_EXT 32
59
60
61/*! \struct buoy_sec0
62 \brief contains all possible substrings from section 0 when a report is parsed with success
63*/
65{
66 char MiMi[4]; /*!< MiMi item. (Code table 2582) */
67 char MjMj[4]; /*!< MjMj item. (Code table 2582) */
68 char A1[2]; /*!< A1 item. WMO region */
69 char bw[2]; /*!< bw item. WMO subregion */
70 char nbnbnb[8]; /*!< kins and serial number for buoy */
71 char D_D[8]; /*!< Ship signal*/
72 char YY[4]; /*!< Day (UTC) of observation */
73 char MM[4]; /*!< Month (UTC) of observation 01, 02 .... 12 */
74 char J[4]; /*!< Least significant digit of year */
75 char GG[4]; /*!< Hour (UTC) of observation */
76 char gg[4]; /*!< Minute (UTC) of observation */
77 char iw[2]; /*!< Indicator for source and units used in speed wind data */
78 char Qc[2]; /*!< Quadrant of the Globe (Code table 3333) */
79 char LaLaLaLaLa[8]; /*!< Latitude, precision up to in 0.001 degree */
80 char LoLoLoLoLoLo[8]; /*!< Longitude, precision up to 0.001 degree */
81 char Ql[2]; /*!< Quality control indicator for position (Code Table 3334) */
82 char Qt[2]; /*!< Quality control for time (Code Table 3334) */
83 char QA[2]; /*!< Location quality class (Code table 3302) */
84};
85
86/*! \struct buoy_sec1
87 \brief contains all possible substrings from section 1 when a report is parsed with success
88*/
90{
91 char Qd[2]; /*!< Quality control indicatitor (Code Table 3334) */
92 char Qx[2]; /*!< Indicator of position of group (Regulation 18.3.3) */
93 char dd[4]; /*!< True direction, in tens of degrees, from which wind is blowing (Code table 0877) */
94 char ff[4]; /*!< Wind speed, in units indicated by iw. */
95 char fff[4]; /*!< Wind speed, in units indicated by iw, of 99 units or more. */
96 char sn1[2]; /*!< Sign of temperature (Code table 3845) */
97 char TTT[4]; /*!< Air temperature, in tenths of a degree Celsius, its sign being given by sn1. */
98 char sn2[2]; /*!< Sign of dewpoint temperature (Code table 3845) */
99 char TdTdTd[4]; /*!< Dew-point temperature, in tenths of a degree Celsius, its sign being given by sn2. */
100 char UUU[4]; /*!< Relative humidity of the air, in per cent, the first figure being zero except for UUU = 100 percent.*/
101 char PoPoPoPo[6]; /*!< Pressure at station level, in tenths of a hectopascal, omitting thousands digit of hectopascals of the pressure value. */
102 char PPPP[6]; /*!< Pressure at mean sea level, in tenths of a hectopascal, omitting the thousands digit of hectopascals of the pressure value. */
103 char a[2]; /*!< Characteristic of pressure tendency during the three hours preceding the time of observation. (Code table 0200) */
104 char ppp[4]; /*!< Amount of pressure tendency at station level during the three hours preceding the time of observation, expressed in tenths of a hectopascal. */
105};
106
107/*! \struct buoy_sec2
108 \brief contains all possible substrings from section 2 when a report is parsed with success
109*/
111{
112 char Qd[2]; /*!< Quality control indicatitor (Code Table 3334) */
113 char Qx[2]; /*!< Indicator of position of group (Regulation 18.3.3) */
114 char sn[2]; /*!< Sign of temperature (Code table 3845) */
115 char TwTwTw[4]; /*!< Sea surfacer temperature, in tenths of a degree Celsius, its sign being given by sn. */
116 char PwaPwa[4]; /*!< Period of waves, obtained by instrumental methods, in seconds. */
117 char HwaHwa[4]; /*!< heigh of waves, in units of 0.5 metre */
118 char PwaPwaPwa[6]; /*!< Period of waves, obtained by instrumental methods, in tenths of a second.*/
119 char HwaHwaHwa[6]; /*!< heigh of waves, in tenths of metre */
120};
121
122/*!
123 \struct b_sec3_layer1
124 \brief A layer with Temperature and salinity for a buoy report
125*/
127{
128 char zzzz[6]; /*!< Meters below sea level */
129 char TTTT[6]; /*!< Temperature in cents of celsius degrees */
130 char SSSS[6]; /*!< Salinity in cents of parts per 1000 */
131};
132
133/*!
134 \struct b_sec3_layer2
135 \brief A layer with direction and speed for a sea current
136*/
138{
139 char zzzz[6]; /*!< Meters below sea level */
140 char dd[4]; /*!< Direction of current in ten degrees */
141 char ccc[6]; /*!< Current speed in cm/s */
142};
143
144/*! \struct buoy_sec3
145 \brief contains all possible substrings from section 3 when a report is parsed with success
146*/
148{
149 char Qd1[2]; /*!< Quality control for temperature and salinity (Table 3334)*/
150 char Qd2[2]; /*!< Quality control for direction and speed (Table 3334)*/
151 char k2[2]; /*!< Method for salinity measurement (Table 2263)*/
152 char k3[2]; /*!< Duration and medition of current speed */
153 char k6[2]; /*!< Method to eliminate the effect the ship or buoy movement */
154 struct b_sec3_layer1 l1[32]; /*!< Array of temperature and salinity for layers */
155 struct b_sec3_layer2 l2[32]; /*!< Array of direction and speed for layers */
156};
157
158/*! \struct buoy_sec4
159 \brief contains all possible substrings from section 4 when a report is parsed with success
160*/
162{
163 char Qp[2]; /*!< Quality of the pressure measurement. (Code table 3315) */
164 char Q2[2]; /*!< Quality of the housekeeping parameter (second word in first block of ARGOS platform
165transmitters terminal sensor data). (Code table 3363) */
166 char QTW[2]; /*!< Quality of the measurement of the water-surface temperature. (Code table 3319)(FM 18) */
167 char Q4[2]; /*!< Quality of the measurement of air temperature. (Code table 3363) */
168 char QN[2]; /*!< Quality of the buoy satellite transmission. (Code table 3313) */
169 char QL[2]; /*!< Quality of location.(Code table 3311) */
170 char QA[2]; /*!< Location quality class (Code table 3302) */
171 char Qz[2]; /*!< Indicator of depth correction (indication whetherprobe depths are corrected using hydrostatic pressure or not). (Code table 3318) */
172 char Qc[2]; /*!< Quadrant of the globe. (Code table 3333) */
173 char LaLaLaLaLa[8]; /*!< Latitude, in thousandths of a degree. */
174 char LoLoLoLoLoLo[8]; /*!< Longitude, in thousandths of a degree. */
175 char YY[4]; /*!< Day of the month (UTC), with 01 indicating the first day, 02 the second day, etc. */
176 char MM[4]; /*!< Month of the year (UTC), i.e. 01 = January; 02 = February, etc. */
177 char J[2]; /*!< Units digit of the year (UTC), i.e. 1974 = 4. */
178 char GGgg[8]; /*!< Time of observation, in hours and minutes UTC. */
179 char ZhZhZhZh[6]; /*!< Hydrostatic pressure of lower end of cable, in kPa. */
180 char ZcZcZcZc[6]; /*!< Length of cable, in metres (thermistor strings). */
181 char BtBt[4]; /*!< */
182 char XtXt[4]; /*!< Typeof drogue. Code table 4780) */
183 char AhAhAh[6]; /*!< Anemometer height expressed in decimetres. */
184 char AN[2]; /*!< Type of anemometer. (Code table 0114) */
185 char VBVB[4]; /*!< Drifting speed, in cm s–1, of the buoy at the last known position of the buoy given in the groups YYMMJ GGgg/ */
186 char dBdB[4]; /*!< Drift direction of the buoy, expressed in tens of degrees, at the last known position of the
187 buoy given in the groups YYMMJ GGgg/ */
188 char ViViViVi[6]; /*!< Information on the engineering status of the buoy. */
189 char ZdZdZd[6]; /*!< Length of the cable at which the drogue is attached, in metres. */
190};
191
192
193/*! \struct buoy_chunks
194 \brief contains all possible substrings from a synop report is parsed with success
195*/
197{
198 int mask; /*!< Mask with sections parsed succesfully */
199 struct report_date_ext e; /*!< struct with the optional extension parsed */
200 struct wigos_id wid; /*!< struct with the WIGOS indentifier if any */
201 struct buoy_sec0 s0; /*!< struct with parsed header and section 0 */
202 struct buoy_sec1 s1; /*!< struct with parsed section 1 */
203 struct buoy_sec2 s2; /*!< struct with parsed section 2 if present */
204 struct buoy_sec3 s3; /*!< struct with parsed section 3 if present */
205 struct buoy_sec4 s4; /*!< struct with parsed section 4 if present */
206 char error[128]; /*!< string with error code if a wrong synop report is found */
207};
208
209#endif
A layer with Temperature and salinity for a buoy report.
Definition: metbuoy.h:127
char zzzz[6]
Definition: metbuoy.h:128
char TTTT[6]
Definition: metbuoy.h:129
char SSSS[6]
Definition: metbuoy.h:130
A layer with direction and speed for a sea current.
Definition: metbuoy.h:138
char dd[4]
Definition: metbuoy.h:140
char ccc[6]
Definition: metbuoy.h:141
char zzzz[6]
Definition: metbuoy.h:139
contains all possible substrings from a synop report is parsed with success
Definition: metbuoy.h:197
struct buoy_sec3 s3
Definition: metbuoy.h:204
struct wigos_id wid
Definition: metbuoy.h:200
char error[128]
Definition: metbuoy.h:206
struct buoy_sec2 s2
Definition: metbuoy.h:203
struct report_date_ext e
Definition: metbuoy.h:199
int mask
Definition: metbuoy.h:198
struct buoy_sec1 s1
Definition: metbuoy.h:202
struct buoy_sec4 s4
Definition: metbuoy.h:205
struct buoy_sec0 s0
Definition: metbuoy.h:201
contains all possible substrings from section 0 when a report is parsed with success
Definition: metbuoy.h:65
char LoLoLoLoLoLo[8]
Definition: metbuoy.h:80
char Ql[2]
Definition: metbuoy.h:81
char Qt[2]
Definition: metbuoy.h:82
char MjMj[4]
Definition: metbuoy.h:67
char YY[4]
Definition: metbuoy.h:72
char nbnbnb[8]
Definition: metbuoy.h:70
char MiMi[4]
Definition: metbuoy.h:66
char LaLaLaLaLa[8]
Definition: metbuoy.h:79
char Qc[2]
Definition: metbuoy.h:78
char A1[2]
Definition: metbuoy.h:68
char D_D[8]
Definition: metbuoy.h:71
char J[4]
Definition: metbuoy.h:74
char QA[2]
Definition: metbuoy.h:83
char iw[2]
Definition: metbuoy.h:77
char bw[2]
Definition: metbuoy.h:69
char gg[4]
Definition: metbuoy.h:76
char MM[4]
Definition: metbuoy.h:73
char GG[4]
Definition: metbuoy.h:75
contains all possible substrings from section 1 when a report is parsed with success
Definition: metbuoy.h:90
char a[2]
Definition: metbuoy.h:103
char PoPoPoPo[6]
Definition: metbuoy.h:101
char fff[4]
Definition: metbuoy.h:95
char Qx[2]
Definition: metbuoy.h:92
char dd[4]
Definition: metbuoy.h:93
char ppp[4]
Definition: metbuoy.h:104
char sn2[2]
Definition: metbuoy.h:98
char UUU[4]
Definition: metbuoy.h:100
char TTT[4]
Definition: metbuoy.h:97
char PPPP[6]
Definition: metbuoy.h:102
char ff[4]
Definition: metbuoy.h:94
char TdTdTd[4]
Definition: metbuoy.h:99
char Qd[2]
Definition: metbuoy.h:91
char sn1[2]
Definition: metbuoy.h:96
contains all possible substrings from section 2 when a report is parsed with success
Definition: metbuoy.h:111
char PwaPwaPwa[6]
Definition: metbuoy.h:118
char Qd[2]
Definition: metbuoy.h:112
char Qx[2]
Definition: metbuoy.h:113
char HwaHwa[4]
Definition: metbuoy.h:117
char TwTwTw[4]
Definition: metbuoy.h:115
char HwaHwaHwa[6]
Definition: metbuoy.h:119
char sn[2]
Definition: metbuoy.h:114
char PwaPwa[4]
Definition: metbuoy.h:116
contains all possible substrings from section 3 when a report is parsed with success
Definition: metbuoy.h:148
char k2[2]
Definition: metbuoy.h:151
struct b_sec3_layer2 l2[32]
Definition: metbuoy.h:155
char k6[2]
Definition: metbuoy.h:153
char Qd2[2]
Definition: metbuoy.h:150
char k3[2]
Definition: metbuoy.h:152
struct b_sec3_layer1 l1[32]
Definition: metbuoy.h:154
char Qd1[2]
Definition: metbuoy.h:149
contains all possible substrings from section 4 when a report is parsed with success
Definition: metbuoy.h:162
char Q2[2]
Definition: metbuoy.h:164
char QN[2]
Definition: metbuoy.h:168
char Qz[2]
Definition: metbuoy.h:171
char QL[2]
Definition: metbuoy.h:169
char AhAhAh[6]
Definition: metbuoy.h:183
char Qp[2]
Definition: metbuoy.h:163
char QA[2]
Definition: metbuoy.h:170
char YY[4]
Definition: metbuoy.h:175
char ZdZdZd[6]
Definition: metbuoy.h:189
char GGgg[8]
Definition: metbuoy.h:178
char ZhZhZhZh[6]
Definition: metbuoy.h:179
char LaLaLaLaLa[8]
Definition: metbuoy.h:173
char QTW[2]
Definition: metbuoy.h:166
char MM[4]
Definition: metbuoy.h:176
char ViViViVi[6]
Definition: metbuoy.h:188
char BtBt[4]
Definition: metbuoy.h:181
char Q4[2]
Definition: metbuoy.h:167
char J[2]
Definition: metbuoy.h:177
char ZcZcZcZc[6]
Definition: metbuoy.h:180
char AN[2]
Definition: metbuoy.h:184
char VBVB[4]
Definition: metbuoy.h:185
char Qc[2]
Definition: metbuoy.h:172
char dBdB[4]
Definition: metbuoy.h:186
char XtXt[4]
Definition: metbuoy.h:182
char LoLoLoLoLoLo[8]
Definition: metbuoy.h:174
contains extensions, not in wmo. Date/time UTC information
Definition: metcommon.h:32
WIGOS station identifier.
Definition: metcommon.h:46