| Reference | Downloads | Github

Writing condition file data to ioHub's HDF5 data store

Not sure if anyone other than @sol is familiar enough with the inner workings of ioHub to answer this, but here goes…

Is anyone using ioHub’s .createTrialHandlerRecordTable() method to link the HDF5 data storage file to a PsychoPy loop/TrialHandler?

I find it works, inasmuch as it creates a table within the HDF5 file, with the variable names from the loop’s conditions file. On every trial, if I call .addTrialHandlerRecord(), then that table’s content also gets populated with the values of those variables for each trial.

The problem arises after the first session: calling .createTrialHandlerRecordTable() a second time seems to initialise the table again from scratch. i.e. it overwrites the data from the first session.

I tried only calling .createTrialHandlerRecordTable() once, on the first session only, and on subsequent sessions just calling .addTrialHandlerRecord() on each trial, in the hope that this would append records to the already existing table. But this doesn’t work (presumably as ioHub doesn’t have a current reference to the TrialHandlerRecord table). i.e. in this approach, the table from the initial session is preserved, but no new data is stored.

Does anyone know a way around this? Data from subsequent sessions seems to be appended appropriately to all the other tables within the HDF5 data structure.