features.denoise_dataframe
features.denoise_dataframe(df_pid, fac=DEFAULT_FAC, channel_labels=None)Applies total variation filter denoising to the features of a single probe insertion dataframe.
This function processes electrophysiological features by applying a total variation filter to denoise them. If a transformation is defined in the metadata schema for a feature, it will be applied before denoising. Channels marked with non-zero labels are treated as invalid and their values are interpolated from neighboring channels.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df_pid | pandas.DataFrame | DataFrame containing probe insertion data with features to denoise. Must contain ‘lateral_um’, ‘axial_um’, and ‘labels’ columns. | required |
| fac | float or dict | Factor for the TV denoising in median deviation units. Higher values result in stronger denoising. Either a single scalar applied to every feature group, or a dict mapping a subset of {‘raw_ap’, ‘raw_lf’, ‘raw_lf_csd’, ‘waveforms’} to their own factor (see feature_group_of_column_map). Groups absent from the dict default to 1. |
DEFAULT_FAC |
Returns
| Name | Type | Description |
|---|---|---|
| pandas.DataFrame | A new dataframe with the same structure as the input, but with denoised feature values. Non-feature columns are copied without modification. |