1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Profile {
Pressure,
Temperature,
WetBulb,
DewPoint,
ThetaE,
WindDirection,
WindSpeed,
PressureVerticalVelocity,
GeopotentialHeight,
CloudFraction,
}
impl fmt::Display for Profile {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
use Profile::*;
let string_rep = match *self {
Pressure => "pressure",
Temperature => "temperature",
WetBulb => "wet bulb temperature",
DewPoint => "dew point temperature",
ThetaE => "equivalent potential temperature",
WindDirection => "wind direction",
WindSpeed => "wind speed",
PressureVerticalVelocity => "vertical velocity",
GeopotentialHeight => "height",
CloudFraction => "cloud fraction",
};
write!(f, "{}", string_rep)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Surface {
MSLP,
StationPressure,
LowCloud,
MidCloud,
HighCloud,
WindDirection,
WindSpeed,
Temperature,
DewPoint,
Precipitation,
}
impl fmt::Display for Surface {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
use Surface::*;
let string_rep = match *self {
MSLP => "sea level pressure",
StationPressure => "station pressure",
LowCloud => "low cloud fraction",
MidCloud => "mid cloud fraction",
HighCloud => "high cloud fraction",
WindDirection => "wind direction",
WindSpeed => "wind speed",
Temperature => "2-meter temperature",
DewPoint => "2-meter dew point",
Precipitation => "precipitation (liquid equivalent)",
};
write!(f, "{}", string_rep)
}
}