gandalfcode / gandalf

GANDALF (Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids)
GNU General Public License v2.0
44 stars 12 forks source link

More general implementation of plot vs time functions in Python? #14

Closed dhubber closed 10 years ago

dhubber commented 10 years ago

Should we implement a more general form of the plot vs time functions in the python code? For example, one feature of seren_view was the ability to plot tracks (e.g. how a star moved in x-y space) to add to plots and view orbits. Should the plot vs time function allow us to give two arguments, xvar and yvar, so we could return two arrays of these quantities? If a regular plot of a quantity versus time is needed (e.g. sink mass versus time), then this can be achieved by setting xvar = t.

giovanni-rosotti commented 10 years ago

This is now implemented (300983c). The function has been renamed to time_plot, and it takes two main arguments rather than just one. One of them can be 't' in case one wants to go back to the previous functionality. This same command allows to plot quantities as a function of time, as well as tracks. I also removed the plot_vs_time_quantity_particle function; if the quantity is not defined, time_plot will try to define it on the fly (it needs the id argument for that)