You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make coordinates.solar_system_ephemeris accept local ephemeris file #8750
astropy.coordinates.solar_system_ephemeris.set() currently (version 3.1) has the possibility of accepting one of the presets (e.g. 'builtin', 'de430') or an URL pointing to another ephemeris to use. But if I have an ephemeris already downloaded to a local file, it does not allow me to pass the path to this local file to use.
It doesn't work to specify the local file in URL format either i.e. "file://path/to/file.bsp".
My suggestion would be to either make it possible to specify a local file either using the URL format specified above or allowing to pass the path to the local file directly.
Very much in favour - this was an oversight in the implementation. Possibly the way to go would be to do the download_file(value) only in the branch where a URL is detected, and otherwise just try SPK.open(value) directly.
@rhandberg - would you be able to try this, and perhaps make a PR?
Activity
pllim commentedon May 24, 2019
Yes, that is a reasonable request and should be supported IMHO. It looks like this logic below does not yet support a local data file:
astropy/astropy/coordinates/solar_system.py
Lines 158 to 172 in 33962dd
The workaround for now, I guess, is to upload your data file to the internet, so it can be downloaded back and cached... 😬
Cadair commentedon May 24, 2019
or just run
python -m http.serverin the directory it is in so you can put in alocalhost:8000url?!pllim commentedon May 24, 2019
@Cadair , you mean
http.serverorhttp.severe?mhvk commentedon May 24, 2019
Very much in favour - this was an oversight in the implementation. Possibly the way to go would be to do the
download_file(value)only in the branch where a URL is detected, and otherwise just trySPK.open(value)directly.@rhandberg - would you be able to try this, and perhaps make a PR?
rhandberg commentedon May 28, 2019
@mhvk - I'll give it a try... PR coming soon!