hypso.srf.response#

Spectral response of HYPSO’s bands: Gaussian spectral response functions (SRFs) per unbinned band, sampled on the solar irradiance spectrum’s wavelength grid and binned like the image; and what follows from them - per-band solar irradiance (F0) and effective FWHM.

compute_spectral_response() builds all of it into one SpectralResponse; srf_dataset() turns that into a product’s metadata/srf group.

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.

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

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

A product's metadata/srf group.

Module Contents#

class hypso.srf.response.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.response.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.response.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.response.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.response.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.response.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.response.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