Skip to content

Commit

Permalink
Update eclab docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Mar 31, 2024
1 parent a186f9f commit 872e0a3
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 26 deletions.
1 change: 1 addition & 0 deletions docs/source/extractors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
:hidden:
:glob:

apidoc/yadg.extractors.example
apidoc/yadg.extractors.*
49 changes: 38 additions & 11 deletions src/yadg/extractors/eclab/mpr.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
"""
**eclabmpr**: Processing of BioLogic's EC-Lab binary modular files.
-------------------------------------------------------------------
For processing of BioLogic's EC-Lab binary modular files.
Usage
`````
Available since ``yadg-4.0``.
.. autopydantic_model:: dgbowl_schemas.yadg.dataschema_5_1.filetype.EClab_mpr
Schema
``````
The ``mpr`` files contain many columns that vary depending on the electrochemical
technique used. Below is shown a list of columns that can be expected to be present
in a typical ``mpr`` file.
.. code-block:: yaml
xarray.Dataset:
coords:
uts: !!float # Unix timestamp, without date
data_vars:
Ewe (uts) # Potential of the working electrode
Ece (uts) # Potential of the counter electrode, if present
I (uts) # Instantaneous current
time (uts) # Time elapsed since the start of the experiment
<Ewe> (uts) # Average Ewe potential since last data point
<Ece> (uts) # Average Ece potential since last data point
<I> (uts) # Average current since last data point
...
.. note::
Note that in most cases, either the instantaneous or the averaged quantities are
stored - only rarely are both available!
Notes on file structure
```````````````````````
``.mpr`` files are structured in a set of "modules", one concerning
settings, one for actual data, one for logs, and an optional loops
module. The parameter sequences can be found in the settings module.
Expand Down Expand Up @@ -39,14 +72,6 @@
| ZIR | IR compensation (PEIS) |
+------+-------------------------------------------------+
.. note::
``.mpt`` files can contain more data than the corresponding binary
``.mpr`` file.
File Structure of ``.mpr`` Files
````````````````````````````````
At a top level, ``.mpr`` files are made up of a number of modules,
separated by the ``MODULE`` keyword. In all the files I have seen, the
first module is the settings module, followed by the data module, the
Expand Down Expand Up @@ -190,7 +215,9 @@
of any external sensors plugged into the device), the ``log`` is usually
not present and therefore the full timestamp cannot be calculated.
.. codeauthor:: Nicolas Vetsch
.. codeauthor::
Nicolas Vetsch
"""

import logging
Expand Down
54 changes: 39 additions & 15 deletions src/yadg/extractors/eclab/mpt.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
"""
**eclabmpt**: Processing of BioLogic's EC-Lab ASCII export files.
-----------------------------------------------------------------
``.mpt`` files are made up of a header portion (with the technique
parameter sequences and an optional loops section) and a tab-separated
data table.
A list of techniques supported by this parser is shown in `the techniques table
<yadg.extractors.eclab.common.techniques>`_.
File Structure of ``.mpt`` Files
````````````````````````````````
For processing of BioLogic's EC-Lab binary modular files.
Usage
`````
Available since ``yadg-4.0``.
.. autopydantic_model:: dgbowl_schemas.yadg.dataschema_5_1.filetype.EClab_mpt
Schema
``````
The ``.mpt`` files contain many columns that vary depending on the electrochemical
technique used. Below is shown a list of columns that can be expected to be present
in a typical ``.mpt`` file.
.. code-block:: yaml
xarray.Dataset:
coords:
uts: !!float # Unix timestamp, without date
data_vars:
Ewe (uts) # Potential of the working electrode
Ece (uts) # Potential of the counter electrode, if present
I (uts) # Instantaneous current
time (uts) # Time elapsed since the start of the experiment
<Ewe> (uts) # Average Ewe potential since last data point
<Ece> (uts) # Average Ece potential since last data point
<I> (uts) # Average current since last data point
...
.. note::
Note that in most cases, either the instantaneous or the averaged quantities are
stored - only rarely are both available!
Notes on file structure
```````````````````````
These human-readable files are sectioned into headerlines and datalines.
The header part of the ``.mpt`` files is made up of information that can be found
in the settings, log and loop modules of the binary ``.mpr`` file.
If no header is present, the timestamps will instead be calculated from
the file's ``mtime()``.
Metadata
````````
The metadata will contain the information from the header of the file.
Expand All @@ -29,7 +51,9 @@
The mapping between metadata parameters between ``.mpr`` and ``.mpt`` files
is not yet complete.
.. codeauthor:: Nicolas Vetsch
.. codeauthor::
Nicolas Vetsch
"""

import re
Expand Down

0 comments on commit 872e0a3

Please sign in to comment.