Add documentation for usage as python module
This commit is contained in:
parent
f295400158
commit
7243b0fe85
@ -16,6 +16,11 @@ Project Structure
|
||||
|
||||
.. include:: project_structure.rst
|
||||
|
||||
ESBO-ETC Python module
|
||||
======================
|
||||
|
||||
.. include:: scripting.rst
|
||||
|
||||
Software Architecture
|
||||
=====================
|
||||
|
||||
|
26
docs/source/developer/scripting.rst
Normal file
26
docs/source/developer/scripting.rst
Normal 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)
|
Loading…
Reference in New Issue
Block a user