Skip to content
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

add option for pretrigger memsize to channel readout #1461

Merged
merged 4 commits into from
Feb 13, 2019

Conversation

peendebak
Copy link
Contributor

The option to acquire a single value from the M4i digitizer records an array of data and then takes the mean. Part of this data is from the actual moment the value is requested (the pre-trigger part of the buffer). This PR make sthe pre-trigger size configurable and changes the default to 16 (as small as possible).

@jenshnielsen @astafan8

@codecov
Copy link

codecov bot commented Feb 4, 2019

Codecov Report

Merging #1461 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1461   +/-   ##
=======================================
  Coverage   73.86%   73.86%           
=======================================
  Files          92       92           
  Lines       10411    10411           
=======================================
  Hits         7690     7690           
  Misses       2721     2721

Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart the two comments. Looking forward to your response on them

@@ -611,7 +611,7 @@ def convert_to_voltage(self, data, input_range):
return data * input_range / resolution

def initialize_channels(self, channels=None, mV_range=1000, input_path=0,
termination=0, coupling=0, compensation=None, memsize=2**12):
termination=0, coupling=0, compensation=None, memsize=2**12, pretrigger_memsize = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make the default value of this argument 16 instead of None? This will remove the need for a couple of lines of code below, and simplify the code because pretrigger_memsize will become of type int instead of Optional[int].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astafan8 I agree. There might be future cases where we want to calculate the actual value, but since that is currently not there let's just use the smallest value possible.

@@ -621,9 +621,13 @@ def initialize_channels(self, channels=None, mV_range=1000, input_path=0,
mV_range, input_path, termination, coupling, compensation: passed
to the set_channel_settings function
memsize (int): memory size to use for simple channel readout
pretrigger_memsize (None or int): pretrigger memory size to use. If None calculate a default value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ".. calculate a default value" part is misleading because nothing is being calculated, the default value is just hardcoded. I recommend to remove this notion. It is much more useful to add the fact that "16" is apparently the smallest possible value for pretrigger memory - this will be very helpful for users.

@astafan8 astafan8 merged commit 07c20db into microsoft:master Feb 13, 2019
giulioungaretti pushed a commit that referenced this pull request Feb 13, 2019
Merge: bec01dc 4f2e6ab
Author: Mikhail Astafev <[email protected]>

    Merge pull request #1461 from VandersypenQutech/feat/m4i_pretrigger
@peendebak peendebak deleted the feat/m4i_pretrigger branch March 22, 2019 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants