Skip to content

Commit

Permalink
switched to pydata theme
Browse files Browse the repository at this point in the history
  • Loading branch information
freemansw1 committed Nov 15, 2024
1 parent 0ebee82 commit 5ec92e6
Show file tree
Hide file tree
Showing 57 changed files with 225 additions and 179 deletions.
23 changes: 21 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# This is the standard readthedocs theme.
import sphinx_rtd_theme
import pydata_sphinx_theme
import sys, os

sys.path.insert(0, os.path.abspath("extensions"))
Expand All @@ -23,12 +23,31 @@
]


html_theme = "sphinx_rtd_theme"
html_theme = "pydata_sphinx_theme"

html_static_path = ["_static"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


html_theme_options = {
"logo": {
"image_light": "images/tobac-logo-colors.png",
"image_dark": "images/tobac-logo-colors.png",
},
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/header-links.html#fontawesome-icons
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/tobac-project/tobac",
"icon": "fa-brands fa-github",
},
],
"navbar_start": ["navbar-logo"],
"navbar_align": "content",
"header_links_before_dropdown": 5,
}


project = "tobac"

master_doc = "index"
Expand Down
2 changes: 2 additions & 0 deletions doc/code_reviews.rst → doc/developer_guide/code_reviews.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _code-reviews:

Code reviews
------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Code structure and key design concepts
.. _code_structure:

Code structure and key design concepts
--------------------------------------

==================================
Expand Down
120 changes: 64 additions & 56 deletions doc/contributing.rst → doc/developer_guide/index.rst

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions doc/mentoring.rst → doc/developer_guide/mentoring.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _mentoring:

Mentoring and Collaboration
----------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _testing-sphinx-rendering:

How to check the Sphinx-based rendering
---------------------------------------

Expand Down
35 changes: 0 additions & 35 deletions doc/examples.rst

This file was deleted.

4 changes: 1 addition & 3 deletions doc/data_input.rst → doc/getting_started/data_input.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
..
Description of the input data required.
.. _data_input:

Data Input
==========
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _feature-detection-overview:
.. _feature_detection_overview:

Feature Detection Basics
------------------------
Expand All @@ -11,7 +11,7 @@ The feature detection is the first step in using **tobac**.

Features are identified as regions above or below a sequence of subsequent thresholds (if searching for eather maxima or minima in the data). Subsequently more restrictive threshold values are used to further refine the resulting features and allow for separation of features that are connected through a continuous region of less restrictive threshold values.

.. image:: images/detection_multiplethresholds.png
.. image:: ./images/detection_multiplethresholds.png
:width: 500 px

**Current development:**
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
20 changes: 20 additions & 0 deletions doc/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
##########################
Getting Started
##########################

.. toctree::
:maxdepth: 3
:hidden:

installguide
data_input
feature_detection_overview
tracking_basics
segmentation
merge_split
plotting



Welcome to *tobac*! We hope that you will find this tracking library to be useful in your research or operational work. To help you get started, we have put together this quickstart guide with some of the basic information you need to know to get started tracking your data with *tobac*.

3 changes: 3 additions & 0 deletions doc/installation.rst → doc/getting_started/installguide.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.. _installguide:

Installation
------------

tobac works with Python 3 installations.

The easiest way is to install the most recent version of tobac via conda or mamba and the conda-forge channel:
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions doc/plotting.rst → doc/getting_started/plotting.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. _plotting:

Plotting
========

tobac provides functions to conveniently visualise the tracking results and analyses.
File renamed without changes.
14 changes: 8 additions & 6 deletions doc/linking.rst → doc/getting_started/tracking_basics.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Linking
-------
.. _tracking-basics:

Tracking Basics
---------------
Currently implemented options for linking detected features into tracks:

**Trackpy:**

This method uses the trackpy library (http://soft-matter.github.io/trackpy).
This approach only takes the point-like position of the feature, e.g. determined as the weighted mean, into account. Features to link with are looked for in a search radius defined by the parameters v_max or d_max. The position of the center of this search radius is determined by the method keyword. method="random" uses the position of the current feature (:math:`t_i`), while method="predict" makes use of the information from the linked feature in the previous timestep (:math:`t_{i-1}`) to predict the next position. For a simple case the search radii of the two methods look like this:

.. image:: images/linking_prediction.png
.. image:: ./images/linking_prediction.png
:width: 500 px

If there is only one feature in the search radius, the linking can happen immediately. If there are none, the track ends at this timestep. If there are more options, trackpy performs a decision process. Assume there are :math:`N` features in the current and also :math:`N` in the next timeframe and they are all within each search radius. This means there are :math:`N!` options for linking. Each of these options means that :math:`N` distances between the center of the search radius of a current feature and a feature from the next time frame :math:`\delta_n, n=1, 2, ..., N` are traveled by the features. Trackpy will calculate the sum of the squared distances
Expand All @@ -18,15 +20,15 @@ If there is only one feature in the search radius, the linking can happen immedi
For every option the lowest value of this sum is used for linking. As an example, consider these two crossing features:

.. image:: images/cross.png
.. image:: ./images/cross.png
:width: 500 px

If the search radius is chosen large enough, each will contain two options, a horizontal and a diagonal feature:

.. image:: images/search.png
.. image:: ./images/search.png
:width: 500 px

The linking will look differently for both methods in the end. The horizontal features are closer to the current position than the diagonal ones. This is why these are linked by the "random"-method. On the other hand, the diagonal features lie excatly on the guessed positions for the "predict"-method. This means, that the sum of squared distances is 0 and they are the optimal decision for linking in this case:

.. image:: images/decision.png
.. image:: ./images/decision.png
:width: 500 px
Binary file added doc/images/tobac-logo-colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 9 additions & 54 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
tobac - Tracking and Object-Based Analysis of Clouds
-------------------------------------------------------



**tobac** is a Python package to rapidly identify, track and analyze clouds in different types of gridded datasets, such as 3D model output from cloud-resolving model simulations or 2D data from satellite retrievals.

The software is set up in a modular way to include different algorithms for feature identification, tracking, and analyses. **tobac** is also input variable agnostic and doesn't rely on specific input variables, nor a specific grid to work.

Individual features are identified as either maxima or minima in a 2D or 3D time-varying field (see :doc:`feature_detection_overview`). An associated volume can then be determined using these features with a separate (or identical) time-varying 2D or 3D field and a threshold value (see :doc:`segmentation`). The identified objects are linked into consistent trajectories representing the cloud over its lifecycle in the tracking step. Analysis and visualization methods provide a convenient way to use and display the tracking results.
Individual features are identified as either maxima or minima in a 2D or 3D time-varying field (see :doc:`getting_started/feature_detection_overview`). An associated volume can then be determined using these features with a separate (or identical) time-varying 2D or 3D field and a threshold value (see :doc:`getting_started/segmentation`). The identified objects are linked into consistent trajectories representing the cloud over its lifecycle in the tracking step. Analysis and visualization methods provide a convenient way to use and display the tracking results.

Version 1.2 of tobac and some example applications are described in a peer-reviewed article in Geoscientific Model Development as:

Expand All @@ -21,68 +23,21 @@ Sokolowsky, G. A., Freeman, S. W., Jones, W. K., Kukulies, J., Senf, F., Marines

The project is currently being extended by several contributors to include additional workflows and algorithms using the same structure, syntax, and data formats.

.. toctree::
:caption: Basic Information
:maxdepth: 2

installation
data_input
analysis
plotting
big_datasets
examples
publications

.. toctree::
:caption: Feature Detection
:maxdepth: 2

feature_detection_overview
threshold_detection_parameters
feature_detection/index
feature_detection_output

.. toctree::
:caption: Segmentation
:maxdepth: 2

segmentation
segmentation_parameters
segmentation_output
features_without_segmented_area
transform_segmentation

.. toctree::
:caption: Tracking
:maxdepth: 2

linking
tracking_output

.. toctree::
:caption: Merge/Split
:maxdepth: 2
:hidden:

merge_split

getting_started/index
examples/index
userguide/index
developer_guide/index

.. toctree::
:caption: Developer guide
:maxdepth: 3

code_structure
contributing
code_reviews
mentoring

.. toctree::
:caption: Compute bulk statistics
:maxdepth: 2

bulk_statistics/index

.. toctree::
:caption: API Reference
:maxdepth: 3
:hidden:

tobac
2 changes: 1 addition & 1 deletion doc/tobac.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tobac package
API Documentation
=============

Submodules
Expand Down
6 changes: 2 additions & 4 deletions doc/analysis.rst → doc/userguide/analysis.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
..
Documentation of analysis functions
TODO: include descriptions of the analysis functions and examples
.. _analysis-functions:

Analysis
=========
========
tobac provides several analysis functions that allow for the calculation of important quantities based on the tracking results. This includes the calculation of properties such as feature lifetimes and feature areas/volumes, but also allows for a convenient calculation of statistics for arbitrary fields of the same shape as as the input data used for the tracking analysis.
2 changes: 2 additions & 0 deletions doc/big_datasets.rst → doc/userguide/big_datasets.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _handling-big-datasets:

Handling Large Datasets
-------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _bulk-statistics:

##########################
Compute bulk statistics
##########################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
.. _feature-detection-output:

Feature Detection Output
-------------------------

Feature detection outputs a `pandas` dataframe with several variables. The variables, (with column names listed in the `Variable Name` column), are described below with units. Note that while these variables come initially from the feature detection step, segmentation and tracking also share some of these variables as keys (e.g., the :code:`feature` acts as a universal key between each of these). See :doc:`tracking_output` for the additional columns added by tracking.

Variables that are common to all feature detection files:

.. csv-table:: tobac Feature Detection Output Variables
.. csv-table:: `tobac` Feature Detection Output Variables
:file: ./feature_detection_base_out_vars.csv
:widths: 3, 35, 3, 3
:header-rows: 1

Variables that are included when using 3D feature detection in addition to those above:

.. csv-table:: tobac 3D Feature Detection Output Variables
.. csv-table:: `tobac` 3D Feature Detection Output Variables
:file: ./feature_detection_3D_out_vars.csv
:widths: 3, 35, 3, 3
:header-rows: 1


One can optionally get the bulk statistics of the data points belonging to each feature regiion or volume. This is done using the `statistics` parameter when calling :ufunc:`tobac.feature_detection_multithreshold` . The user-defined metrics are then added as columns to the output dataframe.
One can optionally get the bulk statistics of the data points belonging to each feature region or volume. This is done using the `statistics` parameter when calling :ufunc:`tobac.feature_detection_multithreshold` . The user-defined metrics are then added as columns to the output dataframe.


Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _features-without-segmented-area:

Features without segmented areas
--------------------------------------

Expand All @@ -16,7 +18,7 @@ If the segmentation threshold is lower (assuming `target='minimum'`) than the hi

Consider for example the following data with 5 being the highest threshold specified for the Feature Detection (see :doc:`feature_detection_overview`):

.. image:: images/features_without_segment.png
.. image:: ./images/features_without_segment.png
:width: 500 px

If the segmentation threshold is larger than 5 (e.g. `threshold = 6`), the segmented area contains all values <= 5 (still assuming `target='minimum'`), no matter if the detected feature has a threshold lower than 5 (upper panels) or if it is exactly equal to 5 and does not contain any features with lower thresholds inside (lower panels).
Expand All @@ -32,7 +34,7 @@ Case 2: Feature position

Another reason for features that do not have a segmented area associated with them is the rare but possible case when the feature position is located outside of the threshold area:

.. image:: images/feature_outside_of_threshold_area.png
.. image:: ./images/feature_outside_of_threshold_area.png
:width: 500 px


Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
21 changes: 21 additions & 0 deletions doc/userguide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##########################
User Guide
##########################

.. toctree::
:maxdepth: 3
:hidden:

feature_detection_output
threshold_detection_parameters
feature_detection/index
segmentation_output
segmentation_parameters
tracking_output
bulk_statistics/index
transform_segmentation
big_datasets
features_without_segmented_area
publications
analysis

Loading

0 comments on commit 5ec92e6

Please sign in to comment.