Closed jguides closed 2 years ago
Isn't the last timestamp difference negative?
It is, and presumably that means that the final epoch isn't the final epoch. For my reference, how is the order currently determined?
I haven't dug into it myself (yet), but I believe @shijiegu indicated it was based on the filenames. @jguides , do you have the names of the position files it is trying to order?
Yes:
yes, in this case session 18 s10 is 3 characters, and so it will be considered a later session in the old code. My code fix of epoch order is still in the pull request. It enforces the labeled order in file names. If your older data has similar "s10" situations where the name of the epoch is longer than others, it is likely the epochs are out of order in nwb files.
Since Eric is busy, I just merged the pull request myself. @edeno, feel free to make further changes after. @jguides you could pull the code.
Thanks Shijie!
I got the following error when generating an nwb file. It looks like the error arises because the position_originator thinks the epoch timestamps are out of order. I don't see anything obviously amiss in the yaml file used to generate this nwb file. The distances between epoch starts below seem reasonable up to the last one. I am aware @shijiegu also posted an error arising in the position_originator, although that error looked slightly different, so I'm posting mine here. Thanks in advance for any help with this.
ipdb> np.diff(first_timestamps)/60
array([ 54.81162518, 21.76272645, 50.42214757, 21.59982565, 53.52381701, 28.49434762, 36.55967264, 10.7667066 , 22.31105215, 57.62421057, 28.51698989, 49.44335831, 22.06270885, 54.13967245, 22.25902193, 53.1217701 , 106.73524576, 145.68806351, 151.27331273, 395.00253439, -772.70757801])