Skip to main content

cells.select_good_units_relaxed_rp

cells.select_good_units_relaxed_rp(df_clusters, rp_confidence_threshold=70.0)

Good-unit mask with a relaxed sliding-refractory-period inclusion criterion.

The standard good-unit definition (bitwise_fail == 0, computed upstream by brainbox.metrics.single_units.compute_labels) requires the sliding-RP metric (max_confidence) to reach :data:BITWISE_FAIL_RP_CONFIDENCE_THRESHOLD (90%) confidence (bit 0 of bitwise_fail). This keeps the noise-cutoff and amplitude vetoes (bits 1-2) unchanged, but relaxes that RP bit to rp_confidence_threshold applied directly to max_confidence, letting through units whose refractory-period confidence is lower than 90% but still above the threshold.

Parameters

Name Type Description Default
df_clusters pandas.DataFrame Cluster-level metadata; must include bitwise_fail and max_confidence columns. required
rp_confidence_threshold float Minimum max_confidence (0-100 scale) to pass. Defaults to 70.0, vs the standard 90.0 baked into bitwise_fail. 70.0

Returns

Name Type Description
numpy.ndarray Boolean mask, one entry per row of df_clusters. Clusters with a NaN max_confidence (too few spikes to compute) are treated as fail.