hypso.srf ========= .. py:module:: hypso.srf .. autoapi-nested-parse:: 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 ---------- .. toctree:: :maxdepth: 1 /api/hypso/srf/response/index /api/hypso/srf/solar/index Classes ------- .. autoapisummary:: hypso.srf.SpectralResponse Functions --------- .. autoapisummary:: hypso.srf.band_irradiance hypso.srf.bin_srfs hypso.srf.compute_spectral_response hypso.srf.earth_sun_distance hypso.srf.effective_fwhm hypso.srf.gaussian_srfs hypso.srf.load_solar_irradiance hypso.srf.srf_dataset Package Contents ---------------- .. py:class:: SpectralResponse SRFs and what is derived from them. Shapes: n_bands = binned band count, n_unbinned = pre-binning band count, n_grid = wavelength grid. .. py:function:: band_irradiance(srfs, ssi) Per-band solar irradiance F0: the irradiance averaged with each band's SRF as weights. .. py:function:: bin_srfs(srfs, bin_factor) 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). .. py:function:: compute_spectral_response(band_centers_unbinned, fwhm_unbinned, bin_factor, ssi_source = 'tsis') Spectral response of a sensor's bands. :param band_centers_unbinned: Band centres and FWHM in nm before spectral binning. :type band_centers_unbinned: array_like :param fwhm_unbinned: Band centres and FWHM in nm before spectral binning. :type fwhm_unbinned: array_like :param bin_factor: Spectral binning factor of the image. :type bin_factor: int :param ssi_source: Solar irradiance spectrum for the per-band F0. :type ssi_source: {"tsis", "thuillier"}, default "tsis" :rtype: SpectralResponse .. py:function:: earth_sun_distance(iso_time) 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%.) :param iso_time: Acquisition time. :type iso_time: str or datetime :returns: Distance over the mean distance (R / R_0). :rtype: float .. py:function:: effective_fwhm(srfs, wavelengths) Width (nm) of each SRF at half its maximum. .. py:function:: gaussian_srfs(ssi, solar_wavelengths, sensor_wavelengths, sensor_fwhm) One Gaussian SRF (peak 1, +/- :data:`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). .. py:function:: load_solar_irradiance(source = 'tsis') A reference solar irradiance spectrum. :param source: TSIS-1 HSRS v2 (2022-11-30, 0.005 nm sampling) or Thuillier (2002). :type source: {"tsis", "thuillier"}, default "tsis" :returns: * **irradiance** (*numpy.ndarray*) -- In mW m-2 nm-1. * **wavelengths** (*numpy.ndarray*) -- In nm. .. py:function:: srf_dataset(sr, wavelengths, fwhm, iso_time=None, band_indices=None) A product's ``metadata/srf`` group. :param sr: :type sr: SpectralResponse :param wavelengths: The product's band centres and FWHM (nm). :type wavelengths: array_like :param fwhm: The product's band centres and FWHM (nm). :type fwhm: array_like :param iso_time: Acquisition time, for ``earth_sun_distance_au``. :type iso_time: str, optional :param band_indices: 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_`` SRFs follow it. :type band_indices: array_like of int, optional :returns: ``F0``, ``F0_wavelengths``, ``effective_fwhm(_unbinned)``, and one ``Band_`` variable per band (the non-zero part of its binned SRF, on its own ``wav_Band_`` coordinate). Polymer reads its SRFs from here (:func:`hypso.ac.ac_polymer.ac_polymer_srf_getter_from_l1`). :rtype: xarray.Dataset