Skip to main content

grib/def/grib2/
table1.rs

1use grib_template_derive::{CodeTable, Dump, TryFromSlice, WriteToBuffer};
2
3#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
4#[code_table(file = "def/CCT/C11.csv", format = wmo_cct_c11)]
5#[dump(code_table)]
6pub struct CentreId(
7    /// Identification of originating/generating centre (see Common Code table
8    /// C-11).
9    pub u16,
10);
11
12#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump)]
13pub struct SubcentreId(
14    /// Identification of originating/generating subcentre (allocated by
15    /// originating/generating centre).
16    pub u16,
17);
18
19#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
20#[code_table(file = "def/CCT/C00.csv", format = wmo_cct_c00)]
21#[dump(code_table)]
22pub struct MasterTableVer(
23    /// GRIB master table version number (see Common Code table C-0 and Note 1).
24    pub u8,
25);
26
27#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
28#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_1_CodeTable_en.csv", format = wmo_grib2_tables)]
29#[dump(code_table)]
30pub struct LocalTableVer(
31    /// Version number of GRIB Local tables used to augment Master tables (see
32    /// Code table 1.1 and Note 2).
33    pub u8,
34);
35
36#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
37#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_2_CodeTable_en.csv", format = wmo_grib2_tables)]
38#[dump(code_table)]
39pub struct RefTimeSignificance(
40    /// Significance of reference time (see Code table 1.2).
41    pub u8,
42);
43
44crate::helpers::code_labels! {
45    impl RefTimeSignificance {
46        /// Analysis.
47        Analysis = 0,
48        /// Start of forecast.
49        StartOfForecast = 1,
50        /// Verifying time of forecast.
51        VerifyingTimeOfForecast = 2,
52        /// Observation time.
53        ObservationTime = 3,
54        /// Local time.
55        LocalTime = 4,
56        /// Simulation start.
57        SimulationStart = 5,
58    }
59}
60
61#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
62#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_3_CodeTable_en.csv", format = wmo_grib2_tables)]
63#[dump(code_table)]
64pub struct ProductionStatus(
65    /// Production status of processed data in this GRIB message (see Code table
66    /// 1.3).
67    pub u8,
68);
69
70#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
71#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_4_CodeTable_en.csv", format = wmo_grib2_tables)]
72#[dump(code_table)]
73pub struct ProcessedDataType(
74    /// Type of processed data in this GRIB message (see Code table 1.4).
75    pub u8,
76);
77
78#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
79#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_5_CodeTable_en.csv", format = wmo_grib2_tables)]
80#[dump(code_table)]
81pub struct IdentificationTemplateNum(
82    /// Identification template number (optional, see Code table 1.5).
83    pub u16,
84);
85
86#[derive(Debug, PartialEq, Eq, Clone, Copy, TryFromSlice, WriteToBuffer, Dump, CodeTable)]
87#[code_table(file = "def/GRIB2/GRIB2_CodeFlag_1_6_CodeTable_en.csv", format = wmo_grib2_tables)]
88#[dump(code_table)]
89pub struct CalendarType(
90    /// Type of calendar (see Code table 1.6).
91    pub u8,
92);