California-Planet-Search / radvel

General Toolkit for Modeling Radial Velocity Data
http://radvel.readthedocs.io
MIT License
57 stars 52 forks source link

Orbit plots leave posterior object in an inconsistent state #335

Closed tronsgaard closed 3 years ago

tronsgaard commented 3 years ago

It took me a while to figure out what was going on here, but it turns out that MultiPanelPlot() changes the parameter basis to the synth basis without changing the basis name and updating the vector object. When I subsequently printed the posterior object, the posterior __repr__() method would call self.vector.dict_to_vector() and overwrite parameter values with the wrong numbers (in my particular case, e1=secosw1, w1=sesinw1, and tp1=tc1).

My proposed solution is (1) to properly update the parameter basis and vector object in the plotting routine and (2) take a deepcopy of the posterior object when plotting, such that the plot does not modify the input posterior object.

I hope this is useful!

All the best, René

bjfultn commented 3 years ago

Great, this sounds like a good solution and thank you for the contribution! I'm going to pull into a temporary branch on my side to allow the Travis tests to run.