-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
163 lines (150 loc) · 14.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<head>
<style>
body {
font:13.34px helvetica,arial,freesans,clean,sans-serif;
color:black;
line-height:1.4em;
background-color: #F8F8F8;
padding: 0.7em;
}
pre {
margin:1em 0;
font-size:12px;
background-color:#eee;
border:1px solid #ddd;
padding:5px;
line-height:1.5em;
color:#444;
overflow:auto;
-webkit-box-shadow:rgba(0,0,0,0.07) 0 1px 2px inset;
-webkit-border-radius:3px;
-moz-border-radius:3px;border-radius:3px;
}
pre code {
padding:0;
font-size:12px;
background-color:#eee;
border:none;
}
code {
font-size:12px;
background-color:#f8f8ff;
color:#444;
padding:0 .2em;
border:1px solid #dedede;
}
</style>
</head>
<body>
<h1>Earth, Sun, Moon, and Planets Plugin</h1>
<p>This plugin uses the highly accurate Skyfield library to show where the sun, moon, and planets are located at their zenith from earth's perspective for a particular date and time. An additional algorithm calculates lunar and solar data for a particular location on earth given a date and time. The <strong><em>Day/Night terminator</em></strong> algorithm plots the day/night terminator line and polygon layers associated with sunrise/sunset, civil twilight, nautical twilight, and astronomical twilight. It includes Field Calculator expressions which give access to solar and lunar information. When installed, this plugin can be found in the QGIS menu under <strong><em>Plugins->Earth, sun, moon & planets</em></strong>. </p>
<div style="text-align:center"><img src="doc/menu.jpg" alt="Plugin menu"></div>
<h2>Installation</h2>
<p>This plugin can be enhanced with two additional python libraries not provided by QGIS. Without the extra libraries only the <strong><em>Day/Night terminator</em></strong> and <strong><em>Sun position directly overhead</em></strong> algorithms will be available. These libraries can be installed by running the OSGeo4W Shell and typing the command "<strong>pip install timezonefinder skyfield</strong>" or whatever method you use to install Python libraries.</p>
<p>You do not need to be a system administrator to be able to install these libraries. If these libraries are not installed then the functionality will be limited to the following two capabilities.</p>
<div style="text-align:center"><img src="doc/menu_limited.jpg" alt="Plugin menu"></div>
<h2>Tools Overview</h2>
<p>These are the tools provided by the Earth, Sun, Moon, and Planets Plugin:</p>
<ul>
<li><img src="icons/daynight.png" width=24 height=24 alt="Day/Night terminator"> <strong><em>Day/Night terminator</em></strong> - This algorithm creates vector layers for the day/night terminator line, polygon layers associated with sunrise/sunset, civil twilight, nautical twilight and astronomical twilight, and the position of the sun directly overhead. Unlike the other algorithms below this does not depend on the Skyfield library. It uses spherical geometry like the web based maps that you find on-line.</li>
<li><img src="icons/sun_icon.svg" alt="Sun position directly overhead"> <strong><em>Sun position directly overhead</em></strong> - This shows the location of the sun where it is directly overhead for a particular date and time. If the Skyfield library is not installed, then this algorithm uses a slightly less accurate spherical calculation for the sun's position.</li>
<li><img src="icons/moon.png" width=24 height=24 alt="Moon position directly overhead"> <strong><em>Moon position directly overhead</em></strong> - This shows the location of the moon where it is directly overhead for a particular date and time.</li>
<li><img src="icons/venus.png" width=24 height=24 alt="Planetary positions directly overhead"> <strong><em>Planetary positions directly overhead</em></strong> - This shows the location of the planets where they are directly overhead for a particular date and time.</li>
<li><img src="icons/ephem.svg" alt="Ephemeris information"> <strong><em>Ephemeris information</em></strong> - This provides information about the selected ephemeris file. This plugin includes limited ephemeris data for the dates 1990-2040. For dates outside this range other ephemeris files can be downloaded from the <a href="https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/">JPL Ephemeris page</a>. These can be installed from the <strong><em>Settings</em></strong> menu.</li>
<li><img src="doc/settings.png" width=24 height=24 alt="Settings"> <strong><em>Settings</em></strong> - Plugin settings.</li>
</ul>
<h2>Field Calculator Expressions</h2>
<p>The following expressions are available in the field calculator. Note that the expressions require the Skyfield library.</p>
<ul>
<li><strong><em>esm_local_datetime()</em></strong> - Returns the current date and time as a python datetime object with the local computer's timezone settings.</li>
<li><strong><em>esm_local_qdatetime()</em></strong> - Returns the current date and time as a standard QGIS QDateTime object with the local computer's timezone settings. </li>
<li><strong><em>esm_moon_phase()</em></strong> - Given a date and time, return the moon's phase in degrees where 0° is the New Noon, 90° is First Quarter, 180° is Full Moon, and 270° is Last Quarter.</li>
<li><strong><em>esm_moon_zenith()</em></strong> - Given a date and time, return the EPSG:4326 coordinate point where the moon is directly overhead. </li>
<li><strong><em>esm_sun_moon_info()</em></strong> - Given a date and time, latitude and longitude in EPSG:4326, output format type, and optional timezone of the date and time object, it returns a python dictionary or JSON string of solar and lunar information.</li>
<li><strong><em>esm_sun_zenith()</em></strong> - Given a date and time, return the EPSG:4326 coordinate point where the sun is directly overhead.</li>
</ul>
<h2><img src="icons/daynight.png" width=24 height=24 alt="Day/Night terminator"> Day/Night terminator</h2>
<p>This algorithm creates vector layers for the position of the sun directly overhead, day/night terminator line, and polygon layers associated with sunrise/sunset, civil twilight, nautical twilight and astronomical twilight. This is the associated dialog box.</p>
<div style="text-align:center"><img src="doc/terminator.jpg" alt="Day/Night terminator"></div>
<p>The input parameters are as follows:</p>
<ul>
<li><strong><em>Set date and time</em></strong> - This will automatically be initialized to the current date, time, and timezone of your computer. Internally it converts the date and time to UTC for all the calculations.</li>
<li><strong><em>Show sun position</em></strong> - This will create a point for the position of the sun where it is directly overhead.</li>
<li><strong><em>Show day/night terminator line</em></strong> - This is the terminating vector line representing the boundary between sunrise and sunset.</li>
<li><strong><em>Sunrise, Sunset</em></strong> - This is a polygon of the day/night, sunrise/sunset dark region.</li>
<li><strong><em>Civil Twilight</em></strong> - This is a polygon of the civil twilight region.</li>
<li><strong><em>Nautical Twilight</em></strong> - This is a polygon of the nautical twilight region.</li>
<li><strong><em>Astronomical Twilight</em></strong> - This is a polygon of the astronomical twilight region.</li>
<li><strong><em>Delta/resolution of polygon</em></strong> - This determines the number of points used to create the lines and polygons. A larger number means fewer points and less accuracy. The default value of 1.0 probably does not need to be changed in most instances.</li>
<li><strong><em>Add solar disk diameter for day/night terminator calculation</em></strong> - The sun is not a point but a disk and this compensates for the day/night terminator with a refraction index of 0.833. Should you check this box? It really depends on your definition of the day/night terminator line. By default it is not checked.</li>
<li><strong><em>Automatically style output</em></strong> - When checked, the resulting output layers are nicely styled.</li>
<li><strong><em>Clip polygons to project CRS bounds</em></strong> - The output vector layer's coordinate reference is EPSG:4326 with longitude going from -180 to 180 degrees and latitude from -90 to 90 degrees. If you are using some other CRS and this is checked, then the resulting layers will be clipped to the project CRS.</li>
</ul>
<p>Here is an example of what is generated with automatic styling.</p>
<div style="text-align:center"><img src="doc/day_night.jpg" alt="Day/Night"></div>
<p>The attribute tables give the name of the feature, its computer date and time, and the UTC string of the date and time.</p>
<h2><img src="icons/sun_icon.svg" alt="Sun position directly overhead"> Sun position directly overhead</h2>
<p>This shows the dialog for the algorithm to calculate the sun directly overhead. If the Skyfield library is installed then it uses the highly accurate position algorithms of the library; otherwise, it uses a spherical earth model. The time zone of the date and time is based on the time zone of the computer you are running QGIS on. Internally, the dates and times are converted to UTC.</p>
<div style="text-align:center"><img src="doc/sunalg.jpg" alt="Sun position directly overhead"></div>
<p>If <strong><em>Advanced Paramters</em></strong> is expanded and <strong><em>Create sun time series</em></strong> is checked, then a series of sun observations is created starting from the date and time specified with each successive date and time incremented using <strong><em>Time increment between observations</em></strong> until the <strong><em>Total duration for sun positions</em></strong> is reached. Be carefult that the time increment is not to small for the duration desired. There is the potential to create a huge number of sun date & time points. The time increment and total duration is in the form of DD:HH:MM:SS where DD represents days, HH hours, MM minutes, and SS seconds. You don't need to have all the ending times, but you need all the beginning ones. For an example you could do something like <strong>1:26.5</strong> representing 1 day and 26.5 hours which is really 2 days and 2.5 hours. Note that the days, hours, minutes and seconds are not constrained in their size. The time series can be animated with the QGIS time controller or with the QTDC plugin. Here is an example of the resulting image using the default settings.</p>
<div style="text-align:center"><img src="doc/sun_series.jpg" alt="Sun positions overhead"></div>
<p>This shows what this algorithm produces when this algorithm is run for both the sun and moon not using a time series.</p>
<div style="text-align:center"><img src="doc/sunmoonmap.jpg" alt="Sun moon map"></div>
<p>The planets algorithm currently does not have the option for a time series. This shows the results of running the alogirthms to locate the sun, moon, and planets for a certain date and time.</p>
<div style="text-align:center"><img src="doc/sunmoonplanets.jpg" alt="Sun moon planets"></div>
<p>The attribute table contains the object id, name of the object, its coordinate where it is directly overhead, and the date and time as a time stamp and computer time and UTC date, time strings. This is the attribute table with all three combined together.</p>
<div style="text-align:center"><img src="doc/attributes.jpg" alt="Attributes"></div>
<h2><img src="icons/info.svg" alt="Solar/lunar information"> Solar/lunar information</h2>
<p>The user can click on the <img src="icons/coordCapture.svg" alt="coordinate capture"> coordinate capture icon and click on the map. This dialog is then populated with the following details. The timezone is automatically selected based on the coordinate.</p>
<div style="text-align:center"><img src="doc/info.jpg" alt="Info"></div>
<p>The <strong><em>Now</em></strong> icon <img src="icons/CurrentTime.png" width=24 height=24 alt="Now"> will set the date and time to the current computer time. The <strong><em>Use UTC</em></strong> check box displays the date and times in UTC; otherwise, they are displayed using the selected time zone.</p>
<div style="text-align:center"><img src="doc/info2.jpg" alt="Info"></div>
<h2><img src="icons/ephem.svg" alt="Ephemeris information"> Ephemeris Information</h2>
<p>This tool displays information about the selected ephemeris file being used. Here is the limited extract file <strong><em>de440s_1990_2040.bsp</em></strong> that comes with the plugin.</p>
<div style="text-align:center"><img src="doc/ephemeris_info.jpg" alt="Ephemeris Information"></div>
<h2><img src="doc/settings.png" width=24 height=24 alt="Settings"> Settings</h2>
<p>This shows the settings dialog window. </p>
<div style="text-align:center"><img src="doc/settings_dialog.jpg" alt="Settings Dialog"></div>
<p>It allows the user to select the ephemeris file used in the calculations. Click on the drop down box to select the ephemeris file to use. When first installed the plugin only includes a single limited ephemeris data extract between the years 1990 and 2040 so there will only be one option. A full ephemeris file exceeds the allowed QGIS plugin size. For dates outside this range other ephemeris files can be downloaded from the <a href="https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/">JPL Ephemeris page</a>. Once one of these are downloaded, click on the "<strong>...</strong>" button and select the downloaded <strong>.bsp</strong> then click on the <strong><em>Install Ephemeris File</em></strong> button and it will be copied over to the plugin's data directory. It will also select the file automatically in the ephemeris drop down list. Click on <strong><em>OK</em></strong> to accept these settings.</p>
<p>These are some of the popular ephemeris series that you will find on the JPL Ephemeris page.</p>
<table><tr><th>Issued</th><th>Short</th><th>Medium</th><th>Long</th></tr>
<tr><td>1997</td><td></td>
<td>de405.bsp<br/>
1600 to 2200<br/>
63 MB</td>
<td>de406.bsp<br/>
−3000 to 3000<br/>
287 MB</td>
</tr>
<tr><td>2008</td>
<td>de421.bsp<br/>
1900 to 2050<br/>
17 MB</td>
<td></td>
<td>de422.bsp<br/>
−3000 to 3000<br/>
623 MB</td>
</tr>
<tr><td>2013</td>
<td>de430_1850-2150.bsp<br/>
1850 to 2150<br/>
31 MB</td>
<td>de430t.bsp<br/>
1550 to 2650<br/>
128 MB</td>
<td>de431t.bsp<br/>
–13200 to 17191<br/>
3.5 GB</td>
</tr>
<tr><td>2020</td>
<td>de440s.bsp<br/>
1849 to 2150<br/>
32 MB</td>
<td>de440.bsp<br/>
1550 to 2650<br/>
114 MB</td>
<td>de441.bsp<br/>
−13200 to 17191<br/>
3.1 GB</td>
</tr>
</table></body>