ixdat / ixdat

The In-situ Experimental Data Tool
https://ixdat.readthedocs.io
MIT License
23 stars 13 forks source link

Did not find any "time/s" column in MPT file, even though it is there #108

Closed matenestor closed 1 year ago

matenestor commented 1 year ago

Ixdat can't parse MPT files that were generated post-measurement from MPR files. Such files have just a few metadata lines:

EC-Lab ASCII FILE                                                               
Nb header lines : 3                                                             
freq/Hz Re(Z)/Ohm   -Im(Z)/Ohm  |Z|/Ohm Phase(Z)/deg    time/s  <Ewe>/V <I>/mA ...
1,9999814E+005  6,6673303E+002  -2,7343878E+002  7,2062592E+002  2,2299385E+001   3,244848644788726E+001  2,4071446E-001  -1,4733075E-002 ...
...

The problem is biologic.py:process_header_line() method. The self.N_header_lines attribute is filled correctly, but the code never gets to the point where it changes the state of the self.place_in_file attribute to "column names", because it never finds a value for the self.timestamp_string.

I was able to read my files when I changed it myself in the first if condition where self.N_header_lines is filled. Together with self.tstamp, because that is necessary, when you want to plot the measurement. The value from that I took from the timestamp in the filename.

ScottSoren commented 1 year ago

Oh no. I saw this once, ages ago (pre-ixdat). It was strangely specific to a certain experiment or certain installation of EC-Lab, I don't remember. Can you add that information here? Normally, post-conversion of .mpr to .mpt works fine, generating the full header. Modifying the reader so that it can handle these stump-header .mpt files is easy, as you describe, but the problem is, how can one then know the timestamp? Without this knowledge from somewhere, it is impossible to synchronize with other techniques. If, as described in #107 , the EC-Lab data is generated in connection with Zilien, is there an offset value stored in the .tsv file that could be used?

tugce-y commented 1 year ago

I was never able to plot the post-converted .mpt files with ixdat, I always get this error regardless of the technique (chronoamperometry, chronopotentiometry, CV) if that's what you're asking.

I do the conversion from .mpr file to .mpt file from EC-lab>Experiment>Export as text file, which results in 3 lines header without any timestamp info. I don't know if there is a specific way of converting .mpr to .mpt to avoid this.

matenestor commented 1 year ago

There are timestamps in the .tsv file, but the values don't really match. I will discuss that here in Spectro if the timestamps can be used somehow.

ScottSoren commented 1 year ago

@tugce-y , annoying that this problem is there for all techniques! but I have definitely post-converted many .mpr files to .mpt without truncated header before, so there is something specific going on. Can you share for the record here, what version of EC-Lab was used, both to generate the .mpr files and for the conversion to .mpt?

ScottSoren commented 1 year ago

@tugce-y , did you ever figure out what was causing the truncated file headers in the .mpt‘s? If not I'll close this issue as a Biologic problem. https://www.biologic.net/contact/?form=support

tugce-y commented 1 year ago

@ScottSoren, I don't know the reason but if I enable text export option in EC-Lab > Safety/Adv. Settings > Data Process before the experiment there is no problem with time stamps. For the post conversion, @matenestor manually aligned the EC time and MS time approximately, which is not ideal. This issue happened to me both in DTU and Spectro Inlets. I know the EC-lab version in DTU is 11.36. I don't remember what was the version in Spectro.

ScottSoren commented 1 year ago

Thanks for the update, @tugce-y ! I'll add a note in the documentation of the biologic module that text export shoud be enabled when starting the measurement in EC-Lab.

ScottSoren commented 11 months ago

@tugce-y and @matenestor , this may interest you: https://github.com/ixdat/ixdat/pull/134 It will soon be possible to just read the .mpr files when something like this is wrong with the .mpt files :) . Feel free to comment on that PR.