Ask Your Question

Evaluating the tangent vector of a previously saved and loaded integrated geodesic

asked 2022-04-26 11:33:08 +0200

Bubbz gravatar image

I am trying to figure out how to load a previously computed and saved integrated geodesic and find the tangent vector using geod.tangent_vector_eval_at at a later time. The problem is that i can not seem to find a way to refer a solution_key= to the solution after i've loaded it in order to interpolate it. Is there a way to do that at a time different than the one that the solution is being computed? Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-02 15:02:19 +0200

kva gravatar image

Hello Bubbz, thank you for your question. It seems indeed that the contents of the attributes _solutions and _interpolations of geod are lost in the process save/load, although all the other attributes are well preserved (e.g. _initial_tangent_vector or _parameters).

In the case of the attribute _interpolations, this seems to be expected because pickling does not work on Spline objects: calling e.g. save(geod._interpolations, "geod_interps.sobj") yields the error message TypeError: cannot pickle 'sage.calculus.interpolation.Spline' object.

In the case of the attribute _solutions, the reason why it is lost is probably tricky, as this is easily worked around with the idea above: you could save and reload the attribute _solutions independently from geod itself, by executing e.g. save(geod._solutions, "geod_sols.sobj"), so that you could execute geod._solutions = load("geod_sols.sobj") after having reloaded geod itself at any later time.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-04-26 11:33:08 +0200

Seen: 148 times

Last updated: May 02 '22