Skip to main content

AtmosphericConditions

Struct AtmosphericConditions 

Source
pub struct AtmosphericConditions {
    pub temperature: f64,
    pub pressure: f64,
    pub humidity: f64,
    pub altitude: f64,
}

Fields§

§temperature: f64§pressure: f64§humidity: f64

Relative 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: f64

Implementations§

Source§

impl AtmosphericConditions

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AtmosphericConditions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AtmosphericConditions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.