Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Big Merge #30

Merged
merged 129 commits into from Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
8fc238e
fix import
kkrempl Dec 19, 2020
ccfb5a3
fix import
kkrempl Dec 19, 2020
d45369d
pkl readers
kkrempl Jan 8, 2021
7a1ccfe
Merge remote-tracking branch 'origin/reader_for_biologic_mpt' into de…
kkrempl Jan 8, 2021
4a007a0
EC_MS .pkl reader
kkrempl Jan 9, 2021
0d2f2e5
Implementation of the deconvolution class and further functionality.
kkrempl Jan 24, 2021
14a15d2
Syntax correction of comments
kkrempl Jan 25, 2021
2142121
Better formatting, added TODOs, smaller bug fixes
kkrempl Jan 26, 2021
2dd8a52
More TODOs
kkrempl Jan 26, 2021
d6a4166
Even more TODOs
kkrempl Jan 28, 2021
e0e6e8a
small bug fixes
kkrempl Jan 31, 2021
ac2e824
bug fixes, now able to run scripts for paper
kkrempl Feb 2, 2021
e4bc226
change docstring
kkrempl Feb 2, 2021
e5d4580
Merge branch 'ec_features' of https://github.com/ixdat/ixdat into dec…
kkrempl Feb 2, 2021
17b4990
delete merge conflicts
kkrempl Feb 2, 2021
0e4c453
Merge branch 'ec_features' into deconvolution_sbs
ScottSoren Feb 7, 2021
49a68a5
pass cls from M.read() via R.read() to M.from_dict()
ScottSoren Feb 7, 2021
def6244
update requirements and appease flake8
ScottSoren Feb 7, 2021
36e91c0
rename 'get_' methods for t, v vectors to 'grab_'
ScottSoren Feb 7, 2021
85da96a
Merge pull request #7 from ixdat/deconvolution_sbs
kkrempl Feb 15, 2021
27e044d
small changes for NH3 measurements
kkrempl Feb 15, 2021
057cca2
Merge branch 'deconvolution' of https://github.com/ixdat/ixdat into d…
kkrempl Feb 15, 2021
663d709
write placeholder zilien Reader and ecms Plotter
ScottSoren Feb 16, 2021
e5a7d86
Add MSPlotter, improve EC-MS related docstrings
ScottSoren Feb 16, 2021
81a429f
start updating documentation
ScottSoren Feb 16, 2021
4a6cc29
fix documentation formatting
ScottSoren Feb 16, 2021
6f70787
add read_url() method to Measurement
ScottSoren Feb 16, 2021
e2060e7
updates for pypi: *$ pip install ixdat*
ScottSoren Feb 16, 2021
8007662
add ECMeasurements.select_sweep and constants.py
ScottSoren Feb 18, 2021
7f1a718
integrate() and grab_of_t()
Feb 18, 2021
d462933
implement CyclicVoltammagramDiff and CVDiffPlotter
Feb 18, 2021
3de1380
minor improvements for tutorials, black formatting
ScottSoren Feb 18, 2021
8fabdc7
ixdat csv reader, debugged for EC
ScottSoren Feb 19, 2021
5c2448d
v0.0.5, minor debugging for csv of ec data
ScottSoren Feb 19, 2021
7e2c87d
base plotter, integrate() takes axis argument
ScottSoren Feb 19, 2021
9096596
move higher saveable stuff to projects, v0.0.6
ScottSoren Feb 19, 2021
13707ff
autolab reader: tstamp stuff to reading_tools.py
ScottSoren Feb 24, 2021
543c79b
write ivium reader and organize things a bit
ScottSoren Mar 9, 2021
ca8813f
pfeiffer reader for ms and dataframe function
ScottSoren Mar 10, 2021
52f0f7e
implement review/debugging from PR #8
ScottSoren Mar 10, 2021
d04ea7f
catching up documentation!
ScottSoren Mar 11, 2021
438d1e6
improve documentation
ScottSoren Mar 12, 2021
aae8471
Write cinfdata text reader
ScottSoren Mar 13, 2021
6cf1caa
Hyphenating with '+' operator! two-axis EC-MS plot!
ScottSoren Mar 13, 2021
f86bd00
debug measurement appending+hyphenating, improve plotters
ScottSoren Mar 17, 2021
0843560
ECMSCyclicVoltammagram and plot_vs_potential for EC-MS
ScottSoren Mar 17, 2021
9690f8a
bg in plots, both EC and MS __init__'s called in EC-MS
ScottSoren Mar 17, 2021
d0317b9
EC-MS exporting and saving
ScottSoren Mar 18, 2021
b509ebd
update docs, v0.0.10
ScottSoren Mar 18, 2021
40f6544
debugging: biologic encoding, EC-MS component_measurements, sel_str o…
ScottSoren Mar 22, 2021
365cc79
debug for all EC + MS reader combos
ScottSoren Mar 23, 2021
1dda777
zilien tmp reader
ScottSoren Mar 23, 2021
08dfa0c
fix duplicate Ewe/V and I/mA in EC_MS imports bug
ScottSoren Apr 14, 2021
7f27006
write internal and semiinternal calibration functions
ScottSoren Apr 15, 2021
2c66f6b
Saveable (actually, exportable) EC-MS calibration
ScottSoren Apr 15, 2021
931aace
full calibrated EC-MS plotting functionality
ScottSoren Apr 15, 2021
2cc5f2c
v0.1.0
ScottSoren Apr 15, 2021
a535656
minor debug of ecms plotting, write grab_flux_for_t
ScottSoren Apr 21, 2021
b60071b
more (messy) calibration integration, v0.1.1
ScottSoren Apr 21, 2021
c1cc6dc
import .mpt files with sub-second timestamps
ScottSoren Apr 28, 2021
8f58925
write Spectrum class and zilien spectrum reader
ScottSoren Apr 29, 2021
cc9e4da
fix spectrum for backend, write docstrings
ScottSoren Apr 30, 2021
27ca576
msrh spectroelectrochemistry reader
ScottSoren Jul 1, 2021
aa947aa
spectroelectrochemistry plotting
ScottSoren Jul 1, 2021
bff55ed
v0.1.4sec
ScottSoren Jul 1, 2021
cef1735
major update to documentation
ScottSoren Jul 2, 2021
9ccb3e8
more improvement in docs including tutorials
ScottSoren Jul 2, 2021
53ac8fc
logo in docs, updated README, v0.1.5
ScottSoren Jul 2, 2021
7cc94a8
fix logo paths
ScottSoren Jul 2, 2021
10d32b2
SpectrumSeries
ScottSoren Jul 10, 2021
6b74163
sec plot_vs_potential; use SpectrumSeriesPlotter
ScottSoren Jul 11, 2021
6475741
SEC potential decay
ScottSoren Jul 11, 2021
344790e
fix sign issue and v direction in sec
ScottSoren Jul 12, 2021
f75ef4e
set_reference_spectrum(); doc strings for S-EC.
ScottSoren Jul 13, 2021
5b00cdd
sec exporter
ScottSoren Jul 13, 2021
93beaad
IxdatCSVReader can read sec with aux files
ScottSoren Jul 13, 2021
6fd836a
sec track wavelengths
ScottSoren Jul 13, 2021
0594f0f
finish docstrings for sec
ScottSoren Jul 16, 2021
f930f6e
Merge branch 'user_ready' into spectroelectrochemistry
ScottSoren Jul 16, 2021
f03ed57
spectra and SEC documentation
ScottSoren Jul 16, 2021
6fc3bbb
sphinx instructions in tools.rst, ready for PR
ScottSoren Jul 17, 2021
e4c1c9d
implement Caiwu's review of spectroelectrochemistry
ScottSoren Nov 8, 2021
f920015
Merge pull request #13 from ixdat/spectroelectrochemistry
Nov 9, 2021
9e1112f
clean up documentation
Nov 9, 2021
ded9e3d
fix rtd error
Nov 9, 2021
a4631fd
------ ixdat v0.1.5 --------
Nov 9, 2021
a4454ea
RGA and CHI readers (using EC_MS)
ScottSoren Nov 21, 2021
b6df351
lookup and export of molar fluxes
ScottSoren Nov 21, 2021
5889fab
MSCalResults in mol_lists, correct_data (for pyOER)
ScottSoren Nov 21, 2021
86367de
return J_str, V_str; bg removal for flux
ScottSoren Nov 24, 2021
2580890
Import zilien .tsv without EC (Issues #17 and #20)
ScottSoren Nov 24, 2021
79e70fa
fix plot_vs_potential axes (Issues #16 and #19)
ScottSoren Nov 24, 2021
9433d5c
update docs, ----- ixdat v0.1.6 -----
ScottSoren Nov 26, 2021
ef61fa4
Merge pull request #21 from ixdat/Fuzhou
Dec 2, 2021
6034663
merge (no fixing yet)
ScottSoren Dec 2, 2021
c387249
black format, pass checksgit add .!
ScottSoren Dec 2, 2021
802b864
debug for test_zilien_reader
ScottSoren Dec 2, 2021
af5be33
update __init__.py: aiming for v0.2.0
ScottSoren Dec 6, 2021
ac8cf0c
debug for ivium reader
ScottSoren Dec 6, 2021
b34c31c
mass_aliases are just aliases.
ScottSoren Dec 6, 2021
fb63487
signal_bgs and ms_cal_ist in MSCalibration
ScottSoren Dec 6, 2021
39c97a5
debug autolab: cycle not essential to ECMeasurement
ScottSoren Dec 6, 2021
aa86808
debug msrh_sec: series_list before aliases.
ScottSoren Dec 6, 2021
4e7c97c
debug msrh_sec_decay
ScottSoren Dec 6, 2021
021bd86
debug ixdat csv exporters and ixdat reader
ScottSoren Dec 6, 2021
75a2d91
debug for Huang2021: ECMSCalibration inheritance
ScottSoren Dec 7, 2021
62dadab
flux calculation in MSCalibration.get_series
ScottSoren Dec 7, 2021
b65ddb4
pacify flake8, pass checks
ScottSoren Dec 7, 2021
6fe912c
new biologic timestamp form (#33)
Feb 3, 2022
f89e66a
tspan_bg not t_bg (#27)
Feb 3, 2022
7baf0b8
Voltammogram not Voltammagram (#23)
Feb 3, 2022
78d9dd9
Zilien as EC-MS, EC, or MS (#32)
Feb 3, 2022
2db8d8f
---- ixdat v0.1.7 ------
Feb 3, 2022
57221f2
Merge branch 'user_ready' into backend_fixes
Feb 3, 2022
9889bed
-- v0.1.8 -- fix ECMSCyclicVoltammogram inheritance
ScottSoren Feb 6, 2022
80c875b
merge ixdat v0.1.8
ScottSoren Feb 6, 2022
de1c4fa
debug spectrum loading: fields as child_attrs
ScottSoren Feb 16, 2022
c21e809
fix CyclicVoltammogram
ScottSoren Feb 18, 2022
de4dada
aliases in EC_MS pickle importer
ScottSoren Mar 9, 2022
299f706
implement review outside of src
ScottSoren Mar 9, 2022
b2a0d86
physical constants from scipy
ScottSoren Mar 9, 2022
0087cd0
implement review of db and data_series
ScottSoren Mar 9, 2022
4700a7d
implement review of exporters
ScottSoren Mar 11, 2022
0276f21
implement review of measurement.py
ScottSoren Mar 13, 2022
9e9e39b
implement review of plotters
ScottSoren Mar 13, 2022
f806455
implement review of readers
ScottSoren Mar 13, 2022
77040ba
implement review of spectra.py
ScottSoren Mar 13, 2022
76bd43b
implement review of techniques
ScottSoren Mar 13, 2022
d051c8f
finish review: ECMS axes order and misc details
Mar 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -3,7 +3,7 @@
development_scripts/*/*.png
development_scripts/*/*.svg
development_scripts/*/*.csv
docs/source/figures/big_src/*
docs/source/figures/big_src/



Expand Down
9 changes: 4 additions & 5 deletions .readthedocs.yml
Expand Up @@ -18,8 +18,7 @@ sphinx:
# - pdf

# Optionally set the version of Python and requirements required to build your docs
# python:
# version: 3.7
# install:
# - requirements: docs/requirements.txt
# - requirements: docs/requirements.txt
python:
version: 3.6
install:
- requirements: docs/requirements.txt
126 changes: 118 additions & 8 deletions README.rst
@@ -1,18 +1,128 @@
.. figure:: docs/source/figures/logo.svg
:width: 200

=============================================
``ixdat``: The In-situ Experimental Data Tool
=============================================

NOTE: We are currently working mainly on the `[user_ready] <https://github.com/ixdat/ixdat/tree/user_ready>`_ branch. Both the `documentation <https://ixdat.readthedocs.io>`_ and the `pip installation <https://pypi.org/project/ixdat/>`_ are presently compiled from that branch while we work through some important details in `a pull request <https://github.com/ixdat/ixdat/pull/6>`_.
With ``ixdat``, you can import, combine, and export complex experimental datasets
as simply as::

ec = Measurement.read_set("awesome_EC_data", reader="biologic")
ec.plot_measurement()

ms = Measurement.read("2021-03-30 16_59_35 MS data.tsv", reader="zilien")
ms.plot_measurement()

ecms = ec + ms
ecms.plot_measurement()

ecms.export("my_combined_data.csv")

Output:

.. figure:: docs/source/figures/ixdat_example_figures.png
:width: 700

In-situ experimental data made easy

Or rather than exporting, you can take advantage of ``ixdat``'s powerful analysis
tools and database backends to be a one-stop tool from messy raw data to public
repository accompanying your breakthrough publication and advancing our field.
ScottSoren marked this conversation as resolved.
Show resolved Hide resolved

About
-----

``ixdat`` provides a powerful **object-oriented** interface to experimental data, especially in-situ experimental data for which it is of interest to combine data obtained simultaneously from multiple techniques.

Documentation is at https://ixdat.readthedocs.io

In addition to a **pluggable** parser interface for importing your data format, ``ixdat`` also includes
pluggable exporters and plotters, as well as a database interface. A relational model of experimental data is
designed into every level.

.. list-table:: Techniques and Readers
:widths: 20 15 50
:header-rows: 1


* - Measurement technique
- Status
- Readers
* - Electrochemistry
- Released
- - biologic: .mpt files from Biologic's EC-Lab software
- autolab: ascii files from AutoLab's NOVA software
- ivium: .txt files from Ivium's IviumSoft software
* - Mass Spectrometry
- Released
- - pfeiffer: .dat files from Pfeiffer Vacuum's PVMassSpec software
- cinfdata: text export from DTU Physics' cinfdata system
- zilien: .tsv files from Spectro Inlets' Zilien software
* - Electrochemistry - Mass Spectrometry
- Released
- - zilien: .tsv files from Spectro Inlets' Zilien software
- EC_MS: .pkl files from the legacy EC_MS python package
* - Spectroelectrochemistry
- Released
- - msrh_sec: .csv file sets from Imperial College London's SEC system
* - X-ray photoelectron spectroscopy (XPS)
- Future
-
* - X-ray diffraction (XRD)
- Future
-
* - Low-Energy Ion Scattering (LEIS)
- Future
-

Tutorials are described at https://ixdat.readthedocs.io/en/latest/tutorials.html

Installation
------------

To use ``ixdat``, you need to have python installed. We recommend
`Anaconda python <https://www.anaconda.com/products/individual>`_.

To install ``ixdat``, just type in your terminal or Anaconda prompt::

$ pip install ixdat

And hit enter.

``ixdat`` is under development, and to make use of the newest features,
you may need to upgrade to the latest version. This is also easy. Just type::

$ pip install --upgrade ixdat


Article repositories
--------------------

``ixdat`` is shown in practice in a growing number of open repositories of data and analysis
for academic publications:

- Soren B. Scott, et al. **Tracking oxygen atoms in electrochemical CO oxidation –Part I: Oxygen exchange via CO2 hydration**. `Electrochimica Acta, 374, 137842 <https://doi.org/10.1016/j.electacta.2021.137842>`_, **2021**.

Repository: https://github.com/ScottSoren/pyCOox_public

- Soren B. Scott, et al. **Tracking oxygen atoms in electrochemical CO oxidation –Part II: Lattice oxygen reactivity in oxides of Pt and Ir**. `Electrochimica Acta, 374, 137844 <https://doi.org/10.1016/j.electacta.2021.137844>`_, **2021**.

Repository: https://github.com/ScottSoren/pyCOox_public

- Kevin Krempl, et al. **Dynamic Interfacial Reaction Rates from Electrochemistry - Mass Spectrometry**. `Journal of Analytical Chemistry. 93, 7022-7028 <https://doi.org/10.1021/acs.analchem.1c00110>`_, **2021**

Repository: https://github.com/kkrempl/Dynamic-Interfacial-Reaction-Rates

``ixdat`` will provide a powerful **object-oriented** interface to experimental data, especially in-situ experimental data for which it is of interest to combine data obtained simultaneously from multiple techniques.
- Junheng Huang, et al. **Online Electrochemistry−Mass Spectrometry Evaluation of the Acidic Oxygen Evolution Reaction at Supported Catalysts**. `ACS Catal. 11, 12745-12753 <https://doi.org/10.1021/acscatal.1c03430>`_, **2021**

``ixdat`` will replace the existing electrochemistry - mass spectrometry data tool, `EC_MS <https://github.com/ScottSoren/EC_MS>`_, and will thus become a powerful stand-alone tool for analysis and visualization of data acquired by the equipment of `Spectro Inlets <https://spectroinlets.com>`_ and other EC-MS solutions.
It will also replace the existing electrochemistry - synchrotron GIXRD data tool, `EC_Xray <https://github.com/ScottSoren/EC_Xray>`_ when needed.
Over time, it will acquire functionality for more and more techniques.
Repository: https://github.com/ScottSoren/Huang2021

In addition to a **pluggable** parser interface for importing your data format, it will include pluggable exporters and plotters, as well as a database interface.

We will update this README as features are added. More importantly, we will document this project as we develop it here: https://ixdat.readthedocs.io/
Join us
-------

``ixdat`` is free and open source software and we welcome input and new collaborators.
`ixdat`` is free and open source software and we welcome input and new collaborators. Please help us improve!

Contact us (sbscott@ic.ac.uk) or just
`get started developing <https://ixdat.readthedocs.io/en/latest/developing.html>`_.
26 changes: 25 additions & 1 deletion TOOLS.rst
Expand Up @@ -12,7 +12,7 @@ development:
* **sphinx** is used to build documentation

The following is a list of "tool and commands runners":

* **invoke** is used during development, to run tools and other
pre-configured maintenance tasks inside the existing development
environment
Expand Down Expand Up @@ -42,6 +42,8 @@ summary here with our suggestions for usage.

Tools
-----
black
.....
**black** is an autoformatter, which fixes your white space usage etc.
https://black.readthedocs.io/en/stable/
It's nice to run it from the same terminal
Expand All @@ -50,6 +52,8 @@ before committing (and avoid a "fix formatting" commit later). To get black
and the other tools available in git bash, you have to tell ~\.bashrc where
it is (see Windows instructions below under git hooks).

flake8
......
**flake8** is a linter, which checks the code for errors.
https://flake8.pycqa.org/en/latest/
This includes
Expand All @@ -64,9 +68,29 @@ Additional allowances may need to be added there.
flake8 also enforces a maximum line length of 89, chosen to match the
default setting of black (+/- 1 char).

pytest
......
**pytest** is a suite of stuff used to write and run software tests.
https://docs.pytest.org/en/stable/

sphinx
......
**sphinx** is used to generate the beautiful documentation on
https://ixdat.readthedocs.io from ReStructuredText and ixdat source code.
To set it up just install sphinx, if you haven't already. In your terminal or Anaconda prompt, type::

$ pip install sphinx

Then, to build the documentation, navigate to ``ixdat/docs``, and run in your terminal or Anaconda prompt::

$ ./make html

Note, if you get an "access denied" error, you will just need to run the terminal as an administrator.

Then you can see the built documentation in your browser by double-clicking
``ixdat/docs/build/html/index.html``


**sphinx** is a tool for building the documentation into html and other
formats from restructured text (.rst). It also enables automatic documentation
generation from the doc-strings in the code. Read The Docs uses sphinx to compile
Expand Down
2 changes: 1 addition & 1 deletion development_scripts/append_ec_files.py
Expand Up @@ -74,7 +74,7 @@
cv_selection = cv[10:16]

cv_selection.plot_measurement(j_name="cycle")
cv_selection.redefine_cycle(start_potential=0.4, redox=1)
cv_selection.redefine_cycle(start_potential=0.45, redox=1)
cv_selection.plot_measurement(j_name="cycle")

ax = cv_selection[1].plot(label="cycle 1")
Expand Down
8 changes: 3 additions & 5 deletions development_scripts/functional_test.py
Expand Up @@ -28,20 +28,18 @@

assert np.isclose(
ec_measurement.v[0] - ec_measurement["raw_potential"].data[0],
ec_measurement.RE_vs_RHE
ec_measurement.RE_vs_RHE,
)

# To make it complex, we first select a couple cycles, this time by converting
# to a cyclic voltammagram and indexing, and append them:
cv = ec_measurement.as_cv()
cvs_1_plus_2 = cv[1] + cv[2]

# Check that the calibration survived all that:
# Check that the ms_calibration survived all that:
assert cvs_1_plus_2.RE_vs_RHE == ec_measurement.RE_vs_RHE
# Check that the main time variable, that of potential, wasn't corrupted:
assert len(cvs_1_plus_2.grab("potential")[0]) == len(
cvs_1_plus_2["time/s"].data
)
assert len(cvs_1_plus_2.grab("potential")[0]) == len(cvs_1_plus_2["time/s"].data)
# Check that the selector is still available and works with the main time var:
assert len(cvs_1_plus_2.selector.data) == len(cvs_1_plus_2.t)

Expand Down
14 changes: 14 additions & 0 deletions development_scripts/reader_testers/test_autolab_reader.py
@@ -0,0 +1,14 @@
"""For use in development of the autolab reader. Requires access to sample data."""

from pathlib import Path
from matplotlib import pyplot as plt

from ixdat import Measurement

path_to_file = Path.home() / (
"Dropbox/ixdat_resources/test_data/autolab/autolab_test_file.txt"
)

meas = Measurement.read(path_to_file, reader="autolab")

meas.plot()
45 changes: 45 additions & 0 deletions development_scripts/reader_testers/test_cinfdata_reader.py
@@ -0,0 +1,45 @@
"""For use in development of the cinfdata reader. Requires access to sample data."""

from pathlib import Path
from matplotlib import pyplot as plt

from ixdat import Measurement

path_to_file = (
Path.home()
/ "Dropbox/ixdat_resources/test_data/cinfdata/Trimarco2018_fig3/QMS_1.txt"
)
ms_meas = Measurement.read(path_to_file, reader="cinfdata")
ms_meas.plot_measurement()

path_to_ec_file_start = (
Path.home() / "Dropbox/ixdat_resources/test_data/cinfdata/Trimarco2018_fig3/09_fig4"
)
ec_meas = Measurement.read_set(path_to_ec_file_start, reader="biologic")
ec_meas.calibrate(RE_vs_RHE=0.65, A_el=0.196)
ec_meas.plot_measurement()

ecms_meas = ec_meas + ms_meas
axes = ecms_meas.plot_measurement(
mass_lists=[["M44", "M2"], ["M4", "M28"]],
tspan_bg=[30, 40],
legend=False,
unit="pA",
)

axes[0].set_ylim([-7, 70])
axes[2].set_ylim([-1.8e3, 18e3])
fig = axes[0].get_figure()
fig.tight_layout()
# fig.savefig("../../docs/source/figures/ec_ms.svg")

ecms_meas.set_bg(tspan_bg=[0, 10])

cv = ecms_meas.as_cv()
cv.redefine_cycle(start_potential=0.39, redox=False)

axes_cv = cv[2].plot(mass_list=["M2", "M44"], logplot=False, )
axes_cv = cv[1].plot(
mass_list=["M2", "M44"], linestyle="--", axes=axes_cv, logplot=False,
)
axes_cv[0].get_figure().savefig("Trimarco2018_ixdat.png")
28 changes: 28 additions & 0 deletions development_scripts/reader_testers/test_ivium_reader.py
@@ -0,0 +1,28 @@
"""For use in development of the ivium reader. Requires access to sample data."""

from pathlib import Path
ScottSoren marked this conversation as resolved.
Show resolved Hide resolved
import pandas as pd

from ixdat import Measurement
from ixdat.techniques import CyclicVoltammogram

path_to_file = Path.home() / (
"Dropbox/ixdat_resources/test_data/ivium/ivium_test_dataset"
)
path_to_single_file = path_to_file.parent / (path_to_file.name + "_1")
df = pd.read_csv(path_to_single_file, sep=r"\s+", header=1)

meas = Measurement.read(path_to_file, reader="ivium")

meas.save()

meas.plot_measurement()

meas_cv = CyclicVoltammogram.read(path_to_file, reader="ivium")

meas_cv.save()

meas_cv.plot_measurement()
meas_cv.redefine_cycle(start_potential=0.4, redox=False)
for i in range(4):
meas_cv[i].plot()
31 changes: 31 additions & 0 deletions development_scripts/reader_testers/test_ixdat_csv_reader.py
@@ -0,0 +1,31 @@
"""For use in development of the ixdat .csv reader (and exporter)."""

from ixdat import Measurement
ScottSoren marked this conversation as resolved.
Show resolved Hide resolved


if False: # test the version that's online on the tutorials page
KennethNielsen marked this conversation as resolved.
Show resolved Hide resolved
meas = Measurement.read_url(
"https://raw.githubusercontent.com/ixdat/tutorials/"
+ "main/loading_appending_and_saving/co_strip.csv",
reader="ixdat",
)
meas.plot_measurement()

else:
meas = Measurement.read(
"../../test_data/biologic/Pt_poly_cv_CUT.mpt", reader="biologic"
)
meas.calibrate_RE(0.715)

meas.correct_ohmic_drop(R_Ohm=100)

meas.normalize_current(0.196)

cv = meas.as_cv()

cv.export("test.csv")

meas_loaded = Measurement.read("test.csv", reader="ixdat")

meas_loaded.plot()