rustmatrix.refractive#
Refractive-index helpers.
Direct port of pytmatrix.refractive. Provides:
mg_refractive()— Maxwell-Garnett effective-medium approximation for a multi-component mixture.bruggeman_refractive()— Bruggeman EMA (two-component).Tabulated water refractive indices at 0/10/20 °C for the six standard radar bands (
m_w_0C,m_w_10C,m_w_20C).ice_refractive()— factory that returns a callablem(wl, rho)interpolating the refractive index of ice/snow against a lookup table.mi— pre-built interpolator using the bundledice_refr.datfrom http://www.atmos.washington.edu/ice_optical_constants/ .
- rustmatrix.refractive.mg_refractive(m, mix)[source]#
Maxwell-Garnett effective-medium refractive index.
- Parameters:
- Returns:
Effective complex refractive index of the mixture.
- Return type:
Notes
For two components, the first element is the matrix and the second is the inclusion — the approximation is asymmetric. For more components the media are mixed recursively from the tail inward.
Examples
Dry snow as ice inclusions in air (10 %% ice by volume):
>>> mg_refractive((complex(1.0, 0.0), complex(1.78, 3e-4)), (0.9, 0.1))
- rustmatrix.refractive.bruggeman_refractive(m, mix)[source]#
Bruggeman effective-medium refractive index (two components only).
Symmetric counterpart to
mg_refractive(). Takes the same arguments but both media are treated equally.
- rustmatrix.refractive.ice_refractive(file)[source]#
Build a callable interpolator for ice/snow refractive index.
- Parameters:
file (str) – Path to a refractive-index lookup table with columns
(wavelength [μm], real, imag). The bundledice_refr.datfile comes from the Warren & Brandt (2008) optical-constants compilation hosted at http://www.atmos.washington.edu/ice_optical_constants/ .- Returns:
ref –
ref(wl, snow_density)wherewlis in mm andsnow_densityis in g/cm³. Internally applies Maxwell-Garnett to mix the ice refractive index with air at the given density. Handles scalar or array-likewl.- Return type:
callable
Notes
The module-level
miinstance is a pre-built interpolator using the bundled data file — use that directly in most cases:>>> from rustmatrix.refractive import mi >>> from rustmatrix.tmatrix_aux import wl_W >>> mi(wl_W, 0.9) # ice at 0.9 g/cm³ at W-band