-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using SPICE files for ephemeris #1
Comments
Hey, your library looks promising! Currently the data gets stored in a json file which can be edited with the external UI I made. Feel free create a PR integrating your library if you want! |
Hey, @ChristopherRabotin. I'm currently working on an editor and integrating ANISE. Here is what I got so far with the ANISE integration: Screencast_20241003_133726.webmI have some questions as I'm not that familiar with SPICE files:
Here is the majority of the integration: https://github.com/jan-tennert/SolarSim/blob/main/src/simulation/components/anise.rs |
Hi Jan, This demo looks GREAT! I'm really looking forward to seeing more of it. Now, let me answer your questions:
let iau_moon_frame = almanac.frame_from_uid(IAU_MOON_FRAME).unwrap();
println!("{}", iau_moon_frame.shape.unwrap()); You can find an example of how this is used here: https://docs.rs/anise/0.4.2/src/anise/astro/orbit_geodetic.rs.html#199-228 . Note that I'm referencing the docs from two releases ago because of nyx-space/anise#302.
Let me know if I can support your effort. |
Thank you! video.mp4 |
Hi Jan, I agree, that looks odd. I think that the parent of the IAU Mars frame is the J2000 frame, and that frame is roughly aligned with the rotation axis of the Earth on 01 Jan 2000. The solar system axis is the J2000 Ecliptic frame. You can use either the rotate function (previously called rotate_from_to, cf https://docs.rs/anise/0.4.2/anise/almanac/struct.Almanac.html#method.rotate_from_to) or you can composé thé rotation matrix with the built-in angle: https://docs.rs/anise/0.4.2/anise/constants/orientations/constant.J2000_TO_ECLIPJ2000_ANGLE_RAD.html. Let me know if that looks better, I think it will. |
Yea thanks, I think that works: 2024-10-07.20-05-07.mp4Btw, is there a way to unload loaded SPK files? I couldn't find such method |
Holy cow this looks amazing! You even have terrain models on the Earth from what I can tell from the shadows! NASA also published very details terrain models of the Moon (and a few other objects) if you're interested (I think the LDEM model is the best DTM for the Moon, but I'm not sure). I don't think that it's currently possible to unload an SPK file. What I usually do is simply let the SPK fall out of scope and Rust will clear the memory automatically. I think you can also access the almanac as mutable and replace the SPK you want to unload with |
Thank you very much for your help! I'm currently used the 3D models published by NASA, but I'll investigate the LDEM models! |
Feature request
Instead of relying on downloading data from HORIZONS, I recommend using ANISE, which is a pure-rust SPICE interface to read ephemeris data from SPICE files. I'd be thrilled to help with that integration, especially given that I have yet to write thorough documentation for ANISE.
For reference, HORIZON uses the SPICE files under the hood, so switching to ANISE would work the same with, but one would only need to load the data from a local copy or from the public S3 bucket I have setup.
The text was updated successfully, but these errors were encountered: