Hi,
Heberto again, from the double sampling thread. I am writing a pyPhotometry interface for neuroconv, and timing is the part of an NWB file I am most careful about, since it is what everything else in a session gets aligned against. What follows is almost certainly too small to be behaviourally relevant, but I would rather not assume that if I do not have to.
In the continuous modes continuous_ISR reads the two ADCs one after the other, and MicroPython documents read_timed as blocking until its buffer is full:
https://github.com/pyPhotometry/code/blob/v1.1/uPy/photometry_upy.py#L146-L159
But import_ppd returns one time vector for every analog signal:
https://github.com/pyPhotometry/code/blob/v1.1/tools/data_import.py#L97
With a 64 sample buffer and oversampling_rate at 300 kHz, analog 2 looks like it starts at least 213 us after analog 1, plus whatever the lines between the two reads cost. I can bound it the other way too, since the whole interrupt has to fit inside one sample period, so at the 1 kHz ceiling it is somewhere under about 787 us. What I cannot do is turn that into a number, as neither constant is in the header.
So for now I write the continuous signals on the shared timebase and say in the file that they are not simultaneous. Is that shared time vector meant as "the offset is small enough to ignore", or should a reader be offsetting the second channel by a figure you have measured? Is this hardware detail documented somewhere?
Hi,
Heberto again, from the double sampling thread. I am writing a pyPhotometry interface for neuroconv, and timing is the part of an NWB file I am most careful about, since it is what everything else in a session gets aligned against. What follows is almost certainly too small to be behaviourally relevant, but I would rather not assume that if I do not have to.
In the continuous modes
continuous_ISRreads the two ADCs one after the other, and MicroPython documentsread_timedas blocking until its buffer is full:https://github.com/pyPhotometry/code/blob/v1.1/uPy/photometry_upy.py#L146-L159
But
import_ppdreturns one time vector for every analog signal:https://github.com/pyPhotometry/code/blob/v1.1/tools/data_import.py#L97
With a 64 sample buffer and
oversampling_rateat 300 kHz, analog 2 looks like it starts at least 213 us after analog 1, plus whatever the lines between the two reads cost. I can bound it the other way too, since the whole interrupt has to fit inside one sample period, so at the 1 kHz ceiling it is somewhere under about 787 us. What I cannot do is turn that into a number, as neither constant is in the header.So for now I write the continuous signals on the shared timebase and say in the file that they are not simultaneous. Is that shared time vector meant as "the offset is small enough to ignore", or should a reader be offsetting the second channel by a figure you have measured? Is this hardware detail documented somewhere?