hypso.srf#

Spectral response of HYPSO’s bands (SRFs, per-band solar irradiance, effective FWHM) and the reference solar spectra and Earth-Sun distance it uses. The TOA reflectance step itself is hypso.processing.toa.

Submodules#

Classes#

SpectralResponse

SRFs and what is derived from them. Shapes: n_bands = binned band

Functions#

band_irradiance(srfs, ssi)

Per-band solar irradiance F0: the irradiance averaged with

bin_srfs(srfs, bin_factor)

Sum each group of bin_factor neighbouring SRFs and renormalise to a

compute_spectral_response(band_centers_unbinned, ...)

Spectral response of a sensor's bands.

earth_sun_distance(iso_time)

Earth-Sun distance in AU for a date.

effective_fwhm(srfs, wavelengths)

Width (nm) of each SRF at half its maximum.

gaussian_srfs(ssi, solar_wavelengths, ...)

One Gaussian SRF (peak 1, +/- SRF_N_SIGMA sigma) per band on the irradiance

load_solar_irradiance([source])

A reference solar irradiance spectrum.

srf_dataset(sr, wavelengths, fwhm[, iso_time, ...])

A product's metadata/srf group.

Package Contents#

class hypso.srf.SpectralResponse[source]#

SRFs and what is derived from them. Shapes: n_bands = binned band count, n_unbinned = pre-binning band count, n_grid = wavelength grid.

hypso.srf.band_irradiance(srfs, ssi)[source]#

Per-band solar irradiance F0: the irradiance averaged with each band’s SRF as weights.

Parameters:

srfs (scipy.sparse.csr_matrix)

Return type:

numpy.ndarray

hypso.srf.bin_srfs(srfs, bin_factor)[source]#

Sum each group of bin_factor neighbouring SRFs and renormalise to a peak of 1 (extra bands beyond a whole number of bins are dropped).

Parameters:
  • srfs (scipy.sparse.csr_matrix)

  • bin_factor (int)

Return type:

scipy.sparse.csr_matrix

hypso.srf.compute_spectral_response(band_centers_unbinned, fwhm_unbinned, bin_factor, ssi_source='tsis')[source]#

Spectral response of a sensor’s bands.

Parameters:
  • band_centers_unbinned (array_like) – Band centres and FWHM in nm before spectral binning.

  • fwhm_unbinned (array_like) – Band centres and FWHM in nm before spectral binning.

  • bin_factor (int) – Spectral binning factor of the image.

  • ssi_source ({"tsis", "thuillier"}, default "tsis") – Solar irradiance spectrum for the per-band F0.

Return type:

SpectralResponse

hypso.srf.earth_sun_distance(iso_time)[source]#

Earth-Sun distance in AU for a date.

1 - 0.01672 cos(0.9856 (doy - 4)) with the cosine argument in degrees: 0.9856 deg/day is the mean orbital motion, day 4 is perihelion. (Until 2026-10-23 the argument was passed as radians, a date-dependent TOA reflectance error of up to about 6%.)

Parameters:

iso_time (str or datetime) – Acquisition time.

Returns:

Distance over the mean distance (R / R_0).

Return type:

float

hypso.srf.effective_fwhm(srfs, wavelengths)[source]#

Width (nm) of each SRF at half its maximum.

Parameters:

srfs (scipy.sparse.csr_matrix)

Return type:

numpy.ndarray

hypso.srf.gaussian_srfs(ssi, solar_wavelengths, sensor_wavelengths, sensor_fwhm)[source]#

One Gaussian SRF (peak 1, +/- SRF_N_SIGMA sigma) per band on the irradiance spectrum’s wavelength grid, truncated to the first band’s start and the last band’s end. Returns (srfs as sparse CSR, truncated irradiance, truncated wavelengths).

hypso.srf.load_solar_irradiance(source='tsis')[source]#

A reference solar irradiance spectrum.

Parameters:

source ({"tsis", "thuillier"}, default "tsis") – TSIS-1 HSRS v2 (2022-11-30, 0.005 nm sampling) or Thuillier (2002).

Returns:

  • irradiance (numpy.ndarray) – In mW m-2 nm-1.

  • wavelengths (numpy.ndarray) – In nm.

hypso.srf.srf_dataset(sr, wavelengths, fwhm, iso_time=None, band_indices=None)[source]#

A product’s metadata/srf group.

Parameters:
  • sr (SpectralResponse)

  • wavelengths (array_like) – The product’s band centres and FWHM (nm).

  • fwhm (array_like) – The product’s band centres and FWHM (nm).

  • iso_time (str, optional) – Acquisition time, for earth_sun_distance_au.

  • band_indices (array_like of int, optional) – Each band’s index in sr (the sensor’s full band set), for a product with a subset of bands (Product.select_bands); default 0..n-1. The per-band tables and Band_<index> SRFs follow it.

Returns:

F0, F0_wavelengths, effective_fwhm(_unbinned), and one Band_<i> variable per band (the non-zero part of its binned SRF, on its own wav_Band_<i> coordinate). Polymer reads its SRFs from here (hypso.ac.ac_polymer.ac_polymer_srf_getter_from_l1()).

Return type:

xarray.Dataset