Skip to content

Commit

Permalink
FIX: SI
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 28, 2024
1 parent d62dbb1 commit 880356e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
33 changes: 26 additions & 7 deletions mne/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
whitened="k",
gsr="#666633",
temperature="#663333",
eyegaze="k",
pupil="k",
),
si_units=dict(
mag="T",
Expand All @@ -60,13 +62,14 @@
fnirs_fd_ac_amplitude="V",
fnirs_fd_phase="rad",
fnirs_od="V",
# TODO: These units and scalings are wrong
fnirs_td_gated_amplitude="Au",
fnirs_td_moments_amplitude="Au",
fnirs_td_gated_amplitude="M",
fnirs_td_moments_amplitude="M",
csd="V/m²",
whitened="Z",
gsr="S",
temperature="C",
eyegaze="rad",
pupil="µm",
),
units=dict(
mag="fT",
Expand All @@ -89,12 +92,14 @@
fnirs_fd_ac_amplitude="V",
fnirs_fd_phase="rad",
fnirs_od="V",
fnirs_td_gated_amplitude="Au",
fnirs_td_moments_amplitude="Au",
fnirs_td_gated_amplitude="µM",
fnirs_td_moments_amplitude="µM",
csd="mV/m²",
whitened="Z",
gsr="S",
temperature="C",
eyegaze="rad",
pupil="µm",
),
# scalings for the units
scalings=dict(
Expand All @@ -118,12 +123,14 @@
fnirs_fd_ac_amplitude=1.0,
fnirs_fd_phase=1.0,
fnirs_od=1.0,
fnirs_td_gated_amplitude=1.0,
fnirs_td_moments_amplitude=1.0,
fnirs_td_gated_amplitude=1e6,
fnirs_td_moments_amplitude=1e6,
csd=1e3,
whitened=1.0,
gsr=1.0,
temperature=1.0,
eyegaze=1.0,
pupil=1e6,
),
# rough guess for a good plot
scalings_plot_raw=dict(
Expand Down Expand Up @@ -159,6 +166,8 @@
gof=1e2,
gsr=1.0,
temperature=0.1,
eyegaze=2e-1,
pupil=1e-2,
),
scalings_cov_rank=dict(
mag=1e12,
Expand All @@ -184,6 +193,8 @@
hbo=(0, 20),
hbr=(0, 20),
csd=(-50.0, 50.0),
eyegaze=(-1, 1),
pupil=(-1.0, 1.0),
),
titles=dict(
mag="Magnetometers",
Expand Down Expand Up @@ -212,6 +223,14 @@
stim="Stimulus",
gsr="Galvanic skin response",
temperature="Temperature",
eyegaze="Eye-tracking (Gaze position)",
pupil="Eye-tracking (Pupil size)",
resp="Respiration monitoring channel",
chpi="Continuous head position indicator (HPI) coil channels",
exci="Flux excitation channel",
ias="Internal Active Shielding data (Triux systems)",
syst="System status channel information (Triux systems)",
whitened="Whitened data",
),
mask_params=dict(
marker="o",
Expand Down
4 changes: 2 additions & 2 deletions mne/io/snirf/_snirf.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,10 @@ def _get_dataunit_scaling(hbx_unit):
return scalings[hbx_unit]
except KeyError:
raise RuntimeError(
f"The Hb unit {hbx_unit} is not supported "
f"The Hb unit {repr(hbx_unit)} is not supported "
"by MNE. Please report this error as a GitHub "
"issue to inform the developers."
)
) from None


def _extract_sampling_rate(dat):
Expand Down

0 comments on commit 880356e

Please sign in to comment.