Window information is incorrect in reports
The information displayed in NAF reports about Time Windows is incorrect if a pre-trigger has been used. This is because the underlying TimeWindow object is offset relative to the pre-trigger. Thinking about this, it is obvious that this must be the case to avoid leaking information to the rest of the processing chain. The issue is probably that we use the TimeWindow class for two things:
- Defining 'Abstract' study time windows - i.e. I want active to be from 100ms to 400ms in my epoch
- 'Concrete' study time windows - I now have a dataset in which I will be extracting an epoch of data and need to be able to calculate which points within that epoch are referred to by this window.
There are a couple of possible ways to deal with this. The easiest would be for TimeWindow to have an (optional) display_offset value which is correctly initialised when it is returned from the Study object - we would then add a get_display_ms() routine which would be used. [Actually, thinking about it, does anything ever need the time window in ms which is not offset?]
Another way would be for us to split TimeWindow into two classes as mentioned above - the 'abstract' TimeWindow class would not have the above ability but the 'concrete' one would. If we were to do this, we would have to use TimeWindow as the 'concrete' one and rename the 'abstract' one. This is because all existing HDF5 files have the TimeWindow baked into them and they should all be 'concrete' representations.
I'll try and work up a patch for this at some point, but if anyone wants to help out, that would be great Needless to say, test cases will need to be added for all of this to avoid making a nasty mistake somewhere...