pub struct AtmosphericConditions {
pub temperature: f64,
pub pressure: f64,
pub humidity: f64,
pub altitude: f64,
}Fields§
§temperature: f64§pressure: f64§humidity: f64Relative humidity, PERCENT, 0..=100, the same unit as
BallisticInputs::humidity_percent. Default DEFAULT_HUMIDITY_PERCENT. A sensor
reading within crate::HUMIDITY_SENSOR_TOLERANCE_PERCENT of the range (101.7 in fog)
flies as the end it reads as; a value beyond that is refused by the solve.
altitude: f64Implementations§
Source§impl AtmosphericConditions
impl AtmosphericConditions
Sourcepub fn resolved_station(
&self,
presence: StationAtmospherePresence,
) -> (f64, f64)
pub fn resolved_station( &self, presence: StationAtmospherePresence, ) -> (f64, f64)
The station temperature (°C) and absolute pressure (hPa) a solve of these conditions
flies, after the presence rule: a reading presence marks as supplied flies as given,
an omitted default at a real altitude flies the ICAO standard value there.
Sourcepub fn station_air(
&self,
presence: StationAtmospherePresence,
) -> Result<StationAir, AtmosphereError>
pub fn station_air( &self, presence: StationAtmospherePresence, ) -> Result<StationAir, AtmosphereError>
The station air a solve of these conditions flies, built exactly as
TrajectorySolver builds it: the humidity through RelativeHumidity::try_percent,
the temperature and pressure through Self::resolved_station, the air through
StationAir::new.
For a surface that refuses air up front, before any work, in its own words
(AtmosphereError::refusal_in): whatever this refuses, every solve of these
conditions refuses, and whatever it accepts, a solve flies.
Sourcepub fn station_origin(
&self,
presence: StationAtmospherePresence,
) -> StationOrigin
pub fn station_origin( &self, presence: StationAtmospherePresence, ) -> StationOrigin
Where the station pressure a solve of these conditions flies comes from, by the
presence rule Self::resolved_station applies: the standard pressure at the altitude
when presence marks the pressure omitted and it is the sea-level default at a real
altitude, the reading otherwise (StationOrigin::resolving). These conditions hold a
station pressure, never a QNH, and the temperature is a reading: a caller that reduced a
QNH or flies a density altitude’s station states its own origin to
Self::air_refusal_from.
Sourcepub fn air_refusal_named(
&self,
presence: StationAtmospherePresence,
units: UnitSystem,
labels: [&str; 4],
) -> Option<AirRefusal>
pub fn air_refusal_named( &self, presence: StationAtmospherePresence, units: UnitSystem, labels: [&str; 4], ) -> Option<AirRefusal>
Self::air_refusal for a terminal (the native CLI, the browser terminal): every reading
is named by its flag, which is also its path (labels: humidity, temperature, pressure,
altitude, e.g. ["--humidity", "--temperature", "--pressure", "--altitude"], or where a
reading came from: --location CSV column TEMP, profile 'p' field pressure), the
humidity is the percent the command flies, and the station temperature, pressure and
every altitude are stated in the run’s units (°F, inHg and ft, or °C, hPa and m):
--humidity = 100 at 212 °F and 29.92 inHg: no such air exists: ...,
profile 'p' field pressure = -1 inHg: pressure must be greater than 0.
Sourcepub fn air_refusal_named_from(
&self,
presence: StationAtmospherePresence,
origin: StationOrigin,
units: UnitSystem,
labels: [&str; 4],
) -> Option<AirRefusal>
pub fn air_refusal_named_from( &self, presence: StationAtmospherePresence, origin: StationOrigin, units: UnitSystem, labels: [&str; 4], ) -> Option<AirRefusal>
Self::air_refusal_named for a terminal that resolved the station itself (a QNH
reduced, a density altitude’s derived triple) and so knows where its readings came from
better than presence can say: origin, which decides whether a station pressure outside
the troposphere is blamed on the pressure, the altitude or a density altitude, carries the
QNH as it was typed, and says whether a density altitude gave the temperature.
Sourcepub fn for_density_altitude_named(
density_altitude_m: f64,
explicit_temperature_c: Option<f64>,
humidity: f64,
units: UnitSystem,
labels: [&str; 4],
) -> Result<Self, AirRefusal>
pub fn for_density_altitude_named( density_altitude_m: f64, explicit_temperature_c: Option<f64>, humidity: f64, units: UnitSystem, labels: [&str; 4], ) -> Result<Self, AirRefusal>
The station a density altitude gives, as a terminal flies it, or its refusal in the
terminal’s words (crate::atmosphere::station_for_density_altitude, the one rule):
--density-altitude = 200000 ft: no air has this density altitude: ....
labels name the readings as Self::air_refusal_named’s do; a terminal that flies a
density altitude names its altitude (and its pressure) by the density altitude’s own
label, and its temperature too unless one was given (explicit_temperature_c, °C, the
temperature the density altitude is re-solved around). humidity is the percent the
station flies; the result is checked as any station is afterwards.
Sourcepub fn air_refusal(
&self,
presence: StationAtmospherePresence,
fields: [AirField<'_>; 4],
humidity_sent: f64,
units: AirUnits,
) -> Option<AirRefusal>
pub fn air_refusal( &self, presence: StationAtmospherePresence, fields: [AirField<'_>; 4], humidity_sent: f64, units: AirUnits, ) -> Option<AirRefusal>
Self::station_air refused in a surface’s words, or None when the air flies: every
reason a station is refused for (a humidity outside the sensor band, a temperature at or
below absolute zero, a pressure at or below 0, a reading that is not finite, air that
cannot exist), each at the reading to blame.
fields name the surface’s readings (humidity, temperature, pressure, altitude);
humidity_sent is the humidity as it was given there; units are the units the surface
states the resolved station temperature (°C), pressure (hPa) and every altitude in. Where
the pressure came from is Self::station_origin.
Sourcepub fn air_refusal_from(
&self,
presence: StationAtmospherePresence,
origin: StationOrigin,
fields: [AirField<'_>; 4],
humidity_sent: f64,
units: AirUnits,
) -> Option<AirRefusal>
pub fn air_refusal_from( &self, presence: StationAtmospherePresence, origin: StationOrigin, fields: [AirField<'_>; 4], humidity_sent: f64, units: AirUnits, ) -> Option<AirRefusal>
Self::air_refusal with the readings’ origin stated by a caller that resolved the
station itself (a QNH reduced, or a density altitude’s station, before these conditions
were built): a refusal names the QNH as it was given (StationOrigin::qnh_hpa, in
units), never the station pressure reduced from it as if it had been given, and a
temperature a density altitude gave as that density altitude’s.
A QNH that is itself no pressure (not finite, or at or below 0) is refused as the
reading it is, pressure = -1 inHg: pressure must be greater than 0, rather than as the
NaN it reduces to.
Trait Implementations§
Source§impl Clone for AtmosphericConditions
impl Clone for AtmosphericConditions
Source§impl Debug for AtmosphericConditions
impl Debug for AtmosphericConditions
Auto Trait Implementations§
impl Freeze for AtmosphericConditions
impl RefUnwindSafe for AtmosphericConditions
impl Send for AtmosphericConditions
impl Sync for AtmosphericConditions
impl Unpin for AtmosphericConditions
impl UnsafeUnpin for AtmosphericConditions
impl UnwindSafe for AtmosphericConditions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.