Package: skyfield-data
Data files for SkyfieldRationaleSkyfieldis 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 theLoader, they'redownloaded 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 2 sources: NASA's JPL, and the IERS.If one of them is temporarily unavailable, you couldn't perform any computation.In some countries, or behind some filtering proxies, some hosts may beblocked.These files havean 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 datesFileDatefinals2000A.all2024-06-16de421.bsp2053-10-08Deprecation warning: As ofpython-skyfield>=1.31,Leap_Second.dat,deltat.dataanddeltat.predsfiles are not used anymore. They were not maintained anymore, and Brandon Rhodes switched to other source files for ∆T computations.Goal for this projectProviding 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 couldinstall or upgradethis data package viapip.Once all the files are on your disk space, you can instantiate yourskyfieldloader pointing at their path, without having to worry about anything.UsageInstall the packages using:pipinstallskyfieldskyfield-dataTo create a custom Skyfield loader, use the following code:fromskyfield_dataimportget_skyfield_data_pathfromskyfield.apiimportLoaderload=Loader(get_skyfield_data_path())planets=load('de421.bsp')# this command won't download this filets=load.timescale(builtin=False)# this command won't download the IERS fileFor the record, usingbuitin=Trueas an argument to load the timescale data won't trigger the download of the file, because python-skyfield embeds its own data files as a built-in data source.If you want to make sure that the data files wouldneverbe downloaded, you can also use theexpireoption 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 theskyfield-datapath:>>>fromskyfield_dataimportget_skyfield_data_path>>>fromskyfield.apiimportLoader>>>load=Loader(get_skyfield_data_path())/home/[redacted]/skyfield_data/expirations.py:25:RuntimeWarning:Thefilede421.bsphasexpired.Pleaseupgradeyourversionof`skyfield-data`orexpectcomputationerrorsRuntimeWarningBy 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.Custom limitBy default, theRuntimeWarningis raised when the filehasexpired. You may want to be aware of this warningin advance, that is to say a few days or weeks before, in order to eventually upgrade your version ofskyfield-data.In order to trigger this warning, you can use theexpiration_limitargument, like this:>>>fromskyfield_dataimportget_skyfield_data_path>>>fromskyfield.apiimportLoader>>>load=Loader(get_skyfield_data_path(expiration_limit=30))/home/[redacted]/skyfield_data/expirations.py:25:RuntimeWarning:Thefilede421.bspwouldexpireinlessthan30days.Pleaseupgradeyourversionof`skyfield-data`orexpectcomputationerrorsRuntimeWarningNote:Theexpiration_limitargument should be a positive integer (or zero).DevelopersWe assume that you'll be using a Python3.7+ version for all regular operations.We're providing aMakefilewith basic targets to play around with the toolkit. usemake helpto get more details.In order to be able to run thedownload.pyscript, we recommend to run itfrom a virtualenvwhere you'd have installed the "dev" dependencies, using:makeinstall-devPython compatibilityImportant:This project is, and should stay compatible with Python 2.6, 2.7 and Python 3.7+ up to 3.11, to keep the same Python compatibility thatskyfieldhas.HackingImproving or fixingskyfield-datawill require you to have at least a virtualenv withtoxinstalled on it.We'll ask you to add tests along your patch, to make sure that no regression or bug would be introduced by your patch or further ones.To make a quick'n'dirty test, inside your "tox-ready" virtualenv, run:maketestto launch the Python 2.7 and Python 3.7+ test jobs.If you want to test your branch against Python 2.6, you'll have to setup a Python 2.6-ready tox environment, by doing something similar to:sudoaptinstallpython2.6python2.6-dev# dev headers to compile numpymkvirtualenvTOX26--python=`whichpython2.6`# You will activate this venv with `workon TOX26`pipinstalltox
tox-ctox-py26.iniKnown issues: on Ubuntu, you may be unable to build numpy at this point, due to misplaced C header files in your system. I've had hard times on Ubuntu, but your mileage may vary.Note: At the moment, we can't prove that skyfield-data is 100% compatible with Python 2.6, because of a defunct CI. Although, we're pretty confident it is. Fingers crossed!Online CI with Travis & Circle-CIThe online CI relies on Github Actions:CopyrightData filesde421.bspis provided by theJet Propulsion Laboratory,finals2000A.allis provided by theInternational Earth Rotation and Reference Systems Service.SoftwareThis Python Package code is published under the terms of the MIT license. See theCOPYINGfile for more details.