toolsrtm.smac
SMAC (Simplified Method for Atmospheric Correction, Rahman & Dedieu 1994)
atmospheric radiative transfer, and the per-sensor coefficient/spectral-
response data it needs. Direct port of ToolsRTM::get.smac/
get.coef.SMAC/get.spectral.convolution.
Note
The atmospheric-correction physics (get_smac(),
spectral_convolution()) is fully general and sensor-agnostic
given a SmacSensor – only Sentinel-2A (MSI)’s data is
bundled as package data so far, out of the 9 sensors the R package
ships. See the module docstring for the exact R-side export recipe to
add another sensor (a data-export exercise, not a code change).
SMAC (Simplified Method for Atmospheric Correction, Rahman & Dedieu 1994) atmospheric radiative transfer, and the sensor coefficient/spectral-response data it needs – the piece that turns SPART’s top-of-canopy (TOC) BRDF into top-of-atmosphere (TOA) reflectance/radiance for a specific sensor.
Direct port of ToolsRTM::get.smac/get.coef.SMAC/get.spectral.convolution
(ToolsRTM/R/get.smac.R, get.coef.SMAC.R, Spectral.convolution.R).
Scope: all 9 sensors the R package ships are bundled – Landsat 4/5/7/8,
Sentinel-2A/B, Sentinel-3A/B, Terra/Aqua MODIS (see ToolsRTM/data/*.rda
and SENSORS/get_sensor()). The atmospheric-correction
physics (get_smac(), spectral_convolution()) is fully general
and sensor-agnostic given a SmacSensor; each sensor’s coefficient/SRF
tables were exported via python/scratch/scratch_export_smac_sensors.R.
Sentinel-2A verified against a real, unmodified ToolsRTM::SPART() call
(see toolsrtm.spart.spart_toa()); the other 8 verified against a real
ToolsRTM::get.smac() call each (see tests/test_smac.py).
- class toolsrtm.smac.SmacSensor(mission, wl_smac, coef, wl_srf, p_srf)[source]
Bases:
objectOne sensor’s SMAC coefficients + spectral-response data (subset of R’s
sensorlist, e.g.ToolsRTM::Sentinel2A.MSI, actually used byget_smac()/spectral_convolution()).- mission: str
- coef: dict
- toolsrtm.smac.SENSORS = {'LANDSAT4.TM': <functools._lru_cache_wrapper object>, 'LANDSAT5.TM': <functools._lru_cache_wrapper object>, 'LANDSAT7.ETM': <functools._lru_cache_wrapper object>, 'LANDSAT8.OLI': <functools._lru_cache_wrapper object>, 'Sentinel2A.MSI': <functools._lru_cache_wrapper object>, 'Sentinel2B.MSI': <functools._lru_cache_wrapper object>, 'Sentinel3A.OLCI': <functools._lru_cache_wrapper object>, 'Sentinel3B.OLCI': <functools._lru_cache_wrapper object>, 'TerraAqua.MODIS': <functools._lru_cache_wrapper object>}
Every bundled sensor, by the same short name used in R’s
ToolsRTM::get.smac(sensor=...).
- toolsrtm.smac.get_sensor(name)[source]
Look up a bundled sensor by name (see
SENSORSfor the exact keys, matching R’s own sensor object names).- Parameters:
name (str)
- Return type:
- toolsrtm.smac.sentinel2a_msi()[source]
Sentinel-2A MSI: 13 bands. Direct export of
ToolsRTM::Sentinel2A.MSI.- Return type:
- toolsrtm.smac.sentinel2b_msi()[source]
Sentinel-2B MSI: 13 bands. Direct export of
ToolsRTM::Sentinel2B.MSI.- Return type:
- toolsrtm.smac.sentinel3a_olci()[source]
Sentinel-3A OLCI: 21 bands. Direct export of
ToolsRTM::Sentinel3A.OLCI.- Return type:
- toolsrtm.smac.sentinel3b_olci()[source]
Sentinel-3B OLCI: 21 bands. Direct export of
ToolsRTM::Sentinel3B.OLCI.- Return type:
- toolsrtm.smac.landsat4_tm()[source]
Landsat 4 TM: 6 bands. Direct export of
ToolsRTM::LANDSAT4.TM.- Return type:
- toolsrtm.smac.landsat5_tm()[source]
Landsat 5 TM: 6 bands. Direct export of
ToolsRTM::LANDSAT5.TM.- Return type:
- toolsrtm.smac.landsat7_etm()[source]
Landsat 7 ETM+: 6 bands. Direct export of
ToolsRTM::LANDSAT7.ETM.- Return type:
- toolsrtm.smac.landsat8_oli()[source]
Landsat 8 OLI: 9 bands. Direct export of
ToolsRTM::LANDSAT8.OLI.- Return type:
- toolsrtm.smac.terra_aqua_modis()[source]
Terra/Aqua MODIS: 20 bands. Direct export of
ToolsRTM::TerraAqua.MODIS.- Return type:
- class toolsrtm.smac.SmacAtmosphere(Ta_ss, Ta_sd, Ta_oo, Ta_do, Ta_s, Ta_o, Tg, Ra_dd, Ra_so)[source]
Bases:
objectPer-band atmospheric optical quantities, on
sensor.wl_smac.- Parameters:
- toolsrtm.smac.get_smac(sensor, tts, tto, psi, Pa, taup550, uo3, uh2o)[source]
Atmospheric transmittance/reflectance terms (SMAC, Rahman & Dedieu 1994), per sensor band. Direct port of
ToolsRTM::get.smac.- Parameters:
sensor (SmacSensor)
tts (float) – Sun zenith, view zenith, relative azimuth (degrees).
tto (float) – Sun zenith, view zenith, relative azimuth (degrees).
psi (float) – Sun zenith, view zenith, relative azimuth (degrees).
Pa (float) – Surface air pressure (hPa). Use
ToolsRTM::get.Altitude2Pa’s formula yourself first if you only have altitude – not ported here since every call site in this port suppliesPadirectly.taup550 (float) – Aerosol optical thickness at 550nm.
uo3 (float) – Ozone content (atm-cm).
uh2o (float) – Water vapour content (g/cm2).
- Return type:
- toolsrtm.smac.spectral_convolution(wave, values, sensor)[source]
Weighted-average a high-resolution spectrum onto a sensor’s bands using its spectral response function (SRF). Direct port of
ToolsRTM::get.spectral.convolution(the non-Sentinel-3/MODIS per-detector-averaging branch – Sentinel-2A has one SRF per band already, nocolMeansstep needed).- Parameters:
wave (array_like, shape (nwl,)) – Integer-nm wavelength grid
valuesis defined on (must cover every SRF sample wavelength for a band to get a non-NaN result).values (array_like, shape (nwl,))
sensor (SmacSensor)
- Return type: