Skybright.hpp   Skybright.hpp 
skipping to change at line 25 skipping to change at line 25
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _SKYBRIGHT_HPP_ #ifndef _SKYBRIGHT_HPP_
#define _SKYBRIGHT_HPP_ #define _SKYBRIGHT_HPP_
//! @class Skybright //! @class Skybright
//! Compute the luminance of the sky according to some parameters like sun moon position //! Compute the luminance of the sky according to some parameters like sun moon position
//! or time or altitude etc... //! or time or altitude etc...
// GZ: tentative additions to the documentation.
//! This class makes use of the 1998 sky brightness model by Bradley Schaef
er.
//! Further reading:
//! B. Schaefer: Sky&Telescope 4/1987
//! B. Schaefer: Astronomy and the Limits of Vision. Vistas in Astronomy 36
, 311-361, 1993.
//! B. Schaefer: To the Visual Limits. Sky&Telescope 5/1998 57-60.
//! B. Schaefer: Archaeoastronomy XV, 2000.
//! TASKS TO IMPROVE:
//! Some components of the Schaefer model are strongly simplified. E.g.,
//! - setDate should be taken always in the Gregorian Calendar, or circumve
nted altogether:
//! - RA takes the right ascension of the sun. --> Could be replaced with t
he proper value!
//! - bNightTerm includes an 11.0-year solar cycle, and will be erratic a f
ew cycles from 1992. --> At least find a more accurate average period.
//! Extinction could make use of the K computed in SetLocation. But first r
e-verify that
//! the code here really follows the Schaefer model (with obvious amendment
s).
class Skybright class Skybright
{ {
public: public:
//! Constructor //! Constructor
Skybright(); Skybright();
//! Set the sky date to use for atmosphere computation //! Set the sky date to use for atmosphere computation
//! @param year the year in YYYY format //! @param year the year in YYYY format
//! @param month the month: 1=Jan, 12=Dec //! @param month the month: 1=Jan, 12=Dec
//! @param moonPhase the moon phase in radian 0=Full Moon, PI/2=Firs t Quadrant/Last Quadran, PI=No Moon //! @param moonPhase the moon phase in radian 0=Full Moon, PI/2=Firs t Quadrant/Last Quadran, PI=No Moon
void setDate(int year, int month, float moonPhase); void setDate(const int year, const int month, const float moonPhase) ;
//! Set the position parameters to use for atmosphere computation //! Set the position parameters to use for atmosphere computation
//! @param latitude observer latitude in radian //! @param latitude observer latitude in radian
//! @param altitude observer altitude in m //! @param altitude observer altitude in m
//! @param temperature temperature in deg. C //! @param temperature temperature in deg. C
//! @param relativeHumidity air humidity in % //! @param relativeHumidity air humidity in %
void setLocation(float latitude, float altitude, float temperature=1 5.f, float relativeHumidity=40.f); void setLocation(const float latitude, const float altitude, const f loat temperature=15.f, const float relativeHumidity=40.f);
//! Set the moon and sun zenith angular distance (cosin given) and p recompute what can be //! Set the moon and sun zenith angular distance (cosin given) and p recompute what can be
//! This function has to be called once before any call to getLumina nce() //! This function has to be called once before any call to getLumina nce()
//! @param cosDistMoonZenith cos(angular distance between moon and z enith) //! @param cosDistMoonZenith cos(angular distance between moon and z enith)
//! @param cosDistSunZenith cos(angular distance between sun and zen ith) //! @param cosDistSunZenith cos(angular distance between sun and zen ith)
void setSunMoon(float cosDistMoonZenith, float cosDistSunZenith); void setSunMoon(const float cosDistMoonZenith, const float cosDistSu nZenith);
//! Compute the luminance at the given position //! Compute the luminance at the given position
//! @param cosDistMoon cos(angular distance between moon and the pos ition) //! @param cosDistMoon cos(angular distance between moon and the pos ition)
//! @param cosDistSun cos(angular distance between sun and the posi tion) //! @param cosDistSun cos(angular distance between sun and the posi tion)
//! @param cosDistZenith cos(angular distance between zenith and the position) //! @param cosDistZenith cos(angular distance between zenith and the position)
float getLuminance(float cosDistMoon, float cosDistSun, float cosDis tZenith) const; float getLuminance(float cosDistMoon, const float cosDistSun, const float cosDistZenith) const;
private: private:
float airMassMoon; // Air mass for the Moon float airMassMoon; // Air mass for the Moon
float airMassSun; // Air mass for the Sun float airMassSun; // Air mass for the Sun
float magMoon; // Moon magnitude float magMoon; // Moon magnitude
float RA; // Something related with date float RA; // Extremely crude estimate of Right Ascension o
float K; // Useful coef... f the Sun!
float K; // Summary extinction coefficient
float C3; // Term for moon brightness computation float C3; // Term for moon brightness computation
float C4; // Term for sky brightness computation float C4; // Term for sky brightness computation
float SN; // Snellen Ratio (20/20=1.0, good 20/10=2.0) float SN; // Snellen Ratio (20/20=1.0, good 20/10=2.0)
// Optimisation variables // Optimisation variables
float bNightTerm; float bNightTerm;
float bMoonTerm1; float bMoonTerm1;
float bTwilightTerm; float bTwilightTerm;
}; };
 End of changes. 6 change blocks. 
6 lines changed or deleted 28 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/