-
Notifications
You must be signed in to change notification settings - Fork 190
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
Mcsh5 offsets and proper scaling in uV for return_scaled #2988
Conversation
for more information, see https://pre-commit.ci
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.
This makes sense to me save the question about the offset. Could we add a link to the specification in the docstring now that we are a it?
The link that you shared could work I think.
[Edit, wrong link]
@@ -121,7 +124,8 @@ def openMCSH5File(filename, stream_id): | |||
Tick = info["Tick"][0] / 1e6 | |||
exponent = info["Exponent"][0] | |||
convFact = info["ConversionFactor"][0] | |||
gain = convFact.astype(float) * (10.0**exponent) | |||
gain_uV = 1e6 * (convFact.astype(float) * (10.0**exponent)) | |||
offset_uV = 1e6 * (info["ADZero"].astype(float) * (10.0**exponent)) |
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.
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.
Indeed, you are right, this should be negative....
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.
Great.
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.
In our implementation the offset is after the gain.
So the offset should be divided by gain I think. Can you check ?
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Does the dtype is always a uint ? why is there this offset ? |
Co-authored-by: Alessio Buccino <[email protected]>
Adding the offsets from the mcs5h header in order to have a recording with offset_to_UV and gain_to_UV. In addition, the gain was entered in V, and thus the scaling was not really making sense. As far as I understand, we want to have return_scaled returning values in uV, am I right? If yes, this is doing the job here, given the documentation that can be found online
https://www.multichannelsystems.com/sites/multichannelsystems.com/files/documents/manuals/HDF5%20MCS%20Raw%20Data%20Definition.pdf