diff --git a/docs/_static/basic_simulation_a_vs_t_plot.png b/docs/_static/basic_simulation_a_vs_t_plot.png new file mode 100644 index 000000000..6fec4c451 Binary files /dev/null and b/docs/_static/basic_simulation_a_vs_t_plot.png differ diff --git a/docs/user-guide/basic-simulation/index.rst b/docs/user-guide/basic-simulation/index.rst index 7b8d34463..32bd6ffaa 100644 --- a/docs/user-guide/basic-simulation/index.rst +++ b/docs/user-guide/basic-simulation/index.rst @@ -139,8 +139,8 @@ default name of ``data.nc``, which is a netCDF file. It is read in and stored as Here is an example of what the dataset looks like after the above simulation has been run:: - In [8]: sim.data - Out[8]: + In [5]: sim.data + Out[5]: Size: 229kB Dimensions: (time: 101, space: 3, name: 9) @@ -188,7 +188,18 @@ Here is an example of what the dataset looks like after the above simulation has j4rp4 (time) float64 808B -2.247e-18 -2.247e-18 ... -2.247e-18 +As you can see, even in this very simple example, the dataset contains a large amount of information about the simulated system. +For details about the definitions of *variables*, *dimensions*, and *coordinates*, see the +`Terminology `__. section of the Xarray documentation. Xarray +Datasets are very powerful and flexible, and can be used to analyze and visualize the simulation data in a variety of ways. +Here is an example where we can generate a simple plot of the semimajor axis vs. time history of all the planets in the system:: + + sim.data['a'].where(sim.data.particle_type != 'Central Body', drop=True).plot(x='time',hue='name') + +.. image:: ../../_static/basic_simulation_a_vs_t_plot.png + +This is just a simple example of what you can do with the simulation data. Xarray has a large number of built-in plotting and +data processing functions. For more information, see the `Xarray documentation `__. -.. toctree:: .. :maxdepth: 2 .. :hidden: diff --git a/swiftest/simulation_class.py b/swiftest/simulation_class.py index a7c2d0438..aec9d9d38 100644 --- a/swiftest/simulation_class.py +++ b/swiftest/simulation_class.py @@ -288,7 +288,7 @@ def __init__(self,read_param: bool = False, For instance, if the SFD of the collision would generated 300 fragments above the `minimum_fragment_mass`, then a value of `nfrag_reduction = 30.0` would reduce it to 10. Currently only used by the Fraggle collision model. - rotation : bool, default False + rotation : bool, default True If set to True, this turns on rotation tracking and radius, rotation vector, and moments of inertia values must be included in the initial conditions. This argument only applies to Swiftest-SyMBA simulations. It will be ignored otherwise.