.. _python_API_monitors:

.. currentmodule:: flow360

**************************
Monitors
**************************

This script demonstrates the configuration and utilization of monitors within a Flow360 simulation using the Python API.
Specifically, it illustrates how to define probe points using ``ProbeOutput`` to track flow variables at specified locations during a simulation of the ONERA M6 wing.
Furthermore, it shows the process for retrieving, processing, and downloading the monitored data upon simulation completion.


.. literalinclude:: ../../../../../Flow360/examples/post_processing/monitoring/monitors.py
   :language: python
   :linenos:

Notes
=====

- ``ProbeOutput`` enables monitoring of specified ``output_fields`` at defined spatial coordinates, which are defined using ``Point``.
- Post-simulation, monitor data is accessible through the ``case.results.monitors`` attribute after ensuring completion with ``case.wait()``.
- Individual monitor datasets can be accessed via ``results.monitors.get_monitor_by_name()`` and subsequently downloaded or converted into a pandas DataFrame using ``.as_dataframe()``.
