Repository navigation
Solar system epherides doc update and kernel URL setting option - #4908
Conversation
| def _download_spk_file(url=('http://naif.jpl.nasa.gov/pub/naif/' | ||
| 'generic_kernels/spk/planets/de430.bsp'), | ||
| show_progress=True): | ||
| def set_kernel_url(url='http://naif.jpl.nasa.gov/pub/naif/generic_kernels' |
There was a problem hiding this comment.
Shouldn't this just be a configuration item if you're going to make it public?
There was a problem hiding this comment.
I thought that at first, but then decided definitely not. It's "science state", in that the actual results you get depend on which kernel you are using. Configuration items are intended for things that do not affect science state, on the theory that it's bad to implicitly set anything that actually affects the scientific results.
Put another way, in an ipython notebook we want it to always be necessary to put this at the top to specify the kernel, rather than counting on some configuration file hidden in the server that the notebook is running on.
There was a problem hiding this comment.
|
Actually, the bit about Is it silly to actually not download the kernel automatically on using So, the idea would be that in the future we can still provide Sorry to be a bit late with this, but I actually do not like the idea that trying to get the position of the moon starts an automatic download of 120 MB... |
|
@mhvk - I don't understand why you say:
The point is that the ephemerides are better from DE430 than they are from
Hmm, I hadn't thought about that. But maybe it does make sense? Two things that require checking to decide for sure:
Oh, I agree. But frustratingly, that's the one thing that |
|
I just checked and I think I am starting to understand Here, I think initially:
Before I proceed too much, does this make sense? @StuartLittlefair - what do you think? Also, am not sure yet about p.s. I'm still somewhat confused about why |
|
Sorry, saw your comment only after committing: so, since it doesn't seem easy to get the Moon, I guess my being perhaps overly careful and unwilling to just download large files without thinking way, would suggests something an interface that currently is: which will raise an error unless an explicit ephemeris is passed in. |
|
Your comment about the importance of |
|
Another small comment: opening an Will think a bit more & try things (but first off for a bit) |
|
@eteq - a PR including |
|
See #4920 for an attempt to include |
|
|
||
| @classmethod | ||
| def validate(cls, value): | ||
| try: |
There was a problem hiding this comment.
It might be nice to do more than simply check that this is a valid URL. Should we test that the kernel name is valid?
There was a problem hiding this comment.
I don't think so, because you never know what random SPK file someone in the future might want to use, and we'd have to make assumptions about what's a "valid" name (or actually download the file and check it somehow, which is also non-ideal). I think it's better to just validate here that it's a thing that might be downloadable, and let the jplephem and download_file machinery be responsible for the rest. Otherwise it'll be a nightmare to maintain.
|
I'll comment on the pros and cons of using plan94 as a kernel on @mhvk 's PR. Apart from my minor comment above I really like this PR. |
|
Actually, @mhvk, do you mind if we merge this now (the tests should be fixed with the last commit) and then you rebase over that with the changes for #4920? I think that might be easier because this PR includes some cleanup of #4890 that's not strictly related to the changes you're making. (And that way we can move the rest of this discussion into one place in #4920 |
|
Yes, I can rebase on this -- I do like the science state way of doing things. |
|
Alright, great. Once the tests pass I'll merge this (or you can feel free to do so yourself, @mhvk) |
|
(the one travis failure is a red herring): merging! |
| '/planets/de432s.bsp'): | ||
| de432_pluto = get_body(t, 'pluto') | ||
|
|
||
|
|
There was a problem hiding this comment.
That's one empty line too much here.
There was a problem hiding this comment.
Oops, you're right, thanks! I'll just fix this straight in master.
|
FWIW, I was wrong about it being a red herring - I just mis-read the logs. But it's not fixed by 2e8fe46 |
|
Ignore this. |
This implements a couple of the things I mentioned in #4890 (but were not really worth holding up the merge there). Specifically, it clarifies some of the documentation about this functionality, and it also adds a way to choose a specific URL to get the kernel from.
One mildly questionable bit - it seemed most natural to have it live in this module and not be outside visible, especially given that this is rather experimental. But if someone things this function should be public, I can certainly do that. It just seems a bit narrow for that.