Skip to content

Commit

Permalink
Make sure the right smoothed MRMS data is loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Pfreundschuh committed Sep 4, 2024
1 parent 5383695 commit a09c73c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions chimp/data/mrms.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,30 @@ def process_file(
save_file(data, output_folder, filename)


def find_training_files(
self,
path: Path,
times: Optional[np.ndarray] = None
) -> Tuple[np.ndarray, List[Path]]:
"""
Find MRMS training data files.
Args:
path: Path to the folder containing the training data.
times: Not used.
Return:
A tuple ``(times, paths)`` containing the times for which training
files are available and the paths pointing to the corresponding file.
"""
pattern = "*????????_??_??.nc"
reference_files = sorted(
list((path / "mrms_smoothed").glob(pattern))
)
times = np.array(list(map(get_date, reference_files)))
return times, reference_files


MRMS_PRECIP_RATE_SMOOTHED = MRMSSmoothedData(
"mrms_smoothed",
4,
Expand Down

0 comments on commit a09c73c

Please sign in to comment.