echemdata / galvani

Read proprietary file formats from electrochemical test stations
GNU General Public License v3.0
47 stars 30 forks source link

[sugestion] Get more precise start date without log module #94

Open NuxitBrain opened 10 months ago

NuxitBrain commented 10 months ago

dear all !

For the moment, the self.startdate only give the start date in day. For some application, we need more precise launch time ( at least hour base). I now that we can get more precise timing with self.timestamp but for that, we need to end the programe ( creation of the log part). Do you thing it possible to read the the timestamp values at another place in the raw file ? or if the start date is whriten somewhere else more precisely ?

thank you in advance

PeterKraus commented 10 months ago

I don't think the start timestamp (as an OLE date) is stored anywhere else but in the LOG module. This module also happens to be overwritten if there is an external device (EXTDEV) module. If anyone finds a way around this, instead of relying on file mtime/ctime, I'd also be happy to hear about it.

JhonFlash3008 commented 10 months ago

Yes it seems that the timestamp is exclusively in the LOG module. And the LOG module is added to the .mpr file when the experiment is ended, before that it is stored in a .mpl LOG file. So I think the easiest way around it would be to check if the .mpl is present in the folder where the .mpr is stored, and extract the timestamp with basic regular expression handling.

This could also be done during initialization of the MPRfile class. Same for the LOOP module.

@PeterKraus what is the external device module ? I couldn't find it

PeterKraus commented 10 months ago

Using mpl files for this purpose is not a bad idea, actually. Thanks, I'll try and look into it.

I think some potentiostats allow you to add an external sensor, such as a temperature and/or pressure sensor (really just a calibrated voltage readout). For the dtypes we parse in yadg, see here.