Skip to content

Commit 8c2cba1

Browse files
authored
Merge pull request #10 from rcjackson/append_csv
ADD: Support a list of strings for the date.
2 parents 2de517b + 884bf77 commit 8c2cba1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lars/preprocessing/radar_preprocessing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def preprocess_radar_data(file_path, output_path, date=None,
1919
file_path (str): Path to the radar data files.
2020
2121
output_path (str): Path to save the processed .png images.
22-
date (str): Optional date string to filter radar files, in the format 'YYYYMMDD'.
22+
date (str or list): Optional date string to filter radar files, in the format 'YYYYMMDD'.
2323
radar_field (str): The radar field to be processed,
2424
default is 'corrected_reflectivity'.
2525
x_bounds (tuple): The x-axis bounds for plotting in meters.
@@ -37,7 +37,10 @@ def preprocess_radar_data(file_path, output_path, date=None,
3737

3838
file_list = glob.glob(file_path + '/*.nc')
3939
if date is not None:
40-
file_list = [f for f in file_list if date in f]
40+
if isinstance(date, str):
41+
date = [date]
42+
for date_str in date:
43+
file_list = [f for f in file_list if date_str in f]
4144
out_df = pd.DataFrame(columns=['file_path', 'time', 'label', 'ref_min', 'ref_max'])
4245
if not "vmin" in kwargs:
4346
kwargs['vmin'] = -20

0 commit comments

Comments
 (0)