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

"Error: field '(Q-Qo)' occurs more than once" when reading .mpr file (technique=CA) #14

Open
ScottSoren opened this issue Nov 11, 2023 · 1 comment

Comments

@ScottSoren
Copy link

Hi @vetschn ,

Great to see this package!

I am the main author of an open source project "ixdat" which also includes many python parsers for experimental data formats, including Biologic's .mpt. I'm trying to add a .mpr parser which makes use of eclabfiles for parsing the binary file.

eclabfiles works for some files but not others. For details, see this PR: ixdat/ixdat#134

Briefly, it seems to work for LSV measurements, but not CA or CVA. It's a different error message, so I'll put CA here and CVA in a separate issue.

The error I get is "Error: field '(Q-Qo)' occurs more than once". I get this same error whether using
data, meta = eclabfiles.process("05_O2dose_COox_04_CA_C01.mpr")
or
df = eclabfiles.to_df("05_O2dose_COox_04_CA_C01.mpr")

The file is here, along with plots of the data (made with ixdat.Measurement.read("05_O2dose_COox_04_CA_C01.mpt").plot() as demo'd in "plot_data.py"):
https://www.dropbox.com/scl/fo/cl0cnovmik7pjgcls2l9h/h?rlkey=v93snkrt2rq3uf95au26qdi0o&dl=0

Happy for any help or suggestions!

@vetschn
Copy link
Owner

vetschn commented Nov 11, 2023

Hi @ScottSoren!

First off, thank you for your interest in this package! As you have probably seen from the README, I can unfortunately no longer really maintain this package in a meaningful way, as I have no access to the equipment.

That being said, I highly encourage you to have a look at yadg / the dgbowl suite of tools for parsing and processing a variety of experimental data. The electrochem parser built into yadg is the most comprehensive parser for files from ECLab and is being kept up-to-date.

At a short glance, it also seems like there is a non-negligible overlap between your very nice ixdat project and yadg's capabilities. You should get in touch with @PeterKraus and perhaps even find a way to join ventures towards more standardized experimental data ;)


Now, concerning the actual problem at hand: It looks like both column ID 0x000D

0x000D: ("<f8", "(Q-Qo)", "mA·h"),
and ID 0x01B2
0x01B2: ("<f4", "(Q-Qo)", "C"),
are present in the file, i. e. the charge both in Coulombs and in mA·h. This causes a collision when constructing the data_dtype.
data_dtype = np.dtype(list(zip(names, dtypes)))

The hacky, easy fix would be to rename the columns to avoid the collision. Properly taking care of this might require a little more work.

Actually, it looks like yadg will have the same problem with your file. Could you maybe open the same issue over there so I can try to address it in the up-to-date and maintained parser?

Thanks and apologies for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants