Skip to content

Monopolar triangulation for compute('unit_locations') is inconsistent with compute('spike_locations') #4486

@ecobost

Description

@ecobost

compute_monopolar_triangulation() from localization_tools:

def compute_monopolar_triangulation(
sorting_analyzer_or_templates: SortingAnalyzer | Templates,
unit_ids=None,
optimizer: str = "least_square",
radius_um: float = 75,
max_distance_um: float = 1000,
return_alpha: bool = False,
enforce_decrease: bool = False,
feature: str = "ptp",
) -> np.ndarray:

is used for analyzer.compute('unit_locations') while LocalizeMonopolarTriangulation from sortincomponents.peak_localization
def __init__(
self,
recording,
parents,
return_output=True,
radius_um=75.0,
max_distance_um=150.0,
optimizer="minimize_with_log_penality",
enforce_decrease=True,
feature="ptp",
):

is used for motion correction and analyzer.compute('spike_locations').

The issue is that they have different default arguments (as can be seen above). Is that intended? I would think the args from LocalizeMonopolarTriangulation (which use more bells and whistles) make more sense overall.

A separate issue is that enforce_decrease has no effect in compute_monopolar_triangulation (it is just commented out)

# if enforce_decrease:
# enforce_decrease_shells_data(
# wf_data, best_channels[unit_id], enforce_decrease_radial_parents, in_place=True
# )

Is that also intended? Either it should be uncommented or the argument dropped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions