1#![cfg_attr(feature = "nightly", coverage(off))]
2
3#[repr(u16)]
24#[allow(missing_docs)]
25#[derive(Debug, Clone, Copy, PartialEq, Eq)]
26pub enum Grib2Table5_0 {
27 GridPointDataSimplePacking = 0,
28 MatrixValueAtGridPointSimplePacking = 1,
29 GridPointDataComplexPacking = 2,
30 GridPointDataComplexPackingAndSpatialDifferencing = 3,
31 GridPointDataIeeeFloatingPointData = 4,
32 GridPointDataJpeg2000CodeStreamFormat = 40,
33 GridPointDataPortableNetworkGraphicsPng = 41,
34 GridPointDataCcsdsRecommendedLosslessCompression = 42,
35 SpectralDataSimplePacking = 50,
36 SpectralDataComplexPacking = 51,
37 SpectralDataForLimitedAreaModelsComplexPacking = 53,
38 GridPointDataSimplePackingWithLogarithmPreProcessing = 61,
39 RunLengthPackingWithLevelValues = 200,
40 GridPointDataJpeg2000CodeStreamFormatAndSpatialDifferencing = 40000,
41 Missing = 65535,
42}
43impl From<u16> for Grib2Table5_0 {
44 fn from(val: u16) -> Self {
45 match val {
46 0 => Self::GridPointDataSimplePacking,
47 1 => Self::MatrixValueAtGridPointSimplePacking,
48 2 => Self::GridPointDataComplexPacking,
49 3 => Self::GridPointDataComplexPackingAndSpatialDifferencing,
50 4 => Self::GridPointDataIeeeFloatingPointData,
51 40 => Self::GridPointDataJpeg2000CodeStreamFormat,
52 41 => Self::GridPointDataPortableNetworkGraphicsPng,
53 42 => Self::GridPointDataCcsdsRecommendedLosslessCompression,
54 50 => Self::SpectralDataSimplePacking,
55 51 => Self::SpectralDataComplexPacking,
56 53 => Self::SpectralDataForLimitedAreaModelsComplexPacking,
57 61 => Self::GridPointDataSimplePackingWithLogarithmPreProcessing,
58 200 => Self::RunLengthPackingWithLevelValues,
59 40000 => Self::GridPointDataJpeg2000CodeStreamFormatAndSpatialDifferencing,
60 _ => Self::Missing,
61 }
62 }
63}
64impl core::fmt::Display for Grib2Table5_0 {
65 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
66 let desc = match self {
67 Self::GridPointDataSimplePacking => {
68 "Grid Point Data - Simple Packing (see Template 5.0)"
69 }
70 Self::MatrixValueAtGridPointSimplePacking => {
71 "Matrix Value at Grid Point - Simple Packing (see Template 5.1)"
72 }
73 Self::GridPointDataComplexPacking => {
74 "Grid Point Data - Complex Packing (see Template 5.2)"
75 }
76 Self::GridPointDataComplexPackingAndSpatialDifferencing => {
77 "Grid Point Data - Complex Packing and Spatial Differencing (see Template 5.3)"
78 }
79 Self::GridPointDataIeeeFloatingPointData => {
80 "Grid Point Data - IEEE Floating Point Data (see Template 5.4)"
81 }
82 Self::GridPointDataJpeg2000CodeStreamFormat => {
83 "Grid point data - JPEG 2000 code stream format (see Template 5.40)"
84 }
85 Self::GridPointDataPortableNetworkGraphicsPng => {
86 "Grid point data - Portable Network Graphics (PNG) (see Template 5.41)"
87 }
88 Self::GridPointDataCcsdsRecommendedLosslessCompression => {
89 "Grid point data - CCSDS recommended lossless compression (see Template 5.42)"
90 }
91 Self::SpectralDataSimplePacking => "Spectral Data - Simple Packing (see Template 5.50)",
92 Self::SpectralDataComplexPacking => {
93 "Spectral Data - Complex Packing (see Template 5.51)"
94 }
95 Self::SpectralDataForLimitedAreaModelsComplexPacking => {
96 "Spectral data for limited area models - complex packing (see Template 5.53)"
97 }
98 Self::GridPointDataSimplePackingWithLogarithmPreProcessing => {
99 "Grid Point Data - Simple Packing With Logarithm Pre-processing (see Template 5.61)"
100 }
101 Self::RunLengthPackingWithLevelValues => {
102 "Run Length Packing With Level Values (see Template 5.200)"
103 }
104 Self::GridPointDataJpeg2000CodeStreamFormatAndSpatialDifferencing => {
105 "Grid point data - JPEG 2000 code stream format and spatial differencing (see \
106 Template 5.40000)"
107 }
108 Self::Missing => "Missing",
109 };
110 f.write_str(desc)
111 }
112}
113
114#[repr(u8)]
126#[allow(missing_docs)]
127#[derive(Debug, Clone, Copy, PartialEq, Eq)]
128pub enum Grib2Table5_1 {
129 FloatingPoint = 0,
130 Integer = 1,
131 Missing = 255,
132}
133impl From<u8> for Grib2Table5_1 {
134 fn from(val: u8) -> Self {
135 match val {
136 0 => Self::FloatingPoint,
137 1 => Self::Integer,
138 _ => Self::Missing,
139 }
140 }
141}
142impl core::fmt::Display for Grib2Table5_1 {
143 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
144 let desc = match self {
145 Self::FloatingPoint => "Floating Point",
146 Self::Integer => "Integer",
147 Self::Missing => "Missing",
148 };
149 f.write_str(desc)
150 }
151}
152
153#[repr(u8)]
166#[allow(missing_docs)]
167#[derive(Debug, Clone, Copy, PartialEq, Eq)]
168pub enum Grib2Table5_2 {
169 ExplicitCoordinateValuesSet = 0,
170 LinearCoordinates = 1,
171 GeometricCoordinates = 11,
172 Missing = 255,
173}
174impl From<u8> for Grib2Table5_2 {
175 fn from(val: u8) -> Self {
176 match val {
177 0 => Self::ExplicitCoordinateValuesSet,
178 1 => Self::LinearCoordinates,
179 11 => Self::GeometricCoordinates,
180 _ => Self::Missing,
181 }
182 }
183}
184impl core::fmt::Display for Grib2Table5_2 {
185 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
186 let desc = match self {
187 Self::ExplicitCoordinateValuesSet => "Explicit Coordinate Values Set",
188 Self::LinearCoordinates => "Linear Coordinates: f(1) = C1, f(n) = f(n-1) + C2",
189 Self::GeometricCoordinates => "Geometric Coordinates: f(1) = C1, f(n) = C2 x f(n-1)",
190 Self::Missing => "Missing",
191 };
192 f.write_str(desc)
193 }
194}
195
196#[repr(u8)]
208#[allow(missing_docs)]
209#[derive(Debug, Clone, Copy, PartialEq, Eq)]
210pub enum Grib2Table5_3 {
211 DirectionDegreesTrue = 1,
212 FrequencyS1 = 2,
213 RadialNumber2piLambdaM1 = 3,
214 Missing = 255,
215}
216impl From<u8> for Grib2Table5_3 {
217 fn from(val: u8) -> Self {
218 match val {
219 1 => Self::DirectionDegreesTrue,
220 2 => Self::FrequencyS1,
221 3 => Self::RadialNumber2piLambdaM1,
222 _ => Self::Missing,
223 }
224 }
225}
226impl core::fmt::Display for Grib2Table5_3 {
227 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
228 let desc = match self {
229 Self::DirectionDegreesTrue => "Direction Degrees True",
230 Self::FrequencyS1 => "Frequency (s-1)",
231 Self::RadialNumber2piLambdaM1 => "Radial Number (2pi/lambda) (m-1)",
232 Self::Missing => "Missing",
233 };
234 f.write_str(desc)
235 }
236}
237
238#[repr(u8)]
250#[allow(missing_docs)]
251#[derive(Debug, Clone, Copy, PartialEq, Eq)]
252pub enum Grib2Table5_4 {
253 RowByRowSplitting = 0,
254 GeneralGroupSplitting = 1,
255 Missing = 255,
256}
257impl From<u8> for Grib2Table5_4 {
258 fn from(val: u8) -> Self {
259 match val {
260 0 => Self::RowByRowSplitting,
261 1 => Self::GeneralGroupSplitting,
262 _ => Self::Missing,
263 }
264 }
265}
266impl core::fmt::Display for Grib2Table5_4 {
267 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
268 let desc = match self {
269 Self::RowByRowSplitting => "Row by Row Splitting",
270 Self::GeneralGroupSplitting => "General Group Splitting",
271 Self::Missing => "Missing",
272 };
273 f.write_str(desc)
274 }
275}
276
277#[repr(u8)]
289#[allow(missing_docs)]
290#[derive(Debug, Clone, Copy, PartialEq, Eq)]
291pub enum Grib2Table5_5 {
292 NoExplicitMissingValues = 0,
293 PrimaryMissingValuesIncluded = 1,
294 PrimaryAndSecondaryMissingValuesIncluded = 2,
295 Missing = 255,
296}
297impl From<u8> for Grib2Table5_5 {
298 fn from(val: u8) -> Self {
299 match val {
300 0 => Self::NoExplicitMissingValues,
301 1 => Self::PrimaryMissingValuesIncluded,
302 2 => Self::PrimaryAndSecondaryMissingValuesIncluded,
303 _ => Self::Missing,
304 }
305 }
306}
307impl core::fmt::Display for Grib2Table5_5 {
308 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
309 let desc = match self {
310 Self::NoExplicitMissingValues => {
311 "No explicit missing values included within the data values"
312 }
313 Self::PrimaryMissingValuesIncluded => {
314 "Primary missing values included within the data values"
315 }
316 Self::PrimaryAndSecondaryMissingValuesIncluded => {
317 "Primary and secondary missing values included within the data values"
318 }
319 Self::Missing => "Missing",
320 };
321 f.write_str(desc)
322 }
323}
324
325#[repr(u8)]
337#[allow(missing_docs)]
338#[derive(Debug, Clone, Copy, PartialEq, Eq)]
339pub enum Grib2Table5_6 {
340 FirstOrderSpatialDifferencing = 1,
341 SecondOrderSpatialDifferencing = 2,
342 Missing = 255,
343}
344impl From<u8> for Grib2Table5_6 {
345 fn from(val: u8) -> Self {
346 match val {
347 1 => Self::FirstOrderSpatialDifferencing,
348 2 => Self::SecondOrderSpatialDifferencing,
349 _ => Self::Missing,
350 }
351 }
352}
353impl core::fmt::Display for Grib2Table5_6 {
354 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
355 let desc = match self {
356 Self::FirstOrderSpatialDifferencing => "First-Order Spatial Differencing",
357 Self::SecondOrderSpatialDifferencing => "Second-Order Spatial Differencing",
358 Self::Missing => "Missing",
359 };
360 f.write_str(desc)
361 }
362}
363
364#[repr(u8)]
375#[allow(missing_docs)]
376#[derive(Debug, Clone, Copy, PartialEq, Eq)]
377pub enum Grib2Table5_7 {
378 Ieee32Bit = 1,
379 Ieee64Bit = 2,
380 Ieee128Bit = 3,
381 Missing = 255,
382}
383impl From<u8> for Grib2Table5_7 {
384 fn from(val: u8) -> Self {
385 match val {
386 1 => Self::Ieee32Bit,
387 2 => Self::Ieee64Bit,
388 3 => Self::Ieee128Bit,
389 _ => Self::Missing,
390 }
391 }
392}
393impl core::fmt::Display for Grib2Table5_7 {
394 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
395 let desc = match self {
396 Self::Ieee32Bit => "IEEE 32-bit (I=4 in Section 7)",
397 Self::Ieee64Bit => "IEEE 64-bit (I=8 in Section 7)",
398 Self::Ieee128Bit => "IEEE 128-bit (I=16 in Section 7)",
399 Self::Missing => "Missing",
400 };
401 f.write_str(desc)
402 }
403}
404
405#[repr(u8)]
419#[allow(missing_docs)]
420#[derive(Debug, Clone, Copy, PartialEq, Eq)]
421pub enum Grib2Table5_25 {
422 Rectangular = 77,
423 Elliptic = 88,
424 Diamond = 99,
425 Missing = 255,
426}
427impl From<u8> for Grib2Table5_25 {
428 fn from(val: u8) -> Self {
429 match val {
430 77 => Self::Rectangular,
431 88 => Self::Elliptic,
432 99 => Self::Diamond,
433 _ => Self::Missing,
434 }
435 }
436}
437impl core::fmt::Display for Grib2Table5_25 {
438 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
439 let desc = match self {
440 Self::Rectangular => "Rectangular",
441 Self::Elliptic => "Elliptic",
442 Self::Diamond => "Diamond",
443 Self::Missing => "Missing",
444 };
445 f.write_str(desc)
446 }
447}
448
449#[repr(u8)]
460#[allow(missing_docs)]
461#[derive(Debug, Clone, Copy, PartialEq, Eq)]
462pub enum Grib2Table5_26 {
463 SpectralCoefficientsForAxesArePacked = 0,
464 SpectralCoefficientsForAxesIncludedInUnpackedSubset = 1,
465 Missing = 255,
466}
467impl From<u8> for Grib2Table5_26 {
468 fn from(val: u8) -> Self {
469 match val {
470 0 => Self::SpectralCoefficientsForAxesArePacked,
471 1 => Self::SpectralCoefficientsForAxesIncludedInUnpackedSubset,
472 _ => Self::Missing,
473 }
474 }
475}
476impl core::fmt::Display for Grib2Table5_26 {
477 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
478 let desc = match self {
479 Self::SpectralCoefficientsForAxesArePacked => {
480 "Spectral coefficients for axes are packed"
481 }
482 Self::SpectralCoefficientsForAxesIncludedInUnpackedSubset => {
483 "Spectral coefficients for axes included in the unpacked subset"
484 }
485 Self::Missing => "Missing",
486 };
487 f.write_str(desc)
488 }
489}
490
491#[repr(u8)]
502#[allow(missing_docs)]
503#[derive(Debug, Clone, Copy, PartialEq, Eq)]
504pub enum Grib2Table5_40 {
505 Lossless = 0,
506 Lossy = 1,
507 Missing = 255,
508}
509impl From<u8> for Grib2Table5_40 {
510 fn from(val: u8) -> Self {
511 match val {
512 0 => Self::Lossless,
513 1 => Self::Lossy,
514 _ => Self::Missing,
515 }
516 }
517}
518impl core::fmt::Display for Grib2Table5_40 {
519 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
520 let desc = match self {
521 Self::Lossless => "Lossless",
522 Self::Lossy => "Lossy",
523 Self::Missing => "Missing",
524 };
525 f.write_str(desc)
526 }
527}