Skip to main content

spacelab_earthvision/
lib.rs

1//! **earthvision** — Earth-observation foundations, the first Phase-8 line.
2//!
3//! Two building blocks that sit under every optical remote-sensing pipeline:
4//!
5//! - [`observation_geometry`] — the sun/sensor angles (solar and view zenith, relative azimuth,
6//!   scattering angle, air mass) that drive atmospheric correction and surface-BRDF inversion. The
7//!   satellite tells you *where* it looked; these tell you *how the light arrived*.
8//! - [`monte_carlo_slab`] — a photon Monte Carlo of radiative transfer through a plane-parallel
9//!   scattering-and-absorbing atmosphere (Marchuk's method), returning the layer's reflectance,
10//!   transmittance and absorptance. This is the path-radiance / atmospheric-correction core: what
11//!   fraction of sunlight is scattered back to space, reaches the surface, or is absorbed. What a
12//!   scattering event does is a [`PhaseFunction`] — analytic, or tabulated from [`mie`] theory or an
13//!   [`ice`]-crystal ray trace, which is what lets cirrus scatter like cirrus rather than like a
14//!   one-parameter fit with no halo in it. Those three are flux fractions, over the whole hemisphere;
15//!   [`path_reflectance`] is the same layer seen down one line of sight, by next-event estimation —
16//!   which is what a sensor measures, and what the 6S path-reflectance term means.
17//! - [`swath_geometry`] — the sensor's ground reach: from an off-nadir look angle, the Earth-central
18//!   angle, elevation, ground and slant ranges of the footprint edge, with [`ground_point_at`] to
19//!   trace footprint circles and ground tracks. The *where it looked* the two above take as given.
20//!
21//! `no_std` + `libm`, deterministic (a seeded `xoshiro256**` stream), no external dependencies.
22
23#![cfg_attr(not(any(test, feature = "onnx")), no_std)]
24
25extern crate alloc;
26
27pub mod atmospheric_correction;
28pub mod camera;
29pub mod features;
30pub mod gas;
31pub mod geometry;
32pub mod ice;
33pub mod image_quality;
34pub mod mie;
35pub mod mvs;
36pub mod ortho;
37pub mod pansharpen;
38pub mod phase;
39pub mod radiative_transfer;
40pub mod rpc;
41pub mod rpc_adjust;
42pub mod sfm;
43pub mod stereo;
44pub mod swath;
45
46#[cfg(feature = "onnx")]
47pub mod cloud;
48
49pub use atmospheric_correction::{
50    AtmosphericCoupling, CorrelatedKCoupling, brdf_reflectance, correlated_k_coupling,
51    coupling_from_slab, coupling_from_stack, li_sparse_reciprocal_kernel, ross_thick_kernel,
52};
53pub use camera::{
54    Observation, OutlierScale, PinholeCamera, bundle_adjust, bundle_adjust_robust,
55    ransac_resection, resection, triangulate,
56};
57pub use features::{
58    Corner, FeatureMatch, HarrisConfig, Image, NccConfig, detect_corners, harris_response,
59    match_ncc,
60};
61pub use gas::{GasError, KDistribution, gas_optical_depths, gas_optical_depths_binned};
62pub use geometry::{ObservationGeometry, air_mass, observation_geometry};
63pub use ice::{
64    GeometricOptics, HexagonalCrystal, MAX_LOBE_PANELS, RayTracingOptics, add_diffraction,
65    diffraction_on_grid, trace_on_grid,
66};
67pub use mie::{BulkOptics, Complex, SizeDistribution};
68pub use mvs::plane_sweep_mvs;
69pub use ortho::{
70    DemGrid, MapGrid, SourceTile, orthorectify, orthorectify_point, ray_dem_intersection,
71    sample_bilinear,
72};
73pub use pansharpen::{brovey_pan_sharpen, gram_schmidt_pan_sharpen};
74pub use phase::{PhaseError, PhaseFunction, TabulatedPhase, tabulate_legendre, tabulate_mie};
75pub use radiative_transfer::{
76    Atmosphere, Layer, MAX_LAYERS, SlabResult, monte_carlo_slab, monte_carlo_stack,
77    path_reflectance, stack_path_reflectance,
78};
79pub use rpc::{GroundPoint, InverseError, RationalPolynomialCamera};
80pub use rpc_adjust::{
81    AdjustmentModel, GroundControlPoint, RpcAdjustment, adjustment_residual_rms,
82    estimate_adjustment, forward_adjusted,
83};
84pub use sfm::{Observation2d, Track, build_tracks, triangulate_tracks};
85pub use stereo::{
86    DIRECTIONS_4, DIRECTIONS_8, SgmConfig, aggregate_sgm, census_cost_volume, depth_from_disparity,
87    disparity_wta, semi_global_match,
88};
89pub use swath::{SwathGeometry, ground_point_at, horizon_look_angle, swath_geometry};
90
91#[cfg(feature = "onnx")]
92pub use cloud::{CloudMasker, Footprint, OnnxError, SwathLine, usable_footprints};