Skip to content

Commit

Permalink
updated list of raw files function
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Jun 9, 2024
1 parent e3e43ab commit a98c554
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions oceanstream/process/folder_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ def signal_handler(sig, frame):
sys.exit(0)


def find_raw_files(base_dir):
raw_files = []
for root, dirs, files in os.walk(base_dir):
for file in files:
if file.endswith('.raw'):
raw_files.append(os.path.join(root, file))
return raw_files


def convert_raw_files(config_data, workers_count=os.cpu_count()):
global pool

Expand All @@ -132,8 +141,7 @@ def convert_raw_files(config_data, workers_count=os.cpu_count()):
configure_logging(log_level)

print(f"Starting to convert folder: {dir_path} to Zarr using {workers_count} parallel processes...")
raw_files = [os.path.join(dir_path, f) for f in os.listdir(dir_path) if
os.path.isfile(os.path.join(dir_path, f)) and f.endswith('.raw')]
raw_files = find_raw_files(dir_path)
file_info = []

if not raw_files:
Expand Down

0 comments on commit a98c554

Please sign in to comment.