Module truing_wind

Module truing_wind 

Source
Expand description

MBA-1392: back-solve the effective crosswind from an observed horizontal miss.

The rest of the truing family fits muzzle velocity and BC from VERTICAL drop. This module fits the other axis: given where a group actually landed left/right of the aim point, it reports the constant crosswind that reproduces that miss through the real forward model — the number a shooter compares against the wind they called, so their wind calls can be calibrated instead of guessed at.

§Sign conventions (the whole set, in one place)

  • Observed miss (WindObservation::miss_right_m, CLI --miss): signed, POSITIVE = the group landed RIGHT of the aim point.
  • Solved crosswind (WindTruingSolution::solved_crosswind_mph): signed, and the sign follows the deflection it produces — POSITIVE = a wind FROM the shooter’s LEFT (9 o’clock) that pushes impacts RIGHT; NEGATIVE = a wind FROM the shooter’s RIGHT (3 o’clock) pushing impacts LEFT. It is a full-value crosswind (a 90-degree wind), not a half-value component of some other bearing.
  • That maps onto the engine’s wind-FROM convention (crate::wind::wind_vector, 0 = headwind, PI/2 = from the right, 3*PI/2 = from the left) — the convention established by the 0.19.0 wind-direction sign fix, which flipped 0 from tailwind to headwind. A positive solved crosswind is therefore direction 3*PI/2.
  • Twist (crate::truing::TruingTwist::right_hand): a right-hand twist drifts RIGHT (positive lateral), a left-hand twist drifts LEFT.
  • Shot azimuth (crate::truing::TruingEarthFrame::shot_azimuth_deg): compass bearing fired ALONG, 0 = North, 90 = East.

§What the solved wind actually contains

A horizontal miss is not purely wind. Spin drift is always modelled here (a twist rate is required, precisely so it can be), and Coriolis is modelled when a latitude and shot azimuth are supplied. Anything the model was not given data for stays ABSORBED in the solved crosswind, and the report says so (WindTruingReport::unsubtracted_effects) rather than quietly presenting a contaminated number as pure wind.

§No scope-tracking correction

--miss values are LINEAR measurements off the target (inches), not dial readings, so the MBA-1358 tracking correction factor does NOT apply to them — only DIALED observations are CF-converted. This module deliberately has no CF input.

Structs§

WindIntervalV1
A two-sided interval on the combined crosswind, plus both estimates behind it.
WindObservation
A single observed horizontal miss used to back-solve effective wind (MBA-1392).
WindTruingReport
The complete wind-truing result: one fit per observation plus the combined answer.
WindTruingRequest
Everything the wind fit needs: the observed misses plus the load, rifle, atmosphere and the opt-in earth frame (MBA-1392).
WindTruingSolution
The wind fitted from ONE observed miss (MBA-1392).
WindUncertaintyFailureV1
Structured explanation for an absent interval, mirroring true.fit’s failure shape.

Enums§

WindTruingOutput
Which rendering format_wind_truing_report should produce. Front-end-agnostic so the native CLI’s OutputFormat and the WASM terminal’s --output string map onto ONE formatter and cannot drift apart.
WindUncertaintyBasisV1
Which of the two independent uncertainty estimates set the reported interval.
WindUncertaintyFailureCodeV1
Why no interval could be produced.
WindUncertaintyV1
The interval, or a structured reason there is not one.

Constants§

MAX_SOLVABLE_CROSSWIND_MPH
Widest crosswind the solver will bracket, in mph (signed, so the bracket is -100..=+100). Comfortably past any wind a rifle shooter reports; a miss that needs more than this is a data-entry or sign error, not a wind call, and is rejected with a diagnostic rather than solved into a fantasy number.
MIN_WIND_SENSITIVITY_IN_PER_MPH
Guide value for the wind-truing validity note: below this many inches of lateral movement per mph of crosswind, the observation barely constrains the wind and the number solved from it is weakly identified. Same spirit as the MV-calibration window (MBA-1405) — a stated band the report checks each observation against, not a hard gate.
MPH_TO_MPS
Miles per hour to meters per second (exact, by definition of the international mile). pub so the front ends convert --called-wind with the same factor this module renders with, rather than each re-typing the literal.
WIND_SOLVE_TOLERANCE_M
Convergence tolerance on the modelled-minus-observed lateral miss, in meters (0.01 mm — four orders of magnitude finer than anyone can measure a group centre). pub because it is the published meaning of a converged WindTruingSolution::residual_m.

Functions§

format_wind_truing_report
Render a WindTruingReport (MBA-1392).
modeled_miss_right_m
The FORWARD direction of solve_wind_truing: the lateral miss (meters, positive = right of the line of sight) this request’s load / atmosphere / twist / earth frame predicts at range_m under a signed crosswind_mph (MBA-1392).
parse_wind_observation
Parse a --miss RANGE:RIGHT[:SIGMA] token.
solve_wind_truing
Back-solve the effective crosswind from every observed miss in request (MBA-1392).
wind_truing_json_value
The wind-truing report as a JSON document (MBA-1392).