The command line interface

/tmp/ipykernel_5371/1180289843.py:5: DeprecationWarning: `set_matplotlib_formats` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.set_matplotlib_formats()`
  set_matplotlib_formats('retina')

Overview

If you are in the directory of a completed vplanet simulation, you can use the command-line function vplot to generate plots of any/all of the simulated quantities as a function of time.

Let’s run vplot on the CircumbinaryOrbit example. If we are in that directory, we can simply run

vplot

This should cause the following figures to pop up:

WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

Note

You must actually run vplanet before calling vplot!

By default, parameters are grouped by parameter name. This means that if there are multiple bodies with the same parameter, they will all show up in the same plot, with labels indicating the body they correspond to. We can disable grouping by running

vplot -g none
WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

Alternatively, we can group by physical type. This means that everything that is an angle will be grouped into one plot, everything that has units of distance will be grouped into a different plot, and so forth. It isn’t always useful, particularly if you have lots of parameters of the same physical type (as is the case here).

vplot -g type
WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

Useful options

We can plot only specific parameters:

vplot -p eccentricity cbpr
WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

And we can plot only specific bodies:

vplot -p eccentricity cbpr -b earth
WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

Note

Body and parameter names are case-insensitive, but otherwise they must match the values in the .in files exactly. Note that the parameter names are those specified in the saOutputOrder line of the .in files.

We can also plot things logarithmically:

vplot -p eccentricity cbpr -b earth --xlog
WARNING: AstropyDeprecationWarning: support for accessing str attributes such as 'title' from PhysicalType instances is deprecated since 4.3 and will be removed in a subsequent release. [astropy.units.physical]

Finally, you can run

vplot --help

to view all available options:

usage: vplot [-h] [-g GROUP] [-b [BODIES [BODIES ...]]]
             [-p [PARAMS [PARAMS ...]]] [--xlog] [--ylog]
             [--figsize FIGSIZE FIGSIZE]

optional arguments:
  -h, --help            show this help message and exit
  -g GROUP, --group GROUP
                        What to group plots by (param | type | none)
  -b [BODIES [BODIES ...]], --bodies [BODIES [BODIES ...]]
                        Which bodies to plot
  -p [PARAMS [PARAMS ...]], --params [PARAMS [PARAMS ...]]
                        Which parameters to plot
  --xlog                Logarithmic x axes?
  --ylog                Logarithmic y axes?
  --figsize FIGSIZE FIGSIZE
                        Figure size in inches