physics/reflectance_library.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | /// @file reflectance_library.h | ||
| 3 | /// @brief Measured reflectance spectra embedded from ECOSTRESS. | ||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "ernie/physics/spectrum.h" | ||
| 7 | |||
| 8 | #include <span> | ||
| 9 | #include <string_view> | ||
| 10 | |||
| 11 | namespace ernie { | ||
| 12 | |||
| 13 | /// @brief A measured reflectance spectrum Ernie embeds. | ||
| 14 | 214 | struct MeasuredReflectance { | |
| 15 | /// The id a material names in `ernie:reflectance:library`. | ||
| 16 | std::string_view id; | ||
| 17 | /// What was measured. | ||
| 18 | std::string_view name; | ||
| 19 | /// The ECOSTRESS file it comes from. | ||
| 20 | std::string_view source; | ||
| 21 | /// Reflectance as a fraction, from 350 nm (or where measurement | ||
| 22 | /// starts) to 2.5 um, for most on to 12.5-15 um. | ||
| 23 | Spectrum spectrum; | ||
| 24 | }; | ||
| 25 | |||
| 26 | /// @brief The ECOSTRESS reflectances (tools/reflectance_library.py). | ||
| 27 | /// Vegetation, soils, building materials, paints, metals, snow, ice | ||
| 28 | /// and water. Unlike colours, they hold beyond the visible: the red | ||
| 29 | /// edge of leaves, snow dark past 1.4 um, metals bright in the | ||
| 30 | /// thermal infrared. | ||
| 31 | /// @return Every embedded spectrum. | ||
| 32 | /// | ||
| 33 | /// References: | ||
| 34 | /// - S. K. Meerdink, S. J. Hook, D. A. Roberts and E. A. Abbott, "The | ||
| 35 | /// ECOSTRESS spectral library version 1.0", Remote Sensing of | ||
| 36 | /// Environment 230:111196, 2019. | ||
| 37 | /// - A. M. Baldridge, S. J. Hook, C. I. Grove and G. Rivera, "The | ||
| 38 | /// ASTER spectral library version 2.0", Remote Sensing of | ||
| 39 | /// Environment 113(4):711-715, 2009. | ||
| 40 | std::span<const MeasuredReflectance> ReflectanceLibrary(); | ||
| 41 | |||
| 42 | /// @brief Looks up a measured reflectance. | ||
| 43 | /// @param id The id, such as "grass" or "fine_snow". | ||
| 44 | /// @return The reflectance, or null if there is none. | ||
| 45 | const MeasuredReflectance* FindReflectance(std::string_view id); | ||
| 46 | |||
| 47 | } // namespace ernie | ||
| 48 |