Skip to content

Commit

Permalink
Small fixes to docs (tardis-sn#1716)
Browse files Browse the repository at this point in the history
* correcting and reformatting vpacket logging docs

* fixing bad docstring

* following docstring rules
  • Loading branch information
isaacgsmith authored Jul 15, 2021
1 parent 2ea5e9f commit 8260a5f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
33 changes: 24 additions & 9 deletions docs/io/output/vpacket_logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,37 @@ After running the simulation, the following information can be retrieved:
:header-rows: 1

* - Attribute of Simulation
- Type
- Description
* - ``virt_packet_logging``
- Boolean that shows if virtual packet logging is turned on
- Boolean
- Shows if virtual packet logging is turned on
* - ``runner.virt_packet_nus``
- List of virtual packet frequencies
- Numpy array
- Virtual packet frequencies
* - ``runner.virt_packet_energies``
- List of virtual packet energies
- Numpy array
- Virtual packet energies
* - ``runner.virt_packet_initial_mus``
- List of propagation directions that virtual packets are launched at
- Numpy array
- Propagation directions that virtual packets are launched at
* - ``runner.virt_packet_initial_rs``
- List of radii that virtual packets are launched at
- Numpy array
- Radii that virtual packets are launched at
* - ``runner.virt_packet_last_interaction_type``
- Type of interaction that caused the virtual packet to be spawned
- Numpy array
- | Type of interaction that caused the virtual packets to be spawned
| (enum, see :doc:`physical_quantities`)
* - ``runner.virt_packet_last_interaction_in_nu``
- The frequency the virtual packet was spawned at
- Numpy array
- Frequencies of the r-packets which spawned the virtual packet
* - ``runner.virt_packet_last_line_interaction_in_id``
- If the last interaction was a line interaction, the line_interaction_in_id for that interaction (see :doc:`physical_quantities`)
- Numpy array
- | If the last interaction was a line interaction, the
| line_interaction_in_id for that interaction
| (see :doc:`physical_quantities`)
* - ``runner.virt_packet_last_line_interaction_out_id``
- If the last interaction was a line interaction, the line_interaction_out_id for that interaction (see :doc:`physical_quantities`)
- Numpy array
- | If the last interaction was a line interaction, the
| line_interaction_out_id for that interaction
| (see :doc:`physical_quantities`)
18 changes: 13 additions & 5 deletions tardis/montecarlo/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,22 @@ def f_nu_to_f_lambda(self, f_nu):
return f_nu * self.frequency / self.wavelength

def plot(self, ax=None, mode="wavelength", **kwargs):
"""plots the TARDISSpectrum
"""
Plot the Spectrum
Parameters
----------
ax : matplotlib.axes.Axes, optional
axes to plot on, by default None
mode : str, optional
plot against wavelength or frequency, by default "wavelength"
ax : matplotlib.axes._subplots.AxesSubplot or None, optional
Axis on which to create plot. Default value is None which will
create plot on a new figure's axis.
mode : {'wavelength', 'frequency'}, optional
Quantity to plot spectrum against, either 'wavelength' or
'frequency'. Default value is 'wavelength'.
**kwargs : dict, optional
``matplotlib.lines.Line2D`` properties to style the plot: refer to
`matplotlib documentation
<https://matplotlib.org/stable/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D>`_
for a list of all possible arguments.
"""
if ax is None:
from matplotlib.pyplot import gca
Expand Down

0 comments on commit 8260a5f

Please sign in to comment.