Closed kkreplin closed 8 years ago
Dear Katharina,
You can try adding a condition in mdf4 class read4 method after if not info['DGBlock'][dataGroup]['dg_data'] == 0
add and info['CGBlock'][dataGroup][0]['cg_cycle_count']
Tell me if it solves your issue
Aymeric
Dear Katharina, You can have a look in latest version, I added this additionnal condition for cycle_count in case of empty data. By the way weird because normally pointer for data block should be null and already filtered out for reading. Also merged recordchannel, invalid_bytes and canopen classes into a single class channel for simplification.
Dear Aymeric,
thanks, that solved the issue!
Regards, Katharina
Dear Aymeric,
Unfortunately, I found a corner case in some of my files, that causes an numpy core records error:
It is triggered, when numberOfRecords == 0. In the
readSortedRecord
function, I'm in the case channelList is None and self.byte_aligned. Then the callreturn fromfile(fid, dtype=self.numpyDataRecordFormat, shape=self.numberOfRecords, names=self.dataRecordName)
throws the numpy error.Do you have a suggestion how to handle this corner case? It is a measurement, which is written to file, but no data is actually recorded.
Thanks, Katharina