From 99ec961414d9323946550c943d81952d359a7f3c Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 25 May 2023 19:04:20 +0200 Subject: [PATCH] Skip empty strings as noise folders. Might occure if noise folder not specified and causes the program to search uncontrolled for root files --- NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py b/NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py index d3f18689f..c0c781c8b 100644 --- a/NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py +++ b/NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py @@ -73,10 +73,13 @@ def begin(self, noise_folders, file_pattern="*", if not isinstance(noise_folders, list): noise_folders = [noise_folders] - + # find all subfolders noise_files = [] for noise_folder in noise_folders: + if noise_folder == "": + continue + noise_files += glob.glob(f"{noise_folder}/**/{file_pattern}root", recursive=True) self.__noise_folders = np.unique([os.path.dirname(e) for e in noise_files])