Add units param to get_data methods in Raw and Epochs#8476
Add units param to get_data methods in Raw and Epochs#8476sappelhoff wants to merge 2 commits intomne-tools:mainfrom
Conversation
Yes, feel free to add a proper RST target name to that header and link to it with here https://mne.tools/dev/glossary.html since we also talk about SI units there a bit. |
|
These are the units we use in MNE (are these all the units we use?) (ref) I am a bit confused how we would handle derived units like would we allow scaling to |
|
finally, what "multiples" and "submultiples" should we allow? All those that are in this list? https://bids-specification.readthedocs.io/en/stable/99-appendices/05-units.html#prefixes That'd be based on the CMIXF-12 format for representing units in ASCII |
Yes. Somewhere we already parse fractional units and figure out what the scale factors are to get to SI units. Let me dig it up... |
No, but it's probably "good enough" for most people as a reference. The complete list is probably provided by the FIF spec at the moment, because we expand it as we need to: https://github.com/mne-tools/mne-python/blob/master/mne/io/constants.py#L786-L836 I would not worry about supporting all of these. Let's just get the data units we're likely to need. We can always expand later.
Refactor code from here, put it in https://github.com/mne-tools/mne-python/blob/master/mne/tests/test_defaults.py#L25 I would even just start with this list of prefixes and |
|
Just wondering if we can also allow µV in addition to uV, or would that become messy? |
I would suggest to allow Also brings up this comment again where I was a little too slow to chime in that U+03BC is preferred over U+00B5 by the unicode consortium: #7497 (comment) |
|
Is there any way to easily figure out which unicode characterI'm producing on macOS via Option-M (µ)? |
|
wow… thanks! |
|
I thought I'd get to this PR this weekend, but unfortunately that won't happen.
EDIT: I won't have time for this for now. Please take it over if you care about this! This may be a nice lead: https://github.com/mne-tools/mne-python/pull/8760/files#r559649851 |
e83187e to
8212f8e
Compare
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
8212f8e to
21e7e5c
Compare
|
closing in favor of #9136 |

closes #8473
Let me start by making a docstr proposal --> once we are clear on the functionality I can give it a try and implement it.
Should we link to https://mne.tools/stable/overview/implementation.html?highlight=units#id20 from the docstr?