Calculation of the log of the illuminance of the moon outside the atmosphere.

This is the base 10 log of equation 20, converted from foot-candles to lux,
from:

   Krisciunas K. and Schaefer B.E. (1991). A model of the brightness of
moonlight, Publ. Astron.  Soc. Pacif. 103(667), 1033-1039 (DOI:
http://dx.doi.org/10.1086/132921).
This commit is contained in:
Edward d'Auvergne
2016-11-08 09:49:57 +01:00
parent 76ebd569d5
commit 0e09ee4bce
2 changed files with 20 additions and 1 deletions
+13 -1
View File
@@ -26,6 +26,7 @@
#include <string.h> #include <string.h>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/math/SGMath.hxx>
#include <math.h> #include <math.h>
@@ -82,8 +83,9 @@ void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun)
Ls, Lm, D, F, mpar, gclat, rho, HA, g, Ls, Lm, D, F, mpar, gclat, rho, HA, g,
geoRa, geoDec, geoRa, geoDec,
cosN, sinN, cosvw, sinvw, sinvw_cosi, cosecl, sinecl, rcoslatEcl, cosN, sinN, cosvw, sinvw, sinvw_cosi, cosecl, sinecl, rcoslatEcl,
FlesstwoD, MlesstwoD, twoD, twoM, twolat; FlesstwoD, MlesstwoD, twoD, twoM, twolat, alpha;
double conv = 1.0319696543787917; // The log foot-candle to log lux conversion factor.
updateOrbElements(mjd); updateOrbElements(mjd);
actTime = sgCalcActTime(mjd); actTime = sgCalcActTime(mjd);
@@ -215,4 +217,14 @@ void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun)
// Moon age and phase calculation // Moon age and phase calculation
age = lonEcl - ourSun->getlonEcl(); age = lonEcl - ourSun->getlonEcl();
phase = (1 - cos(age)) / 2; phase = (1 - cos(age)) / 2;
// The log of the illuminance of the moon outside the atmosphere.
// This is the base 10 log of equation 20 from Krisciunas K. and Schaefer B.E.
// (1991). A model of the brightness of moonlight, Publ. Astron. Soc. Pacif.
// 103(667), 1033-1039 (DOI: http://dx.doi.org/10.1086/132921).
alpha = SGD_RADIANS_TO_DEGREES * SGMiscd::normalizeAngle(age + SGMiscd::pi());
log_I = -0.4 * (3.84 + 0.026*fabs(alpha) + 4e-9*pow(alpha, 4.0));
// Convert from foot-candles to lux.
log_I += conv;
} }
+7
View File
@@ -41,6 +41,7 @@ private:
double distance; // the moon's distance to the earth double distance; // the moon's distance to the earth
double age; // the moon's age from 0 to 2pi double age; // the moon's age from 0 to 2pi
double phase; // the moon's phase double phase; // the moon's phase
double log_I; // the moon's illuminance outside the atmosphere (logged)
// void TexInit(); // This should move to the constructor eventually. // void TexInit(); // This should move to the constructor eventually.
// GLUquadricObj *moonObject; // GLUquadricObj *moonObject;
@@ -68,6 +69,7 @@ public:
double getDistance() const; double getDistance() const;
double getAge() const; double getAge() const;
double getPhase() const; double getPhase() const;
double getLogIlluminance() const;
}; };
inline double MoonPos::getM() const inline double MoonPos::getM() const
@@ -115,4 +117,9 @@ inline double MoonPos::getPhase() const
return phase; return phase;
} }
inline double MoonPos::getLogIlluminance() const
{
return log_I;
}
#endif // _MOONPOS_HXX_ #endif // _MOONPOS_HXX_