#[non_exhaustive]pub struct OpenMeteoProfile {
pub latitude_deg: f64,
pub longitude_deg: f64,
pub time_unix_s: i64,
pub hours: Vec<(i64, f64)>,
pub surface: OpenMeteoSurface,
pub levels: Vec<OpenMeteoLevel>,
pub dropped: Vec<DroppedLevel>,
}Expand description
An Open-Meteo response read at one time: the surface and the pressure levels above it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.latitude_deg: f64The model grid point’s latitude, degrees north (near the one asked for).
longitude_deg: f64The model grid point’s longitude, degrees east.
time_unix_s: i64The time read, seconds since the Unix epoch (UTC).
hours: Vec<(i64, f64)>The hours interpolated between, with their weights, which sum to 1. One hour, weight 1, when the time is on the hour.
surface: OpenMeteoSurfaceThe ground.
levels: Vec<OpenMeteoLevel>The pressure levels above the ground, lowest first.
dropped: Vec<DroppedLevel>The pressure levels left out, highest pressure first.
Implementations§
Source§impl OpenMeteoProfile
impl OpenMeteoProfile
Sourcepub fn parse(body: &[u8], time_unix_s: i64) -> Result<Self, OpenMeteoError>
pub fn parse(body: &[u8], time_unix_s: i64) -> Result<Self, OpenMeteoError>
Reads an Open-Meteo response at time_unix_s, interpolating linearly between the hours
around it.
§Errors
OpenMeteoError::Jsonwhen the body is not JSON,OpenMeteoError::Serverwhen it is Open-Meteo’s error answer.OpenMeteoError::Missingwhen a field or a variable asked for is absent, andOpenMeteoError::Unitswhen a variable is in a unit other than the one asked for.OpenMeteoError::TimeOutsidewhen the time is outside the response’s hours.OpenMeteoError::NoSurfacewhen a surface value is missing at either hour, andOpenMeteoError::OutOfRangewhen the surface humidity is outside 0 to 100%.OpenMeteoError::Atmoswhen a geopotential height has no geometric height.
Sourcepub fn sounding(
&self,
wind_interpolation: WindInterpolation,
) -> Result<SoundingProfile, AtmosError>
pub fn sounding( &self, wind_interpolation: WindInterpolation, ) -> Result<SoundingProfile, AtmosError>
The profile as an atmosphere with its wind: the surface, then each level above it, every one with its pressure, temperature, relative humidity and wind.
§Errors
What SoundingProfile::new refuses: heights not increasing, pressures not decreasing
upward, or a value out of range (such as a relative humidity above 100%).
Trait Implementations§
Source§impl Clone for OpenMeteoProfile
impl Clone for OpenMeteoProfile
Source§fn clone(&self) -> OpenMeteoProfile
fn clone(&self) -> OpenMeteoProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenMeteoProfile
impl Debug for OpenMeteoProfile
Source§impl<'de> Deserialize<'de> for OpenMeteoProfile
impl<'de> Deserialize<'de> for OpenMeteoProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OpenMeteoProfile
impl PartialEq for OpenMeteoProfile
Source§fn eq(&self, other: &OpenMeteoProfile) -> bool
fn eq(&self, other: &OpenMeteoProfile) -> bool
self and other values to be equal, and is used by ==.