bufr2synop 0.24.0
Functions
bufr2tac_x31.c File Reference

decodes the descriptors with X = 31 (Control) More...

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

Go to the source code of this file.

Functions

int syn_parse_x31 (struct synop_chunks *syn, struct bufr2tac_subset_state *s)
 Parse a expanded descriptor with X = 31. More...
 
int buoy_parse_x31 (struct buoy_chunks *b, struct bufr2tac_subset_state *s)
 Parse a expanded descriptor with X = 31. More...
 
int temp_parse_x31 (struct temp_chunks *t, struct bufr2tac_subset_state *s)
 Parse a expanded descriptor with X = 31. More...
 

Detailed Description

decodes the descriptors with X = 31 (Control)

Definition in file bufr2tac_x31.c.

Function Documentation

◆ buoy_parse_x31()

int buoy_parse_x31 ( struct buoy_chunks b,
struct bufr2tac_subset_state s 
)

Parse a expanded descriptor with X = 31.

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 81 of file bufr2tac_x31.c.

82{
84 {
85 return 0;
86 }
87
88 if ( b == NULL )
89 {
90 return 1;
91 }
92
93 switch ( s->a->desc.y )
94 {
95 case 0: // 0 31 000 . Short delayed descriptor replication factor
96 // It is no meaning here
97 break;
98
99 case 1:
100 s->rep = s->ival;
101 s->k_rep = s->i;
102 break;
103
104 default:
105 if ( BUFR2TAC_DEBUG_LEVEL > 1 && (s->a->mask & DESCRIPTOR_VALUE_MISSING) == 0 )
106 bufr2tac_set_error ( s, 0, "buoy_parse_x31()", "Descriptor not parsed" );
107 break;
108 }
109 return 0;
110}
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
struct bufr_atom_data * a
Definition: bufr2tac.h:249
uint32_t mask
Definition: bufrdeco.h:437
struct bufr_descriptor desc
Definition: bufrdeco.h:436

References bufr2tac_subset_state::a, BUFR2TAC_DEBUG_LEVEL, bufr2tac_set_error(), bufr_atom_data::desc, DESCRIPTOR_VALUE_MISSING, bufr2tac_subset_state::i, bufr2tac_subset_state::ival, bufr2tac_subset_state::k_rep, bufr_atom_data::mask, bufr2tac_subset_state::rep, 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:

◆ syn_parse_x31()

int syn_parse_x31 ( struct synop_chunks syn,
struct bufr2tac_subset_state s 
)

Parse a expanded descriptor with X = 31.

Parameters
synpointer to a struct synop_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 35 of file bufr2tac_x31.c.

36{
37
39 {
40 // 0 31 000 does not have DESCRIPTOR_VALUE_MISSING
41 if (s->a->desc.y != 0)
42 return 0;
43 s->rep = 1;
44 s->k_rep = s->i;
45 }
46
47 if ( syn == NULL )
48 {
49 return 1;
50 }
51
52 switch ( s->a->desc.y )
53 {
54 case 0: // 0 31 000 . Short delayed descriptor replication factor
55 s->rep = s->ival;
56 s->k_rep = s->i;
57 break;
58
59 case 1:
60 s->rep = s->ival;
61 s->k_rep = s->i;
62 break;
63
64 default:
65 if ( BUFR2TAC_DEBUG_LEVEL > 1 && (s->a->mask & DESCRIPTOR_VALUE_MISSING) == 0 )
66 bufr2tac_set_error ( s, 0, "syn_parse_x31()", "Descriptor not parsed" );
67 break;
68 }
69 return 0;
70}

References bufr2tac_subset_state::a, BUFR2TAC_DEBUG_LEVEL, bufr2tac_set_error(), bufr_atom_data::desc, DESCRIPTOR_VALUE_MISSING, bufr2tac_subset_state::i, bufr2tac_subset_state::ival, bufr2tac_subset_state::k_rep, bufr_atom_data::mask, bufr2tac_subset_state::rep, and bufr_descriptor::y.

Referenced by parse_subset_as_synop().

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

◆ temp_parse_x31()

int temp_parse_x31 ( struct temp_chunks t,
struct bufr2tac_subset_state s 
)

Parse a expanded descriptor with X = 31.

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 120 of file bufr2tac_x31.c.

121{
122 if ( s->a->mask & DESCRIPTOR_VALUE_MISSING )
123 {
124 return 0;
125 }
126
127 if ( t == NULL )
128 {
129 return 1;
130 }
131
132 switch ( s->a->desc.y )
133 {
134 case 0: // 0 31 000 . Short delayed descriptor replication factor
135 // It is no meaning here
136 break;
137 case 1: // 0 31 001 . Replicator
138 // It is supposed that it is the extended replicator used when describing
139 // wind shear points in raiosonde
140 // It is the amount of points of wind shear data at pressure level
141 if ( s->ival < TEMP_NMAX_POINTS )
142 {
143 s->itval = s->ival;
144 s->rep = 0; // used to mark it is a share point in sequent descriptors
145 }
146 else
147 {
148 return 1; // too much points
149 }
150 s->k_itval = s->i;
151 s->w->n = 0;
152 break;
153
154 case 2: // 0 31 002 . Extended replicator
155 // It is supposed that it is the extended replicator used when describing
156 // Temperature, dew-point and wind data at a pressure level with radiosonde position
157 // So the integer value of repliactor IS the amount of points
158 s->rep = s->ival; // replications and points we need. Also Used to mark this type of point
159 s->itval = 0;
160 s->k_rep = s->i;
161 s->r->n = 0;
162 break;
163 default:
164 if ( BUFR2TAC_DEBUG_LEVEL > 1 && (s->a->mask & DESCRIPTOR_VALUE_MISSING) == 0 )
165 bufr2tac_set_error ( s, 0, "temp_parse_x31()", "Descriptor not parsed" );
166 break;
167 }
168 return 0;
169}
#define TEMP_NMAX_POINTS
maximum number of significant points
Definition: mettemp.h:138
struct temp_raw_wind_shear_data * w
Definition: bufr2tac.h:286
struct temp_raw_data * r
Definition: bufr2tac.h:285
size_t n
Definition: mettemp.h:214

References bufr2tac_subset_state::a, BUFR2TAC_DEBUG_LEVEL, bufr2tac_set_error(), bufr_atom_data::desc, DESCRIPTOR_VALUE_MISSING, bufr2tac_subset_state::i, bufr2tac_subset_state::itval, bufr2tac_subset_state::ival, bufr2tac_subset_state::k_itval, bufr2tac_subset_state::k_rep, bufr_atom_data::mask, temp_raw_data::n, temp_raw_wind_shear_data::n, bufr2tac_subset_state::r, bufr2tac_subset_state::rep, TEMP_NMAX_POINTS, bufr2tac_subset_state::w, 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: