bufr2synop 0.24.0
Functions
bufr2tac_x33.c File Reference

decodes the descriptors with X = 33 (Quality data) More...

#include "bufr2tac.h"
Include dependency graph for bufr2tac_x33.c:

Go to the source code of this file.

Functions

int buoy_parse_x33 (struct buoy_chunks *b, struct bufr2tac_subset_state *s)
 Parse a expanded descriptor with X = 33. More...
 
int temp_parse_x33 (struct temp_chunks *t, struct bufr2tac_subset_state *s)
 Parse a expanded descriptor with X = 33. More...
 

Detailed Description

decodes the descriptors with X = 33 (Quality data)

Definition in file bufr2tac_x33.c.

Function Documentation

◆ buoy_parse_x33()

int buoy_parse_x33 ( struct buoy_chunks b,
struct bufr2tac_subset_state s 
)

Parse a expanded descriptor with X = 33.

Parameters
bpointer to a struct buoy_chunks where to set the results
spointer to a struct bufr2tac_subset_state where is stored needed information in sequential analysis

It returns 0 if success, 1 if problems when processing. If a descriptor is not processed returns 0 anyway

Definition at line 34 of file bufr2tac_x33.c.

35{
36
38 return 0;
39
40
41 switch ( s->a->desc.y )
42 {
43 case 20: // 0 33 020. Quality control indication of followinf value
44 sprintf ( b->s0.Qt, "%d", s->ival );
45 b->mask |= BUOY_SEC1;
46 break;
47
48 case 21: // 0 33 021. Quality control of following value
49 sprintf ( b->s4.Qp, "%d", s->ival );
50 b->mask |= BUOY_SEC1;
51 break;
52
53 case 22: // 0 33 022. Quality of buoy satellite transmission
54 if ( s->ival == 0 )
55 {
56 if ( b->s0.Qt[0] == 0 )
57 sprintf ( b->s0.Qt, "1" );
58 if ( b->s1.Qd[0] == 0 )
59 sprintf ( b->s1.Qd, "1" );
60 if ( b->s2.Qd[0] == 0 )
61 sprintf ( b->s2.Qd, "1" );
62 }
63 if ( s->ival == 2 )
64 {
65 if ( b->s0.Qt[0] == 0 )
66 sprintf ( b->s0.Qt, "3" );
67 if ( b->s1.Qd[0] == 0 )
68 sprintf ( b->s1.Qd, "3" );
69 if ( b->s2.Qd[0] == 0 )
70 sprintf ( b->s2.Qd, "3" );
71 }
72 break;
73
74 case 23: // 0 33 023 . Quality of buoy location
75 sprintf ( b->s0.Ql, "%d", s->ival );
76 sprintf ( b->s4.QL, "%d", s->ival );
77 break;
78
79 case 27: // 0 33 027. Location quality class (range of ratiuos of 66% confidence)
80 sprintf ( b->s0.QA, "%d", s->ival );
81 sprintf ( b->s4.QA, "%d", s->ival );
82 break;
83
84 default:
85 if ( BUFR2TAC_DEBUG_LEVEL > 1 && (s->a->mask & DESCRIPTOR_VALUE_MISSING) == 0 )
86 bufr2tac_set_error ( s, 0, "syn_parse_x33()", "Descriptor not parsed" );
87 break;
88 }
89 return 0;
90}
int BUFR2TAC_DEBUG_LEVEL
Definition: bufr2tac.c:31
int bufr2tac_set_error(struct bufr2tac_subset_state *s, int severity, char *origin, char *explanation)
#define DESCRIPTOR_VALUE_MISSING
Bit mask for a missing value in a struct bufr_atom_data.
Definition: bufrdeco.h:140
#define BUOY_SEC1
mask bit meaning section 1 of buoy is solicited to or parsed with success
Definition: metbuoy.h:38
struct bufr_atom_data * a
Definition: bufr2tac.h:249
uint32_t mask
Definition: bufrdeco.h:437
struct bufr_descriptor desc
Definition: bufrdeco.h:436
struct buoy_sec2 s2
Definition: metbuoy.h:203
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
char Ql[2]
Definition: metbuoy.h:81
char Qt[2]
Definition: metbuoy.h:82
char QA[2]
Definition: metbuoy.h:83
char Qd[2]
Definition: metbuoy.h:91
char Qd[2]
Definition: metbuoy.h:112
char QL[2]
Definition: metbuoy.h:169
char Qp[2]
Definition: metbuoy.h:163
char QA[2]
Definition: metbuoy.h:170

References bufr2tac_subset_state::a, BUFR2TAC_DEBUG_LEVEL, bufr2tac_set_error(), BUOY_SEC1, bufr_atom_data::desc, DESCRIPTOR_VALUE_MISSING, bufr2tac_subset_state::ival, bufr_atom_data::mask, buoy_chunks::mask, buoy_sec0::QA, buoy_sec4::QA, buoy_sec1::Qd, buoy_sec2::Qd, buoy_sec0::Ql, buoy_sec4::QL, buoy_sec4::Qp, buoy_sec0::Qt, buoy_chunks::s0, buoy_chunks::s1, buoy_chunks::s2, buoy_chunks::s4, and bufr_descriptor::y.

Referenced by parse_subset_as_buoy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ temp_parse_x33()

int temp_parse_x33 ( struct temp_chunks t,
struct bufr2tac_subset_state s 
)

Parse a expanded descriptor with X = 33.

Parameters
tpointer to a struct temp_chunks where to set the results
spointer to a struct bufr2tac_subset_state where is stored needed information in sequential analysis

It returns 0 if success, 1 if problems when processing. If a descriptor is not processed returns 0 anyway

Definition at line 100 of file bufr2tac_x33.c.

101{
102
103 switch ( s->a->desc.y )
104 {
105 case 24: // 0 33 024. Station elevation quality mark (for mobile stations)
106 if ( s->a->mask & DESCRIPTOR_VALUE_MISSING )
107 {
108 strcpy ( t->a.s1.im, "/" );
109 strcpy ( t->b.s1.im, "/" );
110 strcpy ( t->c.s1.im, "/" );
111 strcpy ( t->d.s1.im, "/" );
112 return 0;
113 }
114
115 if ( s->ival >= 0 && s->ival < 9 )
116 {
117 sprintf ( t->a.s1.im, "%d", s->ival );
118 sprintf ( t->a.s1.im, "%d", s->ival );
119 sprintf ( t->a.s1.im, "%d", s->ival );
120 sprintf ( t->a.s1.im, "%d", s->ival );
121 }
122 else
123 {
124 strcpy ( t->a.s1.im, "/" );
125 strcpy ( t->b.s1.im, "/" );
126 strcpy ( t->c.s1.im, "/" );
127 strcpy ( t->d.s1.im, "/" );
128 }
129 break;
130 default:
131 if ( BUFR2TAC_DEBUG_LEVEL > 1 && (s->a->mask & DESCRIPTOR_VALUE_MISSING) == 0 )
132 bufr2tac_set_error ( s, 0, "temp_parse_x33()", "Descriptor not parsed" );
133 break;
134 }
135 return 0;
136}
struct temp_acd_sec1 s1
Definition: mettemp.h:455
char im[2]
Definition: mettemp.h:328
char im[2]
Definition: mettemp.h:355
struct temp_b_sec1 s1
Definition: mettemp.h:470
struct temp_acd_sec1 s1
Definition: mettemp.h:485
struct temp_c c
Definition: mettemp.h:517
struct temp_d d
Definition: mettemp.h:518
struct temp_b b
Definition: mettemp.h:516
struct temp_a a
Definition: mettemp.h:515
struct temp_acd_sec1 s1
Definition: mettemp.h:500

References bufr2tac_subset_state::a, temp_chunks::a, temp_chunks::b, BUFR2TAC_DEBUG_LEVEL, bufr2tac_set_error(), temp_chunks::c, temp_chunks::d, bufr_atom_data::desc, DESCRIPTOR_VALUE_MISSING, temp_acd_sec1::im, temp_b_sec1::im, bufr2tac_subset_state::ival, bufr_atom_data::mask, temp_a::s1, temp_b::s1, temp_c::s1, temp_d::s1, and bufr_descriptor::y.

Referenced by parse_subset_as_temp().

Here is the call graph for this function:
Here is the caller graph for this function: