Closed helgee closed 5 years ago
Excellent idea! This should be easy. In fact, I have one proposal. See if this is good:
parse_gfc
will create a new structure called GFC
probably with the header information stored in Dict
.compute_u
and compute_g
function will use the coefficients, leading to a fast algorithm.One question (the website is still down): the algorithm used to compute the gravitational force in other celestial bodies is precisely the same as the one we have now right? In this case, we can have a very general function to compute this.
One question (the website is still down): the algorithm used to compute the gravitational force in other celestial bodies is precisely the same as the one we have now right? In this case, we can have a very general function to compute this.
Yes 👍
When the website is back I will check what kind of differences can be expected.
Hi @helgee !
I found this specification for the GFC files:
http://icgem.gfz-potsdam.de/ICGEM-Format-2011.pdf
I will try to implement this. It should be a little difficult because it is also used for models that consider tides. Hence, if I do this, we will have a very generic system to compute gravitational forces!
Hi @helgee
This problem should be fixed in master
now. You can parse your file (with FORTRAN numbers, and gravity_constant
header instead of earth_gravity_constant
) using:
G = create_gravity_models_coefs(parse_icgem(filename))
Then, you can use the coefficients in G
to compute the gravity with the function compute_g
.
Please, let me know if this works!
I have successfully used the
parse_gfc
function to parse a lunar gravity field. But I had to massage the file a little to make it work, e.g. change some constant from Fortran-style1D+0.0
to normal scientific notation and changegravity_constant
in the header toearth_gravity_constant
.Could the parser be made more generic so that it handles other celestial bodies (or rather non-standard GFC files)? These can be found here for example (if the website is not down, as it is now).