Stellarium 0.13.0
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.
39 class Skybright
40 {
41 public:
43  Skybright();
44 
49  void setDate(const int year, const int month, const float moonPhase);
50 
56  void setLocation(const float latitude, const float altitude, const float temperature=15.f, const float relativeHumidity=40.f);
57 
62  void setSunMoon(const float cosDistMoonZenith, const float cosDistSunZenith);
63 
68  float getLuminance(float cosDistMoon, const float cosDistSun, const float cosDistZenith) const;
69 
70 private:
71  float airMassMoon; // Air mass for the Moon
72  float airMassSun; // Air mass for the Sun
73  float magMoon; // Moon magnitude
74  float RA; // Extremely crude estimate of Right Ascension of the Sun!
75  float K; // Summary extinction coefficient
76  float C3; // Term for moon brightness computation
77  float C4; // Term for sky brightness computation
78  float SN; // Snellen Ratio (20/20=1.0, good 20/10=2.0)
79 
80  // Optimisation variables
81  float bNightTerm;
82  float bMoonTerm1;
83  float bTwilightTerm;
84 };
85 
86 #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:39
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.