@@ -253,15 +253,14 @@ class PostProcessing(dj.Imported):
253
253
def make (self , key ):
254
254
execution_time = datetime .utcnow ()
255
255
256
- # Load recording object.
256
+ # Load recording & sorting object.
257
257
clustering_method , output_dir , params = (
258
258
ephys .ClusteringTask * ephys .ClusteringParamSet & key
259
259
).fetch1 ("clustering_method" , "clustering_output_dir" , "params" )
260
260
output_dir = find_full_path (ephys .get_ephys_root_data_dir (), output_dir )
261
-
262
- # Get sorter method and create output directory.
263
261
sorter_name = clustering_method .replace ("." , "_" )
264
262
output_dir = find_full_path (ephys .get_ephys_root_data_dir (), output_dir )
263
+
265
264
recording_file = output_dir / sorter_name / "recording" / "si_recording.pkl"
266
265
sorting_file = output_dir / sorter_name / "spike_sorting" / "si_sorting.pkl"
267
266
@@ -301,14 +300,13 @@ def make(self, key):
301
300
_ = si .postprocessing .compute_principal_components (
302
301
waveform_extractor = we , ** params .get ("SI_QUALITY_METRICS_PARAMS" , None )
303
302
)
303
+ metrics = si .qualitymetrics .compute_quality_metrics (waveform_extractor = we )
304
+
304
305
# Save the output (metrics.csv to the output dir)
305
306
metrics_output_dir = output_dir / sorter_name / "metrics"
306
307
metrics_output_dir .mkdir (parents = True , exist_ok = True )
307
-
308
- metrics = si .qualitymetrics .compute_quality_metrics (waveform_extractor = we )
309
308
metrics .to_csv (metrics_output_dir / "metrics.csv" )
310
309
311
- # Save results
312
310
self .insert1 (
313
311
{
314
312
** key ,
0 commit comments