Reading old .mwk files

Hi Chris,

I hope this email finds you well. I was wondering if there is a way to read the old .mwk (not .mwk2) in python, and preferably without loading the Mworks library? I am in need of accessing some older data, and neither Braintree nor Openmind have the Mworks library installed. It would be great, if there is already some python code available for this.

Thanks!
Aliya (DiCarlo Lab)

Hi Aliya,

You could try using this simple MWK reader. It will be slow, and it doesn’t offer any kind of filtering or event selection, but it is pure Python with no external dependencies. You can use it like this:

with MWKReader('my_data.mwk') as event_file:
    for code, time, data in event_file:
        # Process the current event
        ...

Be sure to open the actual .mwk file and not a .mwk directory containing the file (more info).

I hope that helps!

Cheers,
Chris