Skip to content

Commit

Permalink
Merge pull request #542 from nu-radio/fix-noiseImporter
Browse files Browse the repository at this point in the history
Skip empty strings as noise folders. Might occure if noise folder not…
  • Loading branch information
fschlueter authored Jun 13, 2023
2 parents 972a458 + 99ec961 commit a82d6f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NuRadioReco/modules/measured_noise/RNO_G/noiseImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit a82d6f4

Please sign in to comment.