Metadata-Version: 2.4
Name: potentiostat-data-parser
Version: 0.0.4
Summary: Parse data files created by CH Instruments potentiostats and Palmsens potentiostats
Home-page: https://github.com/bxw315-umd/potentiostat-data-parser
Author: Benjamin Wu
Author-email: bxw315@umd.edu
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: numpy
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# potentiostat-data-parser


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install latest from the GitHub
[repository](https://github.com/bxw315-umd/potentiostat-data-parser):

``` sh
$ pip install git+https://github.com/bxw315-umd/potentiostat-data-parser.git
```

or from
[conda](https://anaconda.org/bxw315-umd/potentiostat-data-parser)

``` sh
$ conda install -c bxw315-umd potentiostat_data_parser
```

or from [pypi](https://pypi.org/project/potentiostat-data-parser/)

``` sh
$ pip install potentiostat_data_parser
```

### Documentation

Documentation can be found hosted on this GitHub
[repository](https://github.com/bxw315-umd/potentiostat-data-parser)’s
[pages](https://bxw315-umd.github.io/potentiostat-data-parser/).
Additionally you can find package manager specific guidelines on
[conda](https://anaconda.org/bxw315-umd/potentiostat-data-parser) and
[pypi](https://pypi.org/project/potentiostat-data-parser/) respectively.

## How to use

### CHI Example

``` python
print(contents)
```

    July 19, 2022   10:35:26
    Differential Pulse Voltammetry
    File: dpv_gce_0.1m_pbbuffer_220719.bin
    Data Source:  Experiment
    Instrument Model:  CHI1040C
    Header: 
    Note: 

    Init E (V) = 0.4
    Final E (V) = 1.4
    Incr E (V) = 0.004
    Amplitude (V) = 0.05
    Pulse Width (sec) = 0.06
    Sample Width (sec) = 0.03
    Pulse Period (sec) = 0.5
    Quiet Time (sec) = 2
    Sensitivity (A/V) = 1e-5

    Ep = 0.584V
    ip = -1.618e-7A
    Ap = -1.423e-8VA

    Potential/V Current/A   Time/s

    0.440   -5.844e-7
    0.480   -6.668e-7
    0.520   -8.177e-7
    0.560   -1.002e-6
    0.600   -1.023e-6
    0.640   -9.839e-7

``` python
parse_chi_file(contents)
```

    {'memo': {'timestamp': '2022-07-19T10:35:26',
      'technique': 'Differential Pulse Voltammetry',
      'file': 'dpv_gce_0.1m_pbbuffer_220719.bin',
      'instrument_model': 'CHI1040C'},
     'parameters': {'Init E (V)': 0.4,
      'Final E (V)': 1.4,
      'Incr E (V)': 0.004,
      'Amplitude (V)': 0.05,
      'Pulse Width (sec)': 0.06,
      'Sample Width (sec)': 0.03,
      'Pulse Period (sec)': 0.5,
      'Quiet Time (sec)': 2.0,
      'Sensitivity (A/V)': 1e-05},
     'numeric_data': {'Potential/V': array([0.44, 0.48, 0.52, 0.56, 0.6 , 0.64]),
      'Current/A': array([-5.844e-07, -6.668e-07, -8.177e-07, -1.002e-06, -1.023e-06,
             -9.839e-07])}}

### Palmsens example

``` python
print(contents)
```

    Date and time:,2025-03-29 23:18:59
    Notes:
    ,,,,,,,,,,,,
    Differential Pulse Voltammetry [1]: S49,,Differential Pulse Voltammetry [8]: S48,,Differential Pulse Voltammetry [15]: S47,,Differential Pulse Voltammetry [22]: S46,,Differential Pulse Voltammetry [29]: S45,,Differential Pulse Voltammetry [36]: S44,,Differential Pulse Voltammetry [43]: S43
    Date and time measurement:,2025-03-29 13:32:13,Date and time measurement:,2025-03-29 14:28:03,Date and time measurement:,2025-03-29 16:28:02,Date and time measurement:,2025-03-29 17:28:20,Date and time measurement:,2025-03-29 19:41:19,Date and time measurement:,2025-03-29 20:35:10,Date and time measurement:,2025-03-29 21:22:52,
    V,µA,V,µA,V,µA,V,µA,V,µA,V,µA,V,µA
    0,0.019751112,0,0.040179824,0,0.045964596,0,0.04073982,0,0.044447004,0,0.043287808,0,0.05077498
    0.01020757,0.019157514,0.01020757,0.039586228,0.01020757,0.0450126,0.01020757,0.039709428,0.01020757,0.042632616,0.01020757,0.041630216,0.01020757,0.050198176
    0.02041514,0.018810318,0.02041514,0.038824632,0.02041514,0.044525404,0.02041514,0.039082228,0.02041514,0.04155182,0.02041514,0.040493424,0.02041514,0.047666992
    0.03062271,0.01848552,0.03062271,0.038460632,0.03062271,0.044407804,0.03062271,0.038936632,0.03062271,0.04089662,0.03062271,0.039731828,0.03062271,0.045947796

``` python
parse_palmsens_file(contents)
```

    [{'name': 'Differential Pulse Voltammetry [1]: S49',
      'timestamp': '2025-03-29T13:32:13',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([1.9751112e-08, 1.9157514e-08, 1.8810318e-08])},
     {'name': 'Differential Pulse Voltammetry [8]: S48',
      'timestamp': '2025-03-29T14:28:03',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([4.0179824e-08, 3.9586228e-08, 3.8824632e-08])},
     {'name': 'Differential Pulse Voltammetry [15]: S47',
      'timestamp': '2025-03-29T16:28:02',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([4.5964596e-08, 4.5012600e-08, 4.4525404e-08])},
     {'name': 'Differential Pulse Voltammetry [22]: S46',
      'timestamp': '2025-03-29T17:28:20',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([4.0739820e-08, 3.9709428e-08, 3.9082228e-08])},
     {'name': 'Differential Pulse Voltammetry [29]: S45',
      'timestamp': '2025-03-29T19:41:19',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([4.4447004e-08, 4.2632616e-08, 4.1551820e-08])},
     {'name': 'Differential Pulse Voltammetry [36]: S44',
      'timestamp': '2025-03-29T20:35:10',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([4.3287808e-08, 4.1630216e-08, 4.0493424e-08])},
     {'name': 'Differential Pulse Voltammetry [43]: S43',
      'timestamp': '2025-03-29T21:22:52',
      'potential': array([0.        , 0.01020757, 0.02041514]),
      'current': array([5.0774980e-08, 5.0198176e-08, 4.7666992e-08])}]
