Skip to content
Snippets Groups Projects
Commit 2ac15bb0 authored by Christopher Polster's avatar Christopher Polster
Browse files

Move quickstart instructions into pipeline description

parent 9e392283
No related branches found
No related tags found
1 merge request!2Start with Sphinx-generated Documentation
......@@ -3,8 +3,11 @@ Threshold-based Features
Identifiy features that fall above or below a or multiple threshold(s).
.. note::
The threshold-based identification strategies require `numba <https://numba.pydata.org/>`_ to be installed.
Identification techniques
Identification Strategies
-------------------------
.. autoclass:: enstools.feature.identification.threshold.DoubleThresholdIdentification
......
......@@ -16,11 +16,13 @@ Content
:maxdepth: 1
installation
quickstart
pipeline
identification
tracking
A quickstart example is provided in the description of the feature pipeline.
Output formats are described on the overview pages of the identification and tracking sub-modules.
Acknowledgment and license
--------------------------
......
Feature Pipeline
================
...
TODO: Workflow description here.
Usage Example
-------------
TODO
.. code-block:: python
from enstools.feature import FeaturePipeline
from enstools.feature.identification.STRATEGY import SomeIdentification
from enstools.feature.tracking.STRATEGY import SomeTracking
# Configure suitable identification and tracking strategies
ident_tech = SomeIdentification(...)
track_tech = SomeTracking(...)
# Configure the feature pipeline: apply the strategies chosen above and
# provide an input dataset
pipeline = FeaturePipeline(processing_mode="2d")
pipeline.set_identification_strategy(ident_tech)
pipeline.set_tracking_strategy(track_tech) # omit or set to None if no tracking desired
pipeline.set_data_path("path/to/input/data.nc") # or directly provide a Dataset with set_data
# Run the identification and tracking on the data
pipeline.execute()
# TODO: output handling
Quickstart
----------
Here is a usage example, if you want to apply existing techniques in the code base to your data set.
First, we need some imports, namely the
- :py:class:`enstools.feature.pipeline.FeaturePipeline`, which executes the identification pipeline
- :py:class:`enstools.feature.identification.template.IdentificationTemplate`, this is the identification technique, edit this accordingly
- :py:class:`enstools.feature.tracking.template.TrackingTemplate`, this is the tracking technique, edit this accordingly
- :py:class:`enstools.feature._proto_gen.template_pb2`, this is the on run auto-generated protobuf python file from the set description. Use the one that matches your detection strategy. They are named \*_pb2, where \* is the name of the identification module.
.. warning::
[TODO] should not really need to set the template here, is specific to identification strategy!
.. code-block:: python
from enstools.feature.pipeline import FeaturePipeline
from enstools.feature.identification.template import IdentificationTemplate
from enstools.feature.tracking.template import TrackingTemplate
from enstools.feature.identification._proto_gen import template_pb2
Then, we initialize the pipeline with the protobuf description and optional the processing mode. For 3D data, this resembles if identification should be performed individual on 2D (latlon) or 3D subsets.
.. code-block:: python
pipeline = FeaturePipeline(template_pb2, processing_mode='2d')
Then, we initialize and set our strategies. The tracking can be set to `None` to be ignored.
.. code-block:: python
i_strat = IdentificationTemplate(some_parameter='foo')
t_strat = TrackingCompareTemplate()
pipeline.set_identification_strategy(i_strat)
pipeline.set_tracking_strategy(t_strat) # or None as argument if no tracking
Next, set the data to process.
.. code-block:: python
pipeline.set_data_path(path)
Then, the pipeline can be executed, starting the identification and subsequently the tracking.
.. code-block:: python
pipeline.execute()
# or separated...
# pipeline.execute_identification()
# pipeline.execute_tracking()
This generates an object description based on the set protobuf format. If tracking has been used, tracks based on a default simple heuristic can be generated. See docstrings for further details. The object description holds the objects, and if tracking has been executed a graph structure and the generated tracks respectively.
.. code-block:: python
pipeline.generate_tracks()
od = pipeline.get_object_desc()
The output data set and description can be saved:
.. code-block:: python
pipeline.save_result(description_type='json', description_path=..., dataset_path=...)
Class Documentation
-------------------
.. autoclass:: enstools.feature.pipeline.FeaturePipeline
Quickstart
==========
Here is a usage example, if you want to apply existing techniques in the code base to your data set.
First, we need some imports, namely the
- :py:class:`enstools.feature.pipeline.FeaturePipeline`, which executes the identification pipeline
- :py:class:`enstools.feature.identification.template.IdentificationTemplate`, this is the identification technique, edit this accordingly
- :py:class:`enstools.feature.tracking.template.TrackingTemplate`, this is the tracking technique, edit this accordingly
- :py:class:`enstools.feature._proto_gen.template_pb2`, this is the on run auto-generated protobuf python file from the set description. Use the one that matches your detection strategy. They are named \*_pb2, where \* is the name of the identification module.
.. warning::
[TODO] should not really need to set the template here, is specific to identification strategy!
.. code-block:: python
from enstools.feature.pipeline import FeaturePipeline
from enstools.feature.identification.template import IdentificationTemplate
from enstools.feature.tracking.template import TrackingTemplate
from enstools.feature.identification._proto_gen import template_pb2
Then, we initialize the pipeline with the protobuf description and optional the processing mode. For 3D data, this resembles if identification should be performed individual on 2D (latlon) or 3D subsets.
.. code-block:: python
pipeline = FeaturePipeline(template_pb2, processing_mode='2d')
Then, we initialize and set our strategies. The tracking can be set to `None` to be ignored.
.. code-block:: python
i_strat = IdentificationTemplate(some_parameter='foo')
t_strat = TrackingCompareTemplate()
pipeline.set_identification_strategy(i_strat)
pipeline.set_tracking_strategy(t_strat) # or None as argument if no tracking
Next, set the data to process.
.. code-block:: python
pipeline.set_data_path(path)
Then, the pipeline can be executed, starting the identification and subsequently the tracking.
.. code-block:: python
pipeline.execute()
# or separated...
# pipeline.execute_identification()
# pipeline.execute_tracking()
This generates an object description based on the set protobuf format. If tracking has been used, tracks based on a default simple heuristic can be generated. See docstrings for further details. The object description holds the objects, and if tracking has been executed a graph structure and the generated tracks respectively.
.. code-block:: python
pipeline.generate_tracks()
od = pipeline.get_object_desc()
The output data set and description can be saved:
.. code-block:: python
pipeline.save_result(description_type='json', description_path=..., dataset_path=...)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment