Skip to content

Commit

Permalink
Documentation improvements, link to format page, format code block pr…
Browse files Browse the repository at this point in the history
…operly
  • Loading branch information
mef51 committed Dec 17, 2024
1 parent 5fc227c commit 017b4f4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
49 changes: 28 additions & 21 deletions arrivaltimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,19 @@ def measureburst(
):
""" Measure spectro-temporal properties of a burst, and output a figure
Compute the inverse sub-burst slope (dt/dnu) using the per-row arrival time method
Compute the inverse sub-burst slope (dt/dnu) using the per-row arrival time method.
Compute the duration and bandwidth by finding a 1-dimensional gaussian model
to the integrated time series and spectrum, respectively. The duration and bandwidth are the
1 sigma widths of either fit.
Compute the center frequency as the center of the 1d spectrum model
to the integrated time series and spectrum, respectively.
The duration and bandwidth are the 1 sigma widths of either fit.
Compute the center frequency as the center of the 1d spectrum model.
If multiple components are present, split them up and measure individually. The number
of components to fit for is equal to ``len(xos)``
of components to fit for is equal to ``len(xos)``.
Args:
filename (str): filename to npz of a *dedispersed* burst waterfall. Conforms to frbgui's burst format.
filename (str): filename to .npz of a *dedispersed* burst waterfall. File is expected to follow frbgui's :ref:`burstformat`.
xos (List[float] or 2-tuple of List[float], optional): List of times in ms of sub-burst centers.
Can be approximate. If a 2-tuple, the second list is used as the location(s) to cut the waterfall.
Using the ``cuts`` option instead is equivalent to using the 2 tuple option.
Expand Down Expand Up @@ -323,24 +325,29 @@ def measureburst(
(list): ``results`` list of lists where each list is the result of the measurement.
This array can be used to make a pandas dataframe in the following way:
``resultsdf = pd.DataFrame(data=results, columns=arrivaltimes.results_columns).set_index('name')``
.. code-block:: python
resultsdf = pd.DataFrame(
data=results,
columns=arrivaltimes.results_columns
).set_index('name')
where the columns of the dataframe are
``
'name',
'DM',
'center_f (MHz)',
'center_f_err',
'duration (ms)',
'duration_err',
'bandwidth (MHz)',
'bandwidth_err',
'dtdnu (ms/MHz)',
'dtdnu_err',
'tb (ms)', # t_b
'tb_err'
``
.. code-block:: python
'name',
'DM',
'center_f (MHz)',
'center_f_err',
'duration (ms)',
'duration_err',
'bandwidth (MHz)',
'bandwidth_err',
'dtdnu (ms/MHz)',
'dtdnu_err',
'tb (ms)', # t_b
'tb_err'
arrtimesdf (pd.DataFrame): Only returned when `return_arrivaltimes` is True.
fig (matplotlib.fig): Matplotlib figure. Only returned when `return_fig` is True.
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@
html_extra_path = ['tutorials/files']
html_css_files = ['style.css']

pygments_style = 'sphinx'
2 changes: 1 addition & 1 deletion docs/documentation/doc-arrivaltimes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To perform measurements using the arrival times method rather than the Gaussian
import arrivaltimes
The ``arrivaltimes`` module is largely independent from the rest of FRBGUI and can be used solely through scripting. The function ``arrivaltimes.measureburst`` is the main entry point into the module and performs most of the work of measurement. The module can display an interactive plot window to help with marking bursts, masking channels, and determining initial guesses through ``measureburst``'s ``show`` option.
The ``arrivaltimes`` module is largely independent from the rest of FRBGUI and can be used solely through scripting. The function :func:`arrivaltimes.measureburst <arrivaltimes.measureburst>` is the main entry point into the module and performs most of the work of measurement. The module can display an interactive plot window to help with marking bursts, masking channels, and determining initial guesses through ``measureburst``'s ``show`` option.


``arrivaltimes`` module
Expand Down

0 comments on commit 017b4f4

Please sign in to comment.