Stellarium 0.15.2
Skybright.hpp
1  /*
2  * Copyright (C) 2003 Fabien Chereau
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef _SKYBRIGHT_HPP_
20 #define _SKYBRIGHT_HPP_
21 
25 // GZ: tentative additions to the documentation.
40 class Skybright
41 {
42 public:
44  Skybright();
45 
50  void setDate(const int year, const int month, const float moonPhase);
51 
57  void setLocation(const float latitude, const float altitude, const float temperature=15.f, const float relativeHumidity=40.f);
58 
63  void setSunMoon(const float cosDistMoonZenith, const float cosDistSunZenith);
64 
69  float getLuminance(float cosDistMoon, const float cosDistSun, const float cosDistZenith) const;
70 
71 private:
72  float airMassMoon; // Air mass for the Moon
73  float airMassSun; // Air mass for the Sun
74  float magMoon; // Moon magnitude
75  float RA; // Extremely crude estimate of Right Ascension of the Sun!
76  float K; // Summary extinction coefficient
77  float C3; // Term for moon brightness computation
78  float C4; // Term for sky brightness computation
79  float SN; // Snellen Ratio (20/20=1.0, good 20/10=2.0)
80 
81  // Optimisation variables
82  float bNightTerm;
83  float bMoonTerm1;
84  float bTwilightTerm;
85 };
86 
87 #endif // _SKYBRIGHT_HPP_
void setSunMoon(const float cosDistMoonZenith, const float cosDistSunZenith)
Set the moon and sun zenith angular distance (cosin given) and precompute what can be This function h...
float getLuminance(float cosDistMoon, const float cosDistSun, const float cosDistZenith) const
Compute the luminance at the given position.
This class makes use of the 1998 sky brightness model by Bradley Schaefer.
Definition: Skybright.hpp:40
void setLocation(const float latitude, const float altitude, const float temperature=15.f, const float relativeHumidity=40.f)
Set the position parameters to use for atmosphere computation.
void setDate(const int year, const int month, const float moonPhase)
Set the sky date to use for atmosphere computation.
Skybright()
Constructor.