Broken datafiles

Hello Chris,

I have a bit of a guilty conscience because I only write when I can’t fix a mistake :smiley:

Here’s what happened: A PhD student is recording data using MWorks 0.10. However, a few data files only contain a few (5-10 events) instead of thousands of events. The size (~500-750MB) corresponds to that of the healthy files. The same student also had problems with MWorks 0.8 (mwk instead of mwk2 format) with a completely different experiment. I was able to repair the mwk files “by hand” by deleting the beginning of the file to the point where a new header was written. Unfortunately, I can’t find a workaround for the mwk2 format. I also couldn’t figure out what exactly caused the error in her work steps (even though I looked over her shoulder several times).

And I wrote something wrong :scream:. I didn’t delete the beginning of the datafile - instead I cut out the part from "<?xml version“ to "<?xml version“… I had the feeling that maybe the beginning of the file was overwritten by hand by the user?

I’m attaching a broken data file to the email, maybe you have an idea?

Kind regards from Göttingen
Ralf

Hi Ralf,

Good to hear from you! Even if it is only about MWorks problems :wink:

I’m attaching a broken data file to the email, maybe you have an idea?

Are you sure you sent the correct file? I’m seeing 27,174,385 events in it:

>>> from mworks.data import MWKFile
>>> f = MWKFile('pas-PerfFieldsd03042024-HaS-000+01.mwk2')
>>> f.open()
>>> f.num_events
27174385

(I get the same result when reading the file in MATLAB.)

I cut out the part from "<?xml version“ to "<?xml version“… I had the feeling that maybe the beginning of the file was overwritten by hand by the user?

I don’t understand. Neither MWK nor MWK2 is an XML format. The #loadedExperiment variable may have a value that is XML, but even for MWK, that should never be the first event in the file, and it should be preceded by binary data.

What exactly did you edit?

Chris