Sensors — Registry#
Sensor / channel metadata and radiometric calibration for EO instruments
(MTG-FCI, MSG-SEVIRI). The channel tables live in sensors/registry/data/*.yaml;
the calibration functions turn raw L1 radiances into reflectance / brightness
temperature. The registry also holds the per-sensor tasseled-cap coefficient
tables (get_tasseled_cap, sensors/registry/data/tasseled_cap.yaml), consumed
by pyramids_eo.spectral.tasseled_cap.
pyramids_eo.sensors.registry
#
Sensor metadata registry.
Maps a sensor's bands to their wavelengths, native resolution, radiometric kind,
and (nominal) calibration constants, backed by YAML tables under
sensors/registry/data/. Also exposes the radiometric calibration functions and
the tasseled-cap coefficient tables:
get_sensor/Sensor/Channel— the channel metadata tables.radiance_to_reflectance— solar-channel radiance → reflectance.radiance_to_brightness_temperature— thermal-channel radiance → brightness temperature (EUMETSAT inverse Planck).get_tasseled_cap/TasseledCapCoefficients/available_tasseled_cap_sensors— the per-sensor tasseled-cap coefficient tables (consumed bypyramids_eo.spectral.tasseled_cap).
Channel
dataclass
#
One instrument channel and its nominal calibration constants.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Channel identifier (e.g. |
wavelength_um |
float
|
Central wavelength in micrometres. |
resolution_m |
int
|
Native ground sampling distance in metres. |
kind |
str
|
|
solar_irradiance |
float | None
|
Band-integrated solar irradiance |
central_wavenumber_cm1 |
float | None
|
Central wavenumber (cm-1) for a thermal channel,
else |
alpha |
float | None
|
Thermal band-correction slope, else |
beta |
float | None
|
Thermal band-correction offset (kelvin), else |
Source code in src/pyramids_eo/sensors/registry/sensors.py
Sensor
dataclass
#
A named sensor and its channel table.
Source code in src/pyramids_eo/sensors/registry/sensors.py
channel_names
property
#
Return the sorted channel identifiers.
get_channel(name)
#
Return the channel named name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Channel identifier. |
required |
Returns:
| Type | Description |
|---|---|
Channel
|
The matching |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When the channel is not in this sensor's table. |
Source code in src/pyramids_eo/sensors/registry/sensors.py
TasseledCapCoefficients
dataclass
#
One sensor's tasseled-cap coefficient table.
Attributes:
| Name | Type | Description |
|---|---|---|
sensor |
str
|
Sensor identifier (e.g. |
bands |
tuple[str, ...]
|
The band roles, in the order the coefficients were derived for
(e.g. |
components |
Mapping[str, tuple[float, ...]]
|
Maps each component name (e.g. |
aliases |
Mapping[str, tuple[str, ...]]
|
Maps each band role to the band-name spellings that denote it,
so a transform can match a |
reference |
str
|
Citation for the coefficients. |
domain |
str
|
The reflectance domain the coefficients apply to (e.g.
|
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
component_names
property
#
Return the component names this table defines, sorted.
Returns:
| Type | Description |
|---|---|
list[str]
|
The sorted component identifiers (e.g. `["brightness", "greenness", |
list[str]
|
"wetness"]`). |
Examples:
- The classic three components of a Landsat table, sorted:
role_of(band_name)
#
Return the band role band_name denotes, or None if unrecognised.
Matching is case-insensitive and spans the canonical role names in
bands plus every spelling in aliases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
band_name
|
str
|
A band name from a |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The canonical role (e.g. |
str | None
|
matches no role of this sensor. |
Examples:
- A canonical role, an alias, and an unknown name:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
radiance_to_brightness_temperature(radiance, central_wavenumber_cm1, alpha=1.0, beta=0.0)
#
Convert thermal-channel radiance to brightness temperature (kelvin).
Applies the EUMETSAT effective-radiance inverse Planck function
Tb* = C2 * nu / ln(1 + C1 * nu^3 / L) followed by the per-channel band
correction Tb = (Tb* - beta) / alpha, with nu the channel central
wavenumber (cm-1) and L in mW m-2 sr-1 (cm-1)-1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radiance
|
Any
|
Spectral radiance |
required |
central_wavenumber_cm1
|
float
|
Channel central wavenumber |
required |
alpha
|
float
|
Band-correction slope (default 1.0). |
1.0
|
beta
|
float
|
Band-correction offset in kelvin (default 0.0). |
0.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The brightness temperature in kelvin, same shape as |
Raises:
| Type | Description |
|---|---|
CalibrationError
|
When |
Source code in src/pyramids_eo/sensors/registry/calibration.py
radiance_to_reflectance(radiance, solar_irradiance, sun_earth_distance=1.0, cos_sza=None)
#
Convert solar-channel radiance to top-of-atmosphere reflectance.
Computes the bidirectional reflectance factor
rho = pi * L * d^2 / E0, optionally normalised by the cosine of the solar
zenith angle (/ cos_sza) to give a sun-angle-corrected BRF.
L and E0 must be in consistent spectral units for the ratio to be
dimensionless — for MSG/MTG L1 that is the wavenumber form (L in
mW m-2 sr-1 (cm-1)-1, E0 the band-effective solar irradiance in
mW m-2 (cm-1)-1), which the FCI/SEVIRI registry tables provide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radiance
|
Any
|
Spectral radiance |
required |
solar_irradiance
|
float
|
Band-effective solar irradiance |
required |
sun_earth_distance
|
float
|
Sun-earth distance |
1.0
|
cos_sza
|
Any
|
Cosine of the solar zenith angle for the sun-angle correction,
or |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The reflectance, same shape as |
Raises:
| Type | Description |
|---|---|
CalibrationError
|
When |
Source code in src/pyramids_eo/sensors/registry/calibration.py
get_sensor(name)
cached
#
Load and return the Sensor named name from the bundled tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sensor identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Sensor
|
The |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When no table exists for |
Source code in src/pyramids_eo/sensors/registry/sensors.py
available_tasseled_cap_sensors()
#
Return the sensor identifiers that have a bundled tasseled-cap table.
Returns:
| Type | Description |
|---|---|
list[str]
|
The sorted sensor keys from |
list[str]
|
"landsat7_etm", "landsat8_oli"]`). |
Examples:
- List the sensors that have a bundled tasseled-cap table:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
get_tasseled_cap(sensor)
#
Load and return the TasseledCapCoefficients for sensor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sensor
|
str
|
Sensor identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
TasseledCapCoefficients
|
The frozen coefficient table for |
TasseledCapCoefficients
|
casing of the same sensor returns the identical object). |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When no block exists for |
ValueError
|
When the bundled table is malformed -- a component row whose length does not match the number of bands. |
Examples:
- Load a sensor and read its band order and a coefficient:
- The lookup is case-insensitive and cites its source:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
pyramids_eo.sensors.registry.tasseled_cap
#
Tasseled-cap (Kauth-Thomas) coefficient tables from the bundled registry.
get_tasseled_cap(sensor) loads a sensor's tasseled-cap coefficients from
sensors/registry/data/tasseled_cap.yaml and returns a frozen
TasseledCapCoefficients -- the band order the coefficients were derived for,
the band-name aliases that let a transform recognise a Dataset's bands, and the
per-component coefficient rows. The coefficients are published constants; see the
reference on each record and the provenance note in the YAML.
The coefficient tables are sensor reference data (which bands, in which order,
with which constants), so they live here with the channel tables; the transform
that applies them to a raster is pyramids_eo.spectral.tasseled_cap.
TasseledCapCoefficients
dataclass
#
One sensor's tasseled-cap coefficient table.
Attributes:
| Name | Type | Description |
|---|---|---|
sensor |
str
|
Sensor identifier (e.g. |
bands |
tuple[str, ...]
|
The band roles, in the order the coefficients were derived for
(e.g. |
components |
Mapping[str, tuple[float, ...]]
|
Maps each component name (e.g. |
aliases |
Mapping[str, tuple[str, ...]]
|
Maps each band role to the band-name spellings that denote it,
so a transform can match a |
reference |
str
|
Citation for the coefficients. |
domain |
str
|
The reflectance domain the coefficients apply to (e.g.
|
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
component_names
property
#
Return the component names this table defines, sorted.
Returns:
| Type | Description |
|---|---|
list[str]
|
The sorted component identifiers (e.g. `["brightness", "greenness", |
list[str]
|
"wetness"]`). |
Examples:
- The classic three components of a Landsat table, sorted:
role_of(band_name)
#
Return the band role band_name denotes, or None if unrecognised.
Matching is case-insensitive and spans the canonical role names in
bands plus every spelling in aliases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
band_name
|
str
|
A band name from a |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The canonical role (e.g. |
str | None
|
matches no role of this sensor. |
Examples:
- A canonical role, an alias, and an unknown name:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
get_tasseled_cap(sensor)
#
Load and return the TasseledCapCoefficients for sensor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sensor
|
str
|
Sensor identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
TasseledCapCoefficients
|
The frozen coefficient table for |
TasseledCapCoefficients
|
casing of the same sensor returns the identical object). |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When no block exists for |
ValueError
|
When the bundled table is malformed -- a component row whose length does not match the number of bands. |
Examples:
- Load a sensor and read its band order and a coefficient:
- The lookup is case-insensitive and cites its source:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
available_tasseled_cap_sensors()
#
Return the sensor identifiers that have a bundled tasseled-cap table.
Returns:
| Type | Description |
|---|---|
list[str]
|
The sorted sensor keys from |
list[str]
|
"landsat7_etm", "landsat8_oli"]`). |
Examples:
- List the sensors that have a bundled tasseled-cap table:
Source code in src/pyramids_eo/sensors/registry/tasseled_cap.py
pyramids_eo.sensors.registry.sensors
#
Sensor / channel metadata loaded from the bundled registry tables.
get_sensor(name) loads a sensor's channel table from sensors/registry/data/<name>.yaml
and returns a Sensor of frozen Channel records — band wavelength, native
resolution, radiometric kind (solar / thermal), and the nominal calibration
constants a reader falls back to when the granule metadata does not carry them.
Channel
dataclass
#
One instrument channel and its nominal calibration constants.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Channel identifier (e.g. |
wavelength_um |
float
|
Central wavelength in micrometres. |
resolution_m |
int
|
Native ground sampling distance in metres. |
kind |
str
|
|
solar_irradiance |
float | None
|
Band-integrated solar irradiance |
central_wavenumber_cm1 |
float | None
|
Central wavenumber (cm-1) for a thermal channel,
else |
alpha |
float | None
|
Thermal band-correction slope, else |
beta |
float | None
|
Thermal band-correction offset (kelvin), else |
Source code in src/pyramids_eo/sensors/registry/sensors.py
Sensor
dataclass
#
A named sensor and its channel table.
Source code in src/pyramids_eo/sensors/registry/sensors.py
channel_names
property
#
Return the sorted channel identifiers.
get_channel(name)
#
Return the channel named name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Channel identifier. |
required |
Returns:
| Type | Description |
|---|---|
Channel
|
The matching |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When the channel is not in this sensor's table. |
Source code in src/pyramids_eo/sensors/registry/sensors.py
get_sensor(name)
cached
#
Load and return the Sensor named name from the bundled tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sensor identifier (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Sensor
|
The |
Raises:
| Type | Description |
|---|---|
UnknownSensorError
|
When no table exists for |
Source code in src/pyramids_eo/sensors/registry/sensors.py
pyramids_eo.sensors.registry.calibration
#
Radiometric calibration for EO instrument channels.
Two conversions turn raw L1 radiances into physical quantities:
- solar channels → top-of-atmosphere bidirectional reflectance factor (BRF),
via
radiance_to_reflectance; - thermal (IR) channels → brightness temperature, via
radiance_to_brightness_temperature(the EUMETSAT effective-radiance inverse Planck with the per-channelalpha/betacorrection).
The math is exact; the per-channel constants come from the file metadata where
available, falling back to the bundled registry tables (see
pyramids_eo.sensors.registry.get_sensor).
radiance_to_reflectance(radiance, solar_irradiance, sun_earth_distance=1.0, cos_sza=None)
#
Convert solar-channel radiance to top-of-atmosphere reflectance.
Computes the bidirectional reflectance factor
rho = pi * L * d^2 / E0, optionally normalised by the cosine of the solar
zenith angle (/ cos_sza) to give a sun-angle-corrected BRF.
L and E0 must be in consistent spectral units for the ratio to be
dimensionless — for MSG/MTG L1 that is the wavenumber form (L in
mW m-2 sr-1 (cm-1)-1, E0 the band-effective solar irradiance in
mW m-2 (cm-1)-1), which the FCI/SEVIRI registry tables provide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radiance
|
Any
|
Spectral radiance |
required |
solar_irradiance
|
float
|
Band-effective solar irradiance |
required |
sun_earth_distance
|
float
|
Sun-earth distance |
1.0
|
cos_sza
|
Any
|
Cosine of the solar zenith angle for the sun-angle correction,
or |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The reflectance, same shape as |
Raises:
| Type | Description |
|---|---|
CalibrationError
|
When |
Source code in src/pyramids_eo/sensors/registry/calibration.py
radiance_to_brightness_temperature(radiance, central_wavenumber_cm1, alpha=1.0, beta=0.0)
#
Convert thermal-channel radiance to brightness temperature (kelvin).
Applies the EUMETSAT effective-radiance inverse Planck function
Tb* = C2 * nu / ln(1 + C1 * nu^3 / L) followed by the per-channel band
correction Tb = (Tb* - beta) / alpha, with nu the channel central
wavenumber (cm-1) and L in mW m-2 sr-1 (cm-1)-1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radiance
|
Any
|
Spectral radiance |
required |
central_wavenumber_cm1
|
float
|
Channel central wavenumber |
required |
alpha
|
float
|
Band-correction slope (default 1.0). |
1.0
|
beta
|
float
|
Band-correction offset in kelvin (default 0.0). |
0.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The brightness temperature in kelvin, same shape as |
Raises:
| Type | Description |
|---|---|
CalibrationError
|
When |