-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calibration trigger refactor and cleanup #149
Changes from 6 commits
1213fd9
13a3b95
044e1ba
fd6cf66
652276f
297de3e
75dc91c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,11 +46,6 @@ def __init__(self, | |
|
||
self.data_source = data_source | ||
|
||
self.refresh_rate = refresh | ||
self.samples_per_second = device_info.fs | ||
self.records_per_refresh = int( | ||
(self.refresh_rate / 1000) * self.samples_per_second) | ||
|
||
self.channels = device_info.channels | ||
self.removed_channels = ['TRG', 'timestamp'] | ||
self.data_indices = self.init_data_indices() | ||
|
@@ -64,6 +59,11 @@ def __init__(self, | |
# Default filter | ||
self.filter = Downsample(self.downsample_factor) | ||
|
||
self.refresh_rate = refresh | ||
self.samples_per_second = device_info.fs / self.downsample_factor | ||
self.records_per_refresh = int( | ||
(self.refresh_rate / 1000) * self.samples_per_second) | ||
|
||
self.autoscale = True | ||
self.y_min = -y_scale | ||
self.y_max = y_scale | ||
|
@@ -322,7 +322,7 @@ def cursor_x(self): | |
|
||
def init_data(self): | ||
"""Initialize the data.""" | ||
channel_data = self.filter(self.current_data()) | ||
channel_data, _ = self.filter(self.current_data()) | ||
|
||
for i, _channel in enumerate(self.data_indices): | ||
data = channel_data[i].tolist() | ||
|
@@ -351,7 +351,7 @@ def update_view(self, _evt): | |
"""Called by the timer on refresh. Updates the buffer with the latest | ||
data and refreshes the plots. This is called on every tick.""" | ||
self.update_buffer() | ||
channel_data = self.filter(self.current_data()) | ||
channel_data, _ = self.filter(self.current_data()) | ||
|
||
# plot each channel | ||
for i, _channel in enumerate(self.data_indices): | ||
|
@@ -501,7 +501,7 @@ def main(data_file: str, | |
parser.add_argument('-r', | ||
'--refresh', | ||
help='refresh rate in ms', | ||
default=500, | ||
default=300, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the refresh rate of the viewer, not the EEG device. It was set to refresh the display every 500 ms (half second). Was this choppy? The downside to a more frequent refresh is more performance overhead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wasn't buggy at 300 but I will revert since it is configurable! |
||
type=int) | ||
parser.add_argument('-y', '--yscale', help='yscale', default=150, type=int) | ||
parser.add_argument('-m', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lawhead I addressed all comments I intended in this PR. I added this after testing everything and running into an issue with downsample in the data viewer. Can you look this part over to make sure it looks ok?
Changed:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the samples_per_second is not correct. This value is used to get the raw data before the filters are applied so it doesn't seem like it would retrieve enough data.