Skip to content

Commit 38ee91c

Browse files
authored
Merge pull request #4 from robjmcgibbon/soap_docs
Update soap docs
2 parents c9fc7e8 + e185130 commit 38ee91c

14 files changed

Lines changed: 2636 additions & 1766 deletions

source/_static/custom.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,14 @@ nav img.flamingo_logo {
121121
vertical-align:middle;
122122
margin-right:0.7rem;
123123
}
124+
125+
/*
126+
Hide the page contents sidebar generated by the Piccolo sphinix
127+
theme, since we display page contents in the left sidebar.
128+
*/
129+
#right_sidebar {
130+
display: none;
131+
}
132+
#show_right_sidebar {
133+
display: none;
134+
}

source/_templates/localtoc.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Set the title of the "Page contents" section in the sidebar -->
2+
{% if display_toc %}
3+
<div class="sidebar-localtoc">
4+
<p class="caption" role="heading">Page Contents</p>
5+
{{ toc }}
6+
</div>
7+
{% endif %}

source/conf.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
from docutils import nodes
6+
from sphinx.application import Sphinx
57

68
# -- Project information -----------------------------------------------------
79
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -18,6 +20,13 @@
1820
templates_path = ['_templates']
1921
exclude_patterns = []
2022

23+
html_sidebars = {
24+
"**": [
25+
"globaltoc.html", # Site contents
26+
"localtoc.html", # Page contents
27+
]
28+
}
29+
2130

2231

2332
# -- Options for HTML output -------------------------------------------------
@@ -62,3 +71,31 @@
6271
'https://unpkg.com/@highlightjs/cdn-assets@11.11.1/languages/python.min.js',
6372
'https://unpkg.com/@highlightjs/cdn-assets@11.11.1/languages/yaml.min.js',
6473
]
74+
75+
76+
# Coloured inline roles for the SOAP property table.
77+
def _highlight_role(background):
78+
"""Return a docutils role function that wraps text in a highlighted <span>."""
79+
80+
def role(name, rawtext, text, lineno, inliner, options=None, content=None):
81+
style = (
82+
f"background-color: {background};"
83+
" color: black;"
84+
" padding: 1px 4px;"
85+
" border-radius: 3px;"
86+
" font-family: monospace;"
87+
)
88+
html = f'<span style="{style}">{text}</span>'
89+
# raw() node so the HTML passes through unchanged; latex() node is a
90+
# plain-text fallback for PDF builds.
91+
node = nodes.raw("", html, format="html")
92+
latex_node = nodes.raw("", text, format="latex")
93+
return [node, latex_node], []
94+
95+
return role
96+
97+
98+
def setup(app: Sphinx):
99+
app.add_role("avail", _highlight_role("#c8e6c9")) # light green
100+
app.add_role("snaponly", _highlight_role("#bbdefb")) # light blue
101+
app.add_role("unavail", _highlight_role("#ffcdd2")) # light red

source/snapshots/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The following sections describe the layout and contents of the snapshots.
4040
Output redshifts <snapshot_redshifts>
4141
Particle properties <snapshot_particle_properties>
4242
Reading with swiftsimio <swiftsimio.rst>
43+
Partial snapshots <snapshot_partial>
4344

4445
For more information about the SWIFT simulation snapshot format used
4546
here, see the `SWIFT documentation
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Partial snapshots
2+
=================
3+
4+
Alongside the full particle snapshots, we have retained partial snapshots for all of the original outputs (see :doc:`snapshot_redshifts` for the list). There are two kinds of partial snapshots. Both kinds have the same file format as the original snapshots, and can be opened using
5+
`swiftsimio
6+
<https://swiftsimio.readthedocs.io/en/latest/loading_data/index.html>`__.
7+
8+
Downsampled snapshots
9+
---------------------
10+
11+
For the downsampled snapshots at each output we select a random 1% of particles to keep (not the same 1% for each output). All black hole particles have been retained. The following fields are available for each particle type, with the description for each the same as in the
12+
:doc:`full snapshots <snapshot_particle_properties>`.
13+
14+
.. note:: Masses (except for black hole masses) have been rescaled by a factor of 100 to conserve the total mass within the snapshot.
15+
16+
.. list-table::
17+
:header-rows: 1
18+
19+
* - Particle Type
20+
- Included Fields
21+
* - Gas
22+
- ``ComptonYParameters``, ``Coordinates``, ``Masses``, ``Velocities``
23+
* - Dark matter
24+
- ``Coordinates``, ``Masses``, ``Velocities``
25+
* - Stars
26+
- ``Coordinates``, ``Masses``, ``Velocities``
27+
* - Black holes
28+
- ``Coordinates``, ``DynamicalMasses``, ``SubgridMasses``, ``Velocities``
29+
* - Neutrinos
30+
- ``Coordinates``, ``Masses``, ``SampledSpeeds``, ``Velocities``, ``Weights``
31+
32+
TODO: Add a link to an example downsampled snapshot directory
33+
34+
Reduced snapshots
35+
-----------------
36+
37+
The reduced snapshots contains all the particles within the :math:`R_{100c}` radius of a selection of massive halos. Within the SOAP catalogues each subhalo has a flag ``SOAP/IncludedInReducedSnapshot`` which indicates whether its particles are included in the reduced snapshot. To pick these halos we define a set of :math:`M_{200c}` halo mass bins of width 0.05 dex, with the lowest mass bin starting at :math:`M_{200c}=10^{13} M_\odot`. If a bin has less than 200 halos then we include all of them in the reduced snapshot, if not then we include a random 200.
38+
39+
All of the properties available in the :doc:`full snapshots <snapshot_particle_properties>` are present in the reduced snapshots.
40+
41+
TODO: Add a link to an example reduced snapshot directory

0 commit comments

Comments
 (0)