pub struct HeightOffset<F> { /* private fields */ }Expand description
Reads a field at a shifted height, so a field and its caller can use different height
datums: wind(t, p) is the inner field’s wind at p.y + offset_m, with time and the
horizontal position unchanged.
offset_m is the height of the caller’s y = 0 in the field’s datum. Convert in one place
only: wrapping twice, or also shifting a profile’s levels, moves every wind by the offset
again. The usual cases:
- y is height above sea level, as in rockets-engine: a
LogProfileorEkmanProfile, which measure height from the ground, takes-the ground elevation. A soundingProfileFieldin metres above sea level needs no wrapper there. - y = 0 is the ground at elevation
E: a sea-level soundingProfileFieldtakes+E. - this crate’s
TrajectorySolver, whose y = 0 is the levelmuzzle_heightis measured from and whose ground runs along the line of sight: itsground_thresholdcheck and its built-in boundary-layer shear (seecrate::wind_shear) both take the shot-frame y as the height. So aLogProfileorEkmanProfiletakes the bore’s real height above the ground minusmuzzle_heighton a level or an inclined shot alike: 0 whenmuzzle_heightis that real height, the real height whenmuzzle_heightis left at 0, asBallisticInputs::default()leaves it. Sea level stays level, so a sea-level sounding takes+theAtmosphericConditions::altitudeon a level shot, where the solver’s own air puts y = 0. On an inclined shot (shooting angle θ) no constant offset fits: read the sounding at the altitude the solver’s air uses,altitude + x·sin θ + y·cos θ. Fields return winds in level axes; rotate them into the shot frame before comparing them with solver output.
Elevations are those of the place the positions are, not of the station that measured a sounding.
Implementations§
Source§impl<F> HeightOffset<F>
impl<F> HeightOffset<F>
Sourcepub fn new(field: F, offset_m: f64) -> Result<HeightOffset<F>, WindFieldError>
pub fn new(field: F, offset_m: f64) -> Result<HeightOffset<F>, WindFieldError>
Wrap field so it is read offset_m metres higher. The offset must be finite.
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Unwrap the field.
Trait Implementations§
Source§impl<F> Clone for HeightOffset<F>where
F: Clone,
impl<F> Clone for HeightOffset<F>where
F: Clone,
Source§fn clone(&self) -> HeightOffset<F>
fn clone(&self) -> HeightOffset<F>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<F> Copy for HeightOffset<F>where
F: Copy,
Source§impl<F> Debug for HeightOffset<F>where
F: Debug,
impl<F> Debug for HeightOffset<F>where
F: Debug,
Source§impl<F> PartialEq for HeightOffset<F>where
F: PartialEq,
impl<F> PartialEq for HeightOffset<F>where
F: PartialEq,
impl<F> StructuralPartialEq for HeightOffset<F>where
F: PartialEq,
Auto Trait Implementations§
impl<F> Freeze for HeightOffset<F>where
F: Freeze,
impl<F> RefUnwindSafe for HeightOffset<F>where
F: RefUnwindSafe,
impl<F> Send for HeightOffset<F>where
F: Send,
impl<F> Sync for HeightOffset<F>where
F: Sync,
impl<F> Unpin for HeightOffset<F>where
F: Unpin,
impl<F> UnsafeUnpin for HeightOffset<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for HeightOffset<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.