Skip to content

spikesorting_artifact.py

ArtifactDetectionParameters

Bases: SpyglassMixin, Manual

Source code in src/spyglass/spikesorting/spikesorting_artifact.py
@schema
class ArtifactDetectionParameters(SpyglassMixin, dj.Manual):
    definition = """
    # Parameters for detecting artifact times within a sort group.
    artifact_params_name: varchar(200)
    ---
    artifact_params: blob  # dictionary of parameters
    """

    def insert_default(self):
        """Insert the default artifact parameters with an appropriate parameter dict."""
        artifact_params = {}
        artifact_params["zscore_thresh"] = None  # must be None or >= 0
        artifact_params["amplitude_thresh"] = 3000  # must be None or >= 0
        # all electrodes of sort group
        artifact_params["proportion_above_thresh"] = 1.0
        artifact_params["removal_window_ms"] = 1.0  # in milliseconds
        self.insert1(["default", artifact_params], skip_duplicates=True)

        artifact_params_none = {}
        artifact_params_none["zscore_thresh"] = None
        artifact_params_none["amplitude_thresh"] = None
        self.insert1(["none", artifact_params_none], skip_duplicates=True)

insert_default()

Insert the default artifact parameters with an appropriate parameter dict.

Source code in src/spyglass/spikesorting/spikesorting_artifact.py
def insert_default(self):
    """Insert the default artifact parameters with an appropriate parameter dict."""
    artifact_params = {}
    artifact_params["zscore_thresh"] = None  # must be None or >= 0
    artifact_params["amplitude_thresh"] = 3000  # must be None or >= 0
    # all electrodes of sort group
    artifact_params["proportion_above_thresh"] = 1.0
    artifact_params["removal_window_ms"] = 1.0  # in milliseconds
    self.insert1(["default", artifact_params], skip_duplicates=True)

    artifact_params_none = {}
    artifact_params_none["zscore_thresh"] = None
    artifact_params_none["amplitude_thresh"] = None
    self.insert1(["none", artifact_params_none], skip_duplicates=True)