The ecephys CSD module is incorrectly flagging channels as 'noise' and removing them before computing the CSD. This noise actually reflects signal at the tip reference that isn't getting removed before the noise filter is applied. This PR addresses this issue by re-referencing the LFP to the agar channels before computing the CSD.
There is also a minor fix to the re-referencing function. This function was re-referencing to all channels above the surface channel. This can sometimes fail for experiments with shallow probe insertions as the uppermost channels are in air and not agar. I have modified this function to place a limit on the number of channels to use for re-referencing.
Type of Fix:
[ x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
Overview:
The ecephys CSD module is incorrectly flagging channels as 'noise' and removing them before computing the CSD. This noise actually reflects signal at the tip reference that isn't getting removed before the noise filter is applied. This PR addresses this issue by re-referencing the LFP to the agar channels before computing the CSD.
There is also a minor fix to the re-referencing function. This function was re-referencing to all channels above the surface channel. This can sometimes fail for experiments with shallow probe insertions as the uppermost channels are in air and not agar. I have modified this function to place a limit on the number of channels to use for re-referencing.
Type of Fix:
Changes: