Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch '4-write-a-basic-test-simulation-and-user-guide-for-sphe…
Browse files Browse the repository at this point in the history
…rical-harmonics-use' of github.com:MintonGroup/swiftest into 4-write-a-basic-test-simulation-and-user-guide-for-spherical-harmonics-use
  • Loading branch information
anand43 committed Mar 1, 2024
2 parents c927be7 + 13d460e commit 03c4a56
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Binary file added docs/_static/basic_simulation_a_vs_t_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions docs/user-guide/basic-simulation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
<xarray.Dataset> Size: 229kB

Dimensions: (time: 101, space: 3, name: 9)
Expand Down Expand Up @@ -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 <https://docs.xarray.dev/en/stable/user-guide/terminology.html>`__. 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 <https://docs.xarray.dev/en/stable/>`__.

.. toctree::
.. :maxdepth: 2
.. :hidden:
2 changes: 1 addition & 1 deletion swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 03c4a56

Please sign in to comment.