Hi guys!
I have heavily modified the way I was implementing the gravitational model (EGM96 and 2008). It turns out that all the static models (in which the coefficients do not change with time) use the very same equations. Hence, now the interface is very generic and all the static models described by the gfc
files in ICGEM can, theoretically, be used (see the function parse_gfc
).
To simplify the usage, I decided to add the three most common models used in orbit propagators: EGM96, JGM3, and JGM2 (I did not add the EGM2008 because the full coefficients files have more than 50 MiB!). I simulated some scenarios in the online calculator at ICGEM and the gravity acceleration computation between the online tool and SatelliteToolbox.jl was matched with absolute tolerance of 5e-8
m/s^2.
Here is how you can compute gravitational acceleration in SatelliteToolbox.jl:
julia> coefs = load_gravity_model(EGM96());
julia> g = compute_g(coefs, GeodetictoECEF(-22*pi/180, -45*pi/180, 700))
3-element StaticArrays.SArray{Tuple{3},Float64,1,3}:
-6.43797
6.43797
3.66573
Now I have a question: the SatelliteToolbox.jl have now the geomagnetic field model IGRF, the atmospheric model NRLMSISE-00, and the gravity models. I am not entirely sure if this is the right thing to do, but what if I split those algorithms to something like EarthModels.jl ? What are the pros and cons?