#[non_exhaustive]pub struct NomadsRequest {
pub latitude_deg: f64,
pub longitude_deg: f64,
pub model: NomadsModel,
pub cycle_unix_s: i64,
pub forecast_hour: u32,
pub endpoint: Option<String>,
}Expand description
What to ask NOMADS for: a model’s run, a forecast hour and a site.
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 site’s latitude, degrees north, in [-90, 90].
longitude_deg: f64The site’s longitude, degrees east, in [-180, 180].
model: NomadsModelThe model.
cycle_unix_s: i64The run’s start (its cycle), seconds since the Unix epoch (UTC): a whole multiple of
NomadsModel::cycle_hours, from 1970 to the year 9999.
forecast_hour: u32Hours after the cycle, one the run has (NomadsModel::has_forecast_hour).
endpoint: Option<String>Another server’s address in place of ENDPOINT, such as a mirror; None for NOMADS.
It must hold no ? or #.
Implementations§
Source§impl NomadsRequest
impl NomadsRequest
Sourcepub fn new(
latitude_deg: f64,
longitude_deg: f64,
model: NomadsModel,
cycle_unix_s: i64,
forecast_hour: u32,
) -> Self
pub fn new( latitude_deg: f64, longitude_deg: f64, model: NomadsModel, cycle_unix_s: i64, forecast_hour: u32, ) -> Self
A request to NOMADS.
Sourcepub fn valid_unix_s(&self) -> i64
pub fn valid_unix_s(&self) -> i64
The time the forecast is for, the cycle plus the forecast hour, s since the Unix epoch.
Sourcepub fn url(&self) -> Result<String, NomadsError>
pub fn url(&self) -> Result<String, NomadsError>
The grib filter’s URL for the cut.
The URL is the cache key. It holds no coordinate of the site itself, only the box’s edges,
0.3° each way from the site, to hundredths of a degree. Each edge is worked out
from the site written to 5 decimals, as crate::elevation writes it, and rounded to
hundredths in decimal, halves away from zero, so a site given to 8 decimals or fewer and
rebuilt from radians (−106.91° can come back as −106.91000000000001) asks for the same box
and finds its saved answer. The rounding moves an edge by at most 0.005° (the 5-decimal
step adds under 1e-5°), so the box still reaches more than 0.29° each way, over a GFS cell.
The cut is interpolated at the site as given, not as rounded.
§Errors
NomadsError::Request when a field is outside the range its doc gives.
Trait Implementations§
Source§impl Clone for NomadsRequest
impl Clone for NomadsRequest
Source§fn clone(&self) -> NomadsRequest
fn clone(&self) -> NomadsRequest
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 NomadsRequest
impl Debug for NomadsRequest
Source§impl<'de> Deserialize<'de> for NomadsRequest
impl<'de> Deserialize<'de> for NomadsRequest
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 NomadsRequest
impl PartialEq for NomadsRequest
Source§fn eq(&self, other: &NomadsRequest) -> bool
fn eq(&self, other: &NomadsRequest) -> bool
self and other values to be equal, and is used by ==.