Skip to main content

Crate itu_rs

Crate itu_rs 

Source
Expand description

Selected ITU-R P-series atmospheric propagation models.

This crate is a Rust port of the subset of python-itu-r needed for Earth-space atmospheric attenuation on a slant path. It currently focuses on atmospheric_attenuation_slant_path and the recommendation data needed to compute gas, cloud, rain, scintillation, and total attenuation contributions.

§Data files

Model grids are loaded lazily on first use. In a repository checkout, the crate looks for data under data/ next to Cargo.toml.

§Automatic Data Download

For published package use, enable features = ["data"]. No runtime configuration is required: the build uses local data/ files when present, otherwise downloads and embeds the verified data archive.

The raw ITU-R grids are too large to include directly because crates.io limits .crate archive size.

§Manual Data Directory

If automatic data embedding is not suitable, set ITU_RS_DATA_DIR to a directory containing the python-itu-r itur/data layout. On Unix shells:

export ITU_RS_DATA_DIR=/path/to/ITU-Rpy/itur/data

On Windows PowerShell:

$env:ITU_RS_DATA_DIR = "C:\path\to\ITU-Rpy\itur\data"

The examples that depend on recommendation grids check whether data is available before calling the model. That keeps doctests useful in this repository, with features = ["data"], and in downstream builds that set ITU_RS_DATA_DIR.

§Conventions

Public APIs use plain f64 values and encode units in argument and return names:

  • _deg: degrees. lat_deg is geodetic latitude and must be in [-90, 90]. lon_deg is geodetic longitude; any finite degree value is accepted and map lookups wrap it internally.
  • _ghz: carrier frequency in gigahertz.
  • _km and _m: kilometres and metres. Site heights are above mean sea level unless the function says otherwise.
  • _hpa: pressure in hectopascals.
  • _gm3: density in grams per cubic metre.
  • _kgm2: columnar mass in kilograms per square metre.
  • _mmh: rainfall rate in millimetres per hour.
  • _db and _db_per_km: attenuation in decibels and specific attenuation in decibels per kilometre.
  • _k and _c: temperature in kelvin and degrees Celsius.

The p argument is a percentage of time exceeded, not a probability fraction. For example, 0.1 means 0.1% of an average year. Elevation angles are above the local horizon and must be in the open interval (0, 90).

§Example

use itu_rs::{atmospheric_attenuation_slant_path, SlantPathOptions};

let attenuation = atmospheric_attenuation_slant_path(
    45.4215,   // latitude, degrees
    -75.6972,  // longitude, degrees
    12.0,      // frequency, GHz
    30.0,      // elevation, degrees
    0.1,       // time percentage exceeded
    1.2,       // antenna diameter, m
    SlantPathOptions::default(),
)?;

assert!(attenuation.total_db.is_finite());

Structs§

ItuError
Error returned by ITU-R model loading, validation, and calculation routines.
SlantPathContributions
Atmospheric attenuation contribution breakdown in dB.
SlantPathOptions
Optional environmental and model inputs for slant-path attenuation.

Enums§

GasPathMode
Calculation mode for P.676 gaseous path attenuation.
HydrometeorType
Hydrometeor phase used by P.453 saturation vapour-pressure formulas.

Functions§

atmospheric_attenuation_slant_path
Computes total atmospheric attenuation for one Earth-space slant path.
atmospheric_attenuation_slant_path_many
Computes atmospheric attenuation for multiple elevation angles.
bicubic_2d_interpolate
Interpolates a regular P.1144 grid with bicubic interpolation.
bilinear_2d_interpolate
Interpolates a regular P.1144 grid with bilinear interpolation.
cloud_attenuation_db
Computes cloud attenuation from ITU-R P.840.
cloud_attenuation_lognormal_db
Computes cloud attenuation with the P.840 lognormal approximation.
cloud_liquid_mass_absorption_coefficient
Computes the P.840 cloud liquid-water mass absorption coefficient.
cloud_reduced_liquid_kgm2
Looks up reduced cloud liquid water content from ITU-R P.840.
cloud_specific_attenuation_coefficient
Computes the P.840 cloud specific attenuation coefficient.
dn1
Looks up the P.453 refractivity gradient exceeded over the lowest 1 km.
dn65
Looks up the P.453 refractivity gradient exceeded in the lowest 65 m.
dry_term_radio_refractivity
Computes dry-term radio refractivity from ITU-R P.453.
fit_rain_attenuation_to_lognormal
Fits P.618 rain attenuation statistics to a lognormal model.
gamma0_approx_db_per_km
Computes the P.676 dry-air approximate compatibility attenuation in dB/km.
gamma0_exact_db_per_km
Computes dry-air specific attenuation from ITU-R P.676 in dB/km.
gamma_exact_db_per_km
Computes total specific gaseous attenuation from ITU-R P.676 in dB/km.
gammaw_approx_db_per_km
Computes the P.676 water-vapour approximate specific attenuation in dB/km.
gammaw_exact_db_per_km
Computes water-vapour specific attenuation from ITU-R P.676 in dB/km.
gas_attenuation_default
Computes gas-only atmospheric attenuation for one elevation angle.
gas_attenuation_default_many
Computes gas-only atmospheric attenuation for multiple elevation angles.
gas_attenuation_default_many_checked
Computes gas-only atmospheric attenuation for multiple elevation angles.
gaseous_attenuation_inclined_path_db
Computes gaseous attenuation on an inclined path from ITU-R P.676.
gaseous_attenuation_slant_path_db
Computes gaseous attenuation on an Earth-space slant path from ITU-R P.676.
gaseous_attenuation_terrestrial_path_db
Computes gaseous attenuation on a terrestrial path from ITU-R P.676.
inter_annual_variability
Computes inter-annual variability from ITU-R P.678.
is_regular_grid
Tests whether latitude and longitude matrices describe a regular P.1144 grid.
lognormal_approximation_coefficients
Looks up P.840 lognormal cloud liquid-water distribution coefficients.
map_wet_term_radio_refractivity
Looks up wet-term radio refractivity maps from ITU-R P.453.
nearest_2d_interpolate
Interpolates a regular P.1144 grid with nearest-neighbour interpolation.
radio_refractive_index
Computes radio refractive index from ITU-R P.453.
rain_attenuation_db
Computes rain attenuation from ITU-R P.618.
rain_attenuation_probability_percent
Computes rain-attenuation occurrence probability from ITU-R P.618.
rain_cross_polarization_discrimination_db
Computes rain cross-polarization discrimination from ITU-R P.618.
rain_height_km
Looks up rain height from ITU-R P.839.
rain_specific_attenuation_coefficients
Computes ITU-R P.838 rain specific attenuation coefficients.
rain_specific_attenuation_db_per_km
Computes ITU-R P.838 rain specific attenuation in dB/km.
rainfall_probability_percent
Computes annual rain probability from ITU-R P.837.
rainfall_rate_mmh
Computes rainfall rate exceeded for a requested time percentage from ITU-R P.837.
rainfall_rate_r001_mmh
Looks up rainfall rate exceeded for 0.01% of an average year from ITU-R P.837.
risk_of_exceedance
Computes exceedance risk from ITU-R P.678.
saturation_vapour_pressure_hpa
Computes saturation vapour pressure from ITU-R P.453.
scintillation_attenuation_db
Computes scintillation attenuation from ITU-R P.618.
scintillation_sigma_db
Computes the P.618 scintillation standard deviation in dB.
site_diversity_rain_outage_probability_percent
Computes P.618 site-diversity rain outage probability.
slant_inclined_path_equivalent_height_km
Computes P.676 equivalent heights for dry air and water vapour.
standard_pressure_hpa
Computes standard-atmosphere pressure from ITU-R P.835.
standard_temperature_k
Computes standard-atmosphere temperature from ITU-R P.835.
standard_water_vapour_density_gm3
Computes standard water-vapour density from ITU-R P.835.
surface_mean_temperature_k
Looks up annual mean surface temperature from ITU-R P.1510.
surface_month_mean_temperature_k
Looks up monthly mean surface temperature from ITU-R P.1510.
surface_water_vapour_density_gm3
Looks up surface water-vapour density from ITU-R P.836.
topographic_altitude_km
Looks up topographic altitude above mean sea level from ITU-R P.1511.
total_water_vapour_content_kgm2
Looks up total columnar water-vapour content from ITU-R P.836.
unavailability_from_rainfall_rate_percent
Inverts ITU-R P.837 rainfall-rate statistics.
water_vapour_pressure_hpa
Computes water-vapour pressure from ITU-R P.453.
wet_term_radio_refractivity
Computes wet-term radio refractivity from ITU-R P.453.
zenith_water_vapour_attenuation_db
Computes P.676 zenith water-vapour attenuation.
zero_isotherm_height_km
Looks up zero-degree isotherm height from ITU-R P.839.