1111import matplotlib .pyplot as plt
1212
1313from ibllib .dsp import voltage
14- from ibllib .plots .snapshot import ReportSnapshot
14+ from ibllib .plots .snapshot import ReportSnapshotProbe
1515from one .api import ONE
1616import one .alf .io as alfio
1717from one .alf .exceptions import ALFObjectNotFound
2222logger = logging .getLogger ('ibllib' )
2323
2424
25- class BadChannelsAp ( ReportSnapshot ):
25+ class SpikeSorting ( ReportSnapshotProbe ):
2626 """
2727 Plots raw electrophysiology AP band
2828 :param session_path: session path
@@ -34,20 +34,44 @@ class BadChannelsAp(ReportSnapshot):
3434 'output_files' : [] # see setUp method for declaration of inputs
3535 }
3636
37- def __init__ (self , session_path , probe_id , ** kwargs ):
38- self .content_type = 'probeinsertion'
39- self .pid = probe_id
40- super (BadChannelsAp , self ).__init__ (session_path , probe_id , content_type = self .content_type , ** kwargs )
37+ def _run (self ):
38+ """runs for initiated PID, streams data, destripe and check bad channels"""
39+ assert self .pid
40+
41+ def get_probe_signature (self ):
42+ input_signature = [('spikes.times.npy' , f'alf/{ self .pname } ' , True ),
43+ ('spikes.amps.npy' , f'alf/{ self .pname } ' , True ),
44+ ('spikes.depths.npy' , f'alf/{ self .pname } ' , True )]
45+ output_signature = [('spike_sorting_raster.png' , f'snapshot/{ self .pname } ' , True )]
46+ self .signature = {'input_files' : input_signature , 'output_file' : output_signature }
47+
48+
49+ class BadChannelsAp (ReportSnapshotProbe ):
50+ """
51+ Plots raw electrophysiology AP band
52+ task = BadChannelsAp(pid, one=one=one)
53+ :param session_path: session path
54+ :param probe_id: str, UUID of the probe insertion for which to create the plot
55+ :param **kwargs: keyword arguments passed to tasks.Task
56+ """
57+ signature = {
58+ 'input_files' : [], # see setUp method for declaration of inputs
59+ 'output_files' : [] # see setUp method for declaration of inputs
60+ }
4161
4262 @staticmethod
43- def spike_sorting_signature (pname = None ):
63+ def get_probe_signature (pname = None ):
4464 pname = pname if pname is not None else "probe*"
4565 input_signature = [('*ap.meta' , f'raw_ephys_data/{ pname } ' , True ),
4666 ('*ap.ch' , f'raw_ephys_data/{ pname } ' , False ),
4767 ('*ap.cbin' , f'raw_ephys_data/{ pname } ' , False )]
48- output_signature = [('destripe.png' , f'snapshot/{ pname } ' , True ),
49- ('highpass.png' , f'snapshot/{ pname } ' , True )]
50- return input_signature , output_signature
68+ output_signature = [('raw_ephys_bad_channels.png' , f'snapshot/{ pname } ' , True ),
69+ ('raw_ephys_bad_channels_highpass.png' , f'snapshot/{ pname } ' , True ),
70+ ('raw_ephys_bad_channels_highpass.png' , f'snapshot/{ pname } ' , True ),
71+ ('raw_ephys_bad_channels_destripe.png' , f'snapshot/{ pname } ' , True ),
72+ ('raw_ephys_bad_channels_difference.png' , f'snapshot/{ pname } ' , True ),
73+ ]
74+ return {'input_files' : input_signature , 'output_files' : output_signature }
5175
5276 def _run (self ):
5377 """runs for initiated PID, streams data, destripe and check bad channels"""
0 commit comments