PerezHz / PlanetaryEphemeris.jl

Solar System ephemeris Taylor integrator based on JPL DE430/431 dynamical model
Other
20 stars 6 forks source link

Change JLD for JLD2 #3

Closed LuEdRaMo closed 1 year ago

LuEdRaMo commented 1 year ago

PlanetaryEphemeris uses JLD to save the ephemeris. However, two tests that show that JLD2 could be a considerable improvement with respect to JLD. For instance:

Size of full ephemeris file

Time it takes to load the full ephemeris file

A disadvantage of JLD2 is that it has no analog of JLD.addrequire. However, if both TaylorSeries and PlanetaryEphemeris are loaded, I've found there is no lost information.

lbenet commented 1 year ago

I don't quite recall, but it was perhaps JLD.addrequire which motivated @PerezHz to take JLD over JLD2... Any comments @PerezHz?

Regarding this, a very naive question: if you start a brand new Julia session, and only load TaylorSeries and PlanetaryEphemeris (i.e., using TaylorSeries, PlanetaryEphemeris), do you have to set the parameters of the file (with set_variables) before loading the file, or it is somehow included in the file (by JLD.addrequire)?

lbenet commented 1 year ago

See https://github.com/JuliaIO/JLD2.jl/issues/39

LuEdRaMo commented 1 year ago

Since PlanetaryEphemeris uses Taylor1, it is not necessary to set the variables before loading the file. However in a library like NEOs, which uses jet transport and Taylor1{TaylorN}, it is mandatory to set the variables before loading the file; that information is not included in the file.

lbenet commented 1 year ago

Thanks for the correction... The question is how to include that info within the jld2 (or jld) file to have everything consistent? A proposal that would fit with JLD.addrequire is to add a new struct which includes all those constants, and somehow, by instantiating it, all parameters are properly set.

PerezHz commented 1 year ago

I don't quite recall, but it was perhaps JLD.addrequire which motivated @PerezHz to take JLD over JLD2... Any comments @PerezHz?

The main reason to use JLD was to guarantee lossless saving and loading of data (and thus aid reproducibility); but I agree that JLD2 is more performant, so if data loss is small, then maybe it makes sense to use JLD2 instead of JLD