You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think this is a bug in Matti's code but in how we are using coil_type (wherever that is in the original report). See how it's handled in forward:
My assumption when I saw this code was that the higher order bits were being used to store some form of additional information. Hopefully @mshamalainen can share some insight but in the meantime we can probably work on fixing wherever coil_type is used instead of changing this (likely correct) behavior.
So this use of higher order bits is only for ctf data? Sounds like something very error prone to me. Any idea where the grad_order_no is used or what does it mean?
Looking a bit deeper into the CTF code (mne_ctf_comp.c), the higher order bits indicate the compensation grade. Other systems don't have compensation, so they effectively have/use these bits but they are naturally always zero. I haven't looked into grad_order_no, but it could be related to the compensation grade.
There is possibly a CTF-related bug here in the sense that, when we apply compensation, we don't change these higher order bits -- it's possible we're supposed to do that, but I'm not sure.
From a quick conversation with Matti, it looks like if we do write out data that has been compensated, we should set the higher order bits to the compensation grade.
Activity
jaeilepp commentedon Mar 25, 2016
And
201609 = 5001 | 3 << 165001 is defined as FIFF.FIFFV_COIL_CTF_GRAD
larsoner commentedon Mar 25, 2016
I don't think this is a bug in Matti's code but in how we are using
coil_type(wherever that is in the original report). See how it's handled in forward:https://github.com/mne-tools/mne-python/blob/master/mne/forward/_make_forward.py#L126
Which led me to do the same thing a couple of days back in my PR:
https://github.com/mne-tools/mne-python/blob/master/mne/viz/_3d.py#L472
My assumption when I saw this code was that the higher order bits were being used to store some form of additional information. Hopefully @mshamalainen can share some insight but in the meantime we can probably work on fixing wherever
coil_typeis used instead of changing this (likely correct) behavior.jaeilepp commentedon Mar 25, 2016
So this use of higher order bits is only for ctf data? Sounds like something very error prone to me. Any idea where the
grad_order_nois used or what does it mean?larsoner commentedon Mar 25, 2016
Looking a bit deeper into the CTF code (mne_ctf_comp.c), the higher order bits indicate the compensation grade. Other systems don't have compensation, so they effectively have/use these bits but they are naturally always zero. I haven't looked into
grad_order_no, but it could be related to the compensation grade.There is possibly a CTF-related bug here in the sense that, when we apply compensation, we don't change these higher order bits -- it's possible we're supposed to do that, but I'm not sure.
larsoner commentedon May 11, 2016
@mshamalainen it looks like
mne_process_rawwith a non-zero--gradoption does not modify thecoil_type, but I suspect it should. Any ideas?larsoner commentedon Jul 19, 2016
From a quick conversation with Matti, it looks like if we do write out data that has been compensated, we should set the higher order bits to the compensation grade.
larsoner commentedon Jul 19, 2016
@jaeilepp do you remember where you actually saw
coil_typebeing mis-used due to the compensation grade being present?jaeilepp commentedon Jul 20, 2016
No idea. I cannot find the mailing list post that had this issue. I think we can close this.