You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently experimenting with the analyzer extensions and found it challenging to locate the parameters for each extension. Perhaps I missed it, but I couldn't find any dedicated page or documentation listing this information. While the get_default_extension_params function from the SortingAnalyzer does provide default parameters, it doesn't offer the full range of available options.
I'm primarily raising this issue not because of that, but rather due to some problems I encountered while using templates. Similar issues might occur with other extensions, but I haven't tested those yet.
Specifically, I used 'median' as the operator to compute my templates from the waveforms, and I saved the template extension in my extension folder. The problem arises when the function get_dense_templates_array is called, as it assumes that templates were saved using the 'average' operator. Here's the relevant code:
ifisinstance(one_object, Templates):
templates_array=one_object.get_dense_templates()
elifisinstance(one_object, SortingAnalyzer):
ifreturn_scaled!=one_object.return_scaled:
raiseValueError(
f"get_dense_templates_array: return_scaled={return_scaled} is not compatible; SortingAnalyzer has the opposite setting."
)
ext=one_object.get_extension("templates")
ifextisnotNone:
templates_array=ext.data["average"]
else:
raiseValueError("SortingAnalyzer requires the 'templates' extension to retrieve templates")
else:
raiseValueError("Input must be either Templates or SortingAnalyzer")
A possible solution could be to check for the computed operator such as :
if ext is not None:
operator = ext.params['operators'][0]
templates_array = ext.data[operator]
Thanks again for all the work !
PERON Olivier
The text was updated successfully, but these errors were encountered:
I think it woould be safest to do something like this:
templates_array = ext.data.get("average") or ext.data.get("median")
assert templates_array is not None, "Average or median templates have not been computed."
Hi everyone,
I was recently experimenting with the analyzer extensions and found it challenging to locate the parameters for each extension. Perhaps I missed it, but I couldn't find any dedicated page or documentation listing this information. While the
get_default_extension_params
function from theSortingAnalyzer
does provide default parameters, it doesn't offer the full range of available options.I'm primarily raising this issue not because of that, but rather due to some problems I encountered while using templates. Similar issues might occur with other extensions, but I haven't tested those yet.
Specifically, I used 'median' as the operator to compute my templates from the waveforms, and I saved the template extension in my extension folder. The problem arises when the function
get_dense_templates_array
is called, as it assumes that templates were saved using the 'average' operator. Here's the relevant code:A possible solution could be to check for the computed operator such as :
Thanks again for all the work !
PERON Olivier
The text was updated successfully, but these errors were encountered: