Data package for Skyfield
Project description
Data files for Skyfield
Rationale
Skyfield is a Python library for astronomical computations. It depends on various data files to accurately compute moon phases, planet positions, etc.
Several issues are raised by these data files:
- If they're not found in the path of the
Loader
, they're downloaded at runtime. Depending on the archive you're requesting, some files might be very large, causing a long delay (directly related to your network bandwidth). In the case of a web server app, you'd cause a timeout on client's end. - They come mainly from 3 sources: the USNO (US Navy), Paris (Meudon) Observatory, and NASA JPL. If one of them is temporarily unavailable, you couldn't perform any computation.
- In some countries, or behind some filtering proxies, the USNO is considered as a military website, and thus is blocked.
- These files have an expiration date (in a more or less distant future). As a consequence, even if the files are already downloaded in the right path, at each runtime you could possibly have to download one or more files before making any computation using them.
Currently known expiration dates
File | Date |
---|---|
deltat.data | 2020-06-01 |
Leap_Second.dat | 2020-07-28 |
deltat.preds | 2021-01-01 |
de421.bsp | 2053-10-08 |
Goal for this project
- Providing at least the most common of these assets in Python Package.
- Make regular releases to refresh the files before they expire.
- Provide a warning / logging mechanism when the files are about to expire (or when they are outdated) to still allow you to compute things with the loaded assets, but being informed you need to upgrade.
This way, you could install or upgrade this data package via pip
.
Once all the files are on your disk space, you can instantiate your skyfield
loader pointing at their path, without having to worry about anything.
Usage
Install the packages using:
pip install skyfield skyfield-data
To create a custom Skyfield loader, use the following code:
from skyfield_data import get_skyfield_data_path
from skyfield.api import Loader
load = Loader(get_skyfield_data_path())
planets = load('de421.bsp') # this command won't download this file
ts = load.timescale() # this command won't download the deltat + Leap Second files
If you want to make sure that the data files would never be downloaded, you can also use the expire
option like this:
load = Loader(get_skyfield_data_path(), expire=False)
Whenever a file contained in the catalog has expired, you're going to receive a warning when loading the skyfield-data
path:
>>> from skyfield_data import get_skyfield_data_path
>>> from skyfield.api import Loader
>>> load = Loader(get_skyfield_data_path())
/home/[redacted]/skyfield_data/expirations.py:25: RuntimeWarning: The file de421.bsp has expired. Please upgrade your version of `skyfield-data` or expect computation errors
RuntimeWarning
By default, the loading isn't blocked, but it's strongly recommended to upgrade to a more recent version, to make sure you're not going to make wrong astronomical computations.
Developers
We're providing a Makefile
with basic targets to play around with the toolkit. use make help
to get more details.
In order to be able to run the download.py
script, we recommend to run it from a virtualenv where you'd have installed the "dev" dependencies, using:
make install-dev
Note: This project is, and should be compatible with Python 2.6/2.7 and Python 3.5+, to be kept the same Python compatiblity that skyfield
has.
Copyright
Data files
de421.bsp
is provided by the Jet Propulsion Laboratory,deltat.data
anddeltat.preds
are provided by the United States Naval Observatory,Leap_Second.dat
is provided by the International Earth Rotation and Reference Systems Service.
Software
This Python Package code is published under the terms of the MIT license. See the COPYING
file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file skyfield-data-0.1.0.tar.gz
.
File metadata
- Download URL: skyfield-data-0.1.0.tar.gz
- Upload date:
- Size: 16.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bae8e2d29936cae1c919ae4190aa523659043c43789631bd81de8c3b9b3815f7 |
|
MD5 | b65100ec6c1663f246d3132b43ecc132 |
|
BLAKE2b-256 | 6aaacf044270d1cfce25cf62ffd9e2ef50db6274fbf078799bebefae4b7383ab |
File details
Details for the file skyfield_data-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: skyfield_data-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 16.0 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b390ebe76acfdb63ed63bd47ec941c22b37b4f3deb30d10e9828f872d2cd05 |
|
MD5 | 6f94d2123d72609d4d97d185c0001a42 |
|
BLAKE2b-256 | ea46666a4b44709badf6e11b8b77a7aeefebababc1648f46a893f9f8642e99b3 |