-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
SPICE BSP files should be usable without needing the ANISE file equivalent #30
Comments
I will make sure the list of SPK-related selected functions are supported in the wrapper. |
The latest update can load SPK and BPC data using Since the SPICE context only has pointers to the data, the size on the stack remains the same:
Associated code: let spice = SpiceContext::default();
let spice = spice.furnsh_spk("de421", &de421).unwrap();
println!("{:?}", spice.spk_lut);
// Now load another DE file
// WARNING: Rust won't allow us to load this other file in a scope and then unload it!
{
let bytes = file_mmap!("data/de440.bsp").unwrap();
let de440 = DAFBytes::<SPKSummaryRecord>::parse(&bytes).unwrap();
// NOTE: We assign the output because `furnsh_*` will return a clone of (pointers) of the already loaded context.
// This might sound counter intuitive but it allows the data to be loaded in a given scope and also dropped when that scope is gone.
let spice = spice.furnsh_spk("de440", &de440).unwrap();
// And another
let bytes = file_mmap!("data/de438s.bsp").unwrap();
let de440 = DAFBytes::<SPKSummaryRecord>::parse(&bytes).unwrap();
let spice = spice.furnsh_spk("de438s", &de440).unwrap();
println!("{:?}", spice.spk_lut);
println!("{}", size_of_val(&spice));
}
println!("{:?}", spice.spk_lut);
println!("{}", size_of_val(&spice)); |
Use case
Although the ANISE file format provides a number of advantages compared to the BSP files, requiring users to convert their data into ANISE before using this library is a large overhead.
Effort
ANISE.rs already supports reading BSP files of some types. However, that implementation requires memory allocations. These should not be required.
Hence, the crux of this issue is to rewrite the SPK parser to not perform any memory allocations. This issue also includes providing a rewrite of some of the SPK related functions (exact list to be determined from this list). These functions must be behind a specific crate feature, e.g.
spice-interop
.Verification
TDB: from the list of functions above, the tests should require
rust-spice
by @GregoireHENRY and make sure that the SPK functions selects return the same values. This will likely require #26 too.The text was updated successfully, but these errors were encountered: