@@ -1055,9 +1055,6 @@ def _run(self, cams=None, overwrite=False):
10551055class EphysPostDLC (tasks .Task ):
10561056 """
10571057 The post_dlc task takes dlc traces as input and computes useful quantities, as well as qc.
1058-
1059- For creating the full dlc_qc_plot, several other inputs are required that can be found in the docstring of
1060- :py:func:ibllib.plots.figures.dlc_qc_plot
10611058 """
10621059 io_charge = 90
10631060 level = 3
@@ -1067,11 +1064,28 @@ class EphysPostDLC(tasks.Task):
10671064 ('_ibl_rightCamera.dlc.pqt' , 'alf' , True ),
10681065 ('_ibl_rightCamera.times.npy' , 'alf' , True ),
10691066 ('_ibl_leftCamera.times.npy' , 'alf' , True ),
1070- ('_ibl_bodyCamera.times.npy' , 'alf' , True )],
1067+ ('_ibl_bodyCamera.times.npy' , 'alf' , True ),
1068+ # the following are required for the DLC plot only
1069+ # they are not strictly required, some plots just might be skipped
1070+ # In particular the raw videos don't need to be downloaded as they can be streamed
1071+ ('_iblrig_bodyCamera.raw.mp4' , 'raw_video_data' , False ),
1072+ ('_iblrig_leftCamera.raw.mp4' , 'raw_video_data' , False ),
1073+ ('_iblrig_rightCamera.raw.mp4' , 'raw_video_data' , False ),
1074+ ('rightROIMotionEnergy.position.npy' , 'alf' , False ),
1075+ ('leftROIMotionEnergy.position.npy' , 'alf' , False ),
1076+ ('bodyROIMotionEnergy.position.npy' , 'alf' , False ),
1077+ ('_ibl_trials.choice.npy' , 'alf' , False ),
1078+ ('_ibl_trials.feedbackType.npy' , 'alf' , False ),
1079+ ('_ibl_trials.feedback_times.npy' , 'alf' , False ),
1080+ ('_ibl_trials.stimOn_times.npy' , 'alf' , False ),
1081+ ('_ibl_wheel.position.npy' , 'alf' , False ),
1082+ ('_ibl_wheel.timestamps.npy' , 'alf' , False ),
1083+ ],
10711084 # More files are required for all panels of the DLC QC plot to function
10721085 'output_files' : [('_ibl_leftCamera.features.pqt' , 'alf' , True ),
10731086 ('_ibl_rightCamera.features.pqt' , 'alf' , True ),
1074- ('licks.times.npy' , 'alf' , True )]
1087+ ('licks.times.npy' , 'alf' , True ),
1088+ ('dlc_qc_plot.png' , 'snapshot' , False )]
10751089 }
10761090
10771091 def _run (self , overwrite = False , run_qc = True , plot_qc = True ):
@@ -1080,7 +1094,7 @@ def _run(self, overwrite=False, run_qc=True, plot_qc=True):
10801094 (dlc_qc_plot.png) is not returned, but saved in session_path/snapshots and uploaded to Alyx as a note.
10811095
10821096 :param overwrite: bool, whether to recompute existing output files (default is False).
1083- Note that the dlc_qc_plot will be computed even if overwrite = False
1097+ Note that the dlc_qc_plot will be (re-) computed even if overwrite = False
10841098 :param run_qc: bool, whether to run the DLC QC (default is True)
10851099 :param plot_qc: book, whether to create the dlc_qc_plot (default is True)
10861100
@@ -1092,7 +1106,7 @@ def _run(self, overwrite=False, run_qc=True, plot_qc=True):
10921106 else :
10931107 if exist and overwrite :
10941108 _logger .warning ('EphysPostDLC outputs exist and overwrite=True, overwriting existing outputs.' )
1095- # Find all available dlc traces and dlc times
1109+ # Find all available dlc files
10961110 dlc_files = list (Path (self .session_path ).joinpath ('alf' ).glob ('_ibl_*Camera.dlc.*' ))
10971111 for dlc_file in dlc_files :
10981112 _logger .debug (dlc_file )
@@ -1177,7 +1191,7 @@ def _run(self, overwrite=False, run_qc=True, plot_qc=True):
11771191 fig_path = self .session_path .joinpath ('snapshot' , 'dlc_qc_plot.png' )
11781192 if not fig_path .parent .exists ():
11791193 fig_path .parent .mkdir (parents = True , exist_ok = True )
1180- fig = dlc_qc_plot (self .one . path2eid ( self . session_path ) , one = self .one )
1194+ fig = dlc_qc_plot (self .session_path , one = self .one )
11811195 fig .savefig (fig_path )
11821196 fig .clf ()
11831197 snp = ReportSnapshot (self .session_path , session_id , one = self .one )
0 commit comments