Add documentation for usage as python module

This commit is contained in:
Lukas Klass 2020-09-09 17:39:40 +02:00
parent f295400158
commit 7243b0fe85
2 changed files with 31 additions and 0 deletions

View File

@ -16,6 +16,11 @@ Project Structure
.. include:: project_structure.rst
ESBO-ETC Python module
======================
.. include:: scripting.rst
Software Architecture
=====================

View File

@ -0,0 +1,26 @@
ESBO-ETC is designed to be included as module in other Python scripts.
This is possible by importing the class ``esbo_etc`` from the module ``esbo_etc`` as shown below.
.. code-block:: python
:linenos:
from esbo_etc import esbo_etc
The class ``esbo_etc`` requires a path to the configuration file as initialization argument and some other optional paramaters.
The created object offers the method ``run()`` to trigger the computation.
The result of the computation is returned as Astropy quantity.
A Minimal example looks as follows:
.. code-block:: python
:linenos:
from esbo_etc import esbo_etc
# Initialize a new ESBO-ETC object
etc = esbo_etc("path_to_configuration_file.xml")
# Run the calculations
res = etc.run()
print(res)