AllenInstitute / AllenSDK

code for reading and processing Allen Institute for Brain Science data
https://allensdk.readthedocs.io/en/latest/
Other
335 stars 149 forks source link

Csd re-referencing #2587

Closed corbennett closed 1 year ago

corbennett commented 1 year ago

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: