#include <PragueSkyModel.h>
Data Structures | |
| struct | AvailableData |
| Structure with parameter ranges available in currently loaded dataset. More... | |
| class | DatasetNotFoundException |
| Exception thrown by the initialize method if the passed dataset file could not be found. More... | |
| class | DatasetReadException |
| Exception thrown by the initialize method if an error occurred while reading the passed dataset file. More... | |
| class | NoPolarisationException |
| class | NotInitializedException |
| Exception thrown when using the model without calling the initialize method first. More... | |
| struct | Parameters |
| Structure holding all parameters necessary for querying the model. More... | |
| class | Vector3 |
| A simple 3D vector implementation. Provides some basic operations. More... | |
Public Member Functions | |
| void | initialize (const std::string &filename, const double singleVisibility=0.0) |
| bool | isInitialized () const |
| AvailableData | getAvailableData () const |
| Parameters | computeParameters (const Vector3 &viewPoint, const Vector3 &viewDirection, const double groundLevelSolarElevationAtOrigin, const double groundLevelSolarAzimuthAtOrigin, const double visibility, const double albedo) const |
| double | skyRadiance (const Parameters ¶ms, const double wavelength) const |
| double | sunRadiance (const Parameters ¶ms, const double wavelength) const |
| double | polarisation (const Parameters ¶ms, const double wavelength) const |
| double | transmittance (const Parameters ¶ms, const double wavelength, const double distance) const |
Implementation of the physically-based sky model presented by Wilkie et al. [2021] (https://cgg.mff.cuni.cz/publications/skymodel-2021/) and Vevoda et al. [2022]. Improves on previous work especially in accuracy of sunset scenarios. Based on reconstruction of radiance from a small dataset fitted to a large set of images obtained by brute force atmosphere simulation.
Provides evaluation of spectral sky radiance, sun radiance, transmittance and polarisation for observer at a specific altitude above ground. The range of configurations depends on supplied dataset. The full version models atmosphere of visibility (meteorological range) from 20 km to 131.8 km for sun elevations from -4.2 degrees to 90 degrees, observer altitudes from 0 km to 15 km and ground albedo from 0 to 1, and provides results for wavelengths from 280 nm to 2480 nm.
Usage:
Throws:
Note: The entire model is written in a single class and does not depend on anything except of STL. It defines a simple Vector3 class to simplify working with points and directions and expects using this class when passing viewing point and direction to the computeParameters method.
Definition at line 58 of file PragueSkyModel.h.
|
inline |
Definition at line 330 of file PragueSkyModel.h.
| PragueSkyModel::Parameters PragueSkyModel::computeParameters | ( | const Vector3 & | viewPoint, |
| const Vector3 & | viewDirection, | ||
| const double | groundLevelSolarElevationAtOrigin, | ||
| const double | groundLevelSolarAzimuthAtOrigin, | ||
| const double | visibility, | ||
| const double | albedo | ||
| ) | const |
Computes all the parameters in the Parameters structure necessary for querying the model.
Expects view point and direction, sun elevation and azimuth at origin, ground level visibility and ground albedo. Assumes origin at [0,0,0] with Z axis pointing up. Thus view point [0, 0, 100] defines observer altitude 100 m. Range of available values depends on the used dataset. The full version supports altitude from [0, 15000] m, elevation from [-0.073, PI/2] rad, azimuth from [0, PI] rad, visibility from [20, 131.8] km, and albedo from [0, 1]. Values outside range of the used dataset are clamped to the nearest supported value.
Definition at line 612 of file PragueSkyModel.cpp.
| PragueSkyModel::AvailableData PragueSkyModel::getAvailableData | ( | ) | const |
Gets parameter ranges available in currently loaded dataset.
Throws NotInitializedException if called without initializing the model first.
Definition at line 585 of file PragueSkyModel.cpp.
| void PragueSkyModel::initialize | ( | const std::string & | filename, |
| const double | singleVisibility = 0.0 |
||
| ) |
Prepares the model and loads the given dataset file into memory.
If a positive visibility value is passed, only a portion of the dataset needed for evaluation of that particular visibility is loaded (two nearest visibilities are loaded if the value is included in the dataset or one nearest if not). Otherwise, the entire dataset is loaded.
Throws:
Definition at line 571 of file PragueSkyModel.cpp.
|
inline |
Definition at line 343 of file PragueSkyModel.h.
| double PragueSkyModel::polarisation | ( | const Parameters & | params, |
| const double | wavelength | ||
| ) | const |
Computes degree of polarisation for given parameters and wavelength (full dataset supports wavelengths from 280 nm to 2480 nm). Can be negative.
Throws:
Definition at line 864 of file PragueSkyModel.cpp.
| double PragueSkyModel::skyRadiance | ( | const Parameters & | params, |
| const double | wavelength | ||
| ) | const |
Computes sky radiance only (without direct sun contribution) for given parameters and wavelength (full dataset supports wavelengths from 280 nm to 2480 nm).
Throws NotInitializedException if called without initializing the model first.
Definition at line 813 of file PragueSkyModel.cpp.
| double PragueSkyModel::sunRadiance | ( | const Parameters & | params, |
| const double | wavelength | ||
| ) | const |
Computes sun radiance only (without radiance inscattered from the sky) for given parameters and wavelength (full dataset supports wavelengths from 280 nm to 2480 nm).
Checks whether the parameters correspond to view direction hitting the sun and returns 0 if not.
Throws NotInitializedException if called without initializing the model first.
Definition at line 826 of file PragueSkyModel.cpp.
| double PragueSkyModel::transmittance | ( | const Parameters & | params, |
| const double | wavelength, | ||
| const double | distance | ||
| ) | const |
Computes transmittance between view point and a point certain distance away from it along view direction.
Expects the Parameters structure, wavelength (full dataset supports wavelengths from 280 nm to 2480 nm) and the distance (any positive number, use std::numeric_limits<double>::max() for infinity).
Throws NotInitializedException if called without initializing the model first.
Definition at line 1049 of file PragueSkyModel.cpp.