-
If you do not have one, create an account at NASA Earthdata.
-
Install the required packages:
pip install -r requirements.txt
-
Run the main program:
python3 main.py
-
Follow the instructions. Data will be downloaded automatically, as necessary.
The trajectory of the Sun is traced in time with a sampling interval of 1 minute. At each time sample, the azimuth and altitude of the Sun are computed (apparent position), according to the DE421 ephemerides published by NASA Jet Propulsion Laboratory.
Then, the line at the heading (azimuth) of the Sun (note that it is not exactly 270° but only approximately west) is considered and sampled at a 30m interval (30m = 1" = spatial accuracy of SRTM).
To determine the maximum distance from the observer within which terrain features may hide the Sun, the maximum possible height of a mountain is considered (i.e., Mount Everest with a height of 8000m, with a small error margin added). The reasoning here is that any terrain further away, in order to have an altitude angle higher than the Sun's, would have to be taller than the tallest mountain, which cannot happen.
Given that an upper bound of the distance is being searched for here (and not a precise value), the circumscribing sphere of the WGS84 reference ellipsoid is considered (this means the radius
This equation is numerically solved for
Then the sample points have to be computed. Their coordinates are computed as points on the WGS84 reference ellipsoid with specific distance and azimuth from the point of the observer. For this computation, the Karney (2013) algorithms for geodesics on ellipsoids are used (Direct Problem). More specifically, the GeographicLib
C++ implementation is used, wrapped by geopy.distance.geodesic
.
Afterwards, the SRTM (Shuttle Radar Topographic Mission, 1" = 30m spatial accuracy, global coverage) digital elevation model (DEM), which was collected by the Space Shuttle Endeavour during the STS-99 mission, is used to find the elevation of each sample point. The data are freely provided by NASA. The elevation of the observer is also found from the DEM. (One could have instead used GPS to find this elevation with increased accuracy.)
Knowing the elevations and the coordinates of the observer and the sample point, the altitude of the sample point, as seen from the observer, has to be computed. This is defined as the angle of the line of sight of the sample point with the horizon. Firstly, the coordinates of the two points are converted from ellipsoidal coordinates (on the reference ellipsoid WGS84) to 3D Cartesian coordinates with the origin at a supposed center of the Earth (this coordinate system is usually called ECEF -- Earth-centered, Earth-fixed). The equations for the conversion can be seen here. The pyproj
implementation of these equations is used. Let's call
The vector of the horizon at
By taking the gradient, the (non-normalized) normal vector
The vector of the horizon is the tangent vector to the ellipsoid, which is perpendicular to the normal vector. Therefore, the angle of a vector with the horizon is complementary to the angle with the normal vector. The angle of the line of sight (this is the
Therefore, the angle of the line of sight with the horizon is:
Finally, we determine whether the terrain at the sample point obscures the Sun by checking whether the computed altitude of the terrain is higher than the Sun's altitude at that moment.
All the sample points of the line with heading of the Sun's, up to the upper distance bound calculated before, are checked, and afterwards, the next time sample is considered. This process continues until terrain is found that obscures the Sun.
It was experimentally found that at a point with coordinates
© 2024 Andreas Stamos. All rights reserved.