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 Day/Night terminator 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 Plugins->Earth, sun, moon & planets.
This plugin can be enhanced with two additional python libraries not provided by QGIS. Without the extra libraries only the Day/Night terminator and Sun position directly overhead algorithms will be available. These libraries can be installed by running the OSGeo4W Shell and typing the command "pip install timezonefinder skyfield" or whatever method you use to install Python libraries.
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.
These are the tools provided by the Earth, Sun, Moon, and Planets Plugin:
The following expressions are available in the field calculator. Note that the expressions require the Skyfield library.
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.
The input parameters are as follows:
Here is an example of what is generated with automatic styling.
The attribute tables give the name of the feature, its computer date and time, and the UTC string of the date and time.
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.
If Advanced Paramters is expanded and Create sun time series 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 Time increment between observations until the Total duration for sun positions 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 1:26.5 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.
This shows what this algorithm produces when this algorithm is run for both the sun and moon not using a time series.
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.
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.
The user can click on the 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.
The Now icon will set the date and time to the current computer time. The Use UTC check box displays the date and times in UTC; otherwise, they are displayed using the selected time zone.
This tool displays information about the selected ephemeris file being used. Here is the limited extract file de440s_1990_2040.bsp that comes with the plugin.
This shows the settings dialog window.
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 JPL Ephemeris page. Once one of these are downloaded, click on the "..." button and select the downloaded .bsp then click on the Install Ephemeris File 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 OK to accept these settings.
These are some of the popular ephemeris series that you will find on the JPL Ephemeris page.
Issued | Short | Medium | Long |
---|---|---|---|
1997 | de405.bsp 1600 to 2200 63 MB |
de406.bsp −3000 to 3000 287 MB |
|
2008 | de421.bsp 1900 to 2050 17 MB |
de422.bsp −3000 to 3000 623 MB |
|
2013 | de430_1850-2150.bsp 1850 to 2150 31 MB |
de430t.bsp 1550 to 2650 128 MB |
de431t.bsp –13200 to 17191 3.5 GB |
2020 | de440s.bsp 1849 to 2150 32 MB |
de440.bsp 1550 to 2650 114 MB |
de441.bsp −13200 to 17191 3.1 GB |