File: index.rst

package info (click to toggle)
python-ewoksdata 0.6.0~rc0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 292 kB
  • sloc: python: 1,661; makefile: 3
file content (67 lines) | stat: -rw-r--r-- 2,275 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ewoksdata |version|
===================

*ewoksdata* provides utilities for data access by `ewoks <https://ewoks.readthedocs.io/>`_ workflows.

*ewoksdata* has been developed by the `Software group <http://www.esrf.fr/Instrumentation/software>`_ of the `European Synchrotron <https://www.esrf.fr/>`_.

Getting started
---------------

.. code:: bash
    
    pip install ewoksdata


Iterate over the data from one *Bliss* scan during or after acquisition
-----------------------------------------------------------------------

.. code:: python

    from ewoksdata.data.bliss import iter_bliss_scan_data

    filename = "/data/id31/inhouse/id312210/id31/20221001/testpyfai/testpyfai_0001/testpyfai_0001.h5"
    scan_nr = 38

    with iter_bliss_scan_data(
        filename, scan_nr, lima_names=["p3"], counter_names=["mondio"], retry_timeout=10
    ) as bliss_scan_data_iterator:
        for data in bliss_scan_data_iterator:
            print(data["p3"]) # Contains lima data
            print(data["mondio"]) # Contains counter data

.. warning::

    To ensure you get as many data points as scan points, make sure to specify at least one counter.

    Also, to ensure that the file is closed after iterating on the scan data, make sure to use the iterator as a context manager as shown.


Iterate from a certain index of a *Bliss* scan during or after acquisition
--------------------------------------------------------------------------

.. code:: python

    from ewoksdata.data.bliss import iter_bliss_data

    filename = "/data/id31/inhouse/id312210/id31/20221001/testpyfai/testpyfai_0001/testpyfai_0001.h5"
    scan_nr = 38
    start_index = 5

    with iter_bliss_data(
        filename, scan_nr, lima_names=["p3"], counter_names=["mondio"], retry_timeout=10, start_index=start_index
    ) as bliss_data_iterator:
        for index, data in bliss_data_iterator:
            print(data["p3"]) # Contains lima data
            print(data["mondio"]) # Contains counter data

.. warning::

    To ensure you get as many data points as scan points, make sure to specify at least one counter.

    Also, to ensure that the file is closed after iterating on the scan data, make sure to use the iterator as a context manager as shown.

.. toctree::
    :hidden:

    api