CrocoDash.extract_forcings package#
Subpackages#
Submodules#
CrocoDash.extract_forcings.driver module#
- CrocoDash.extract_forcings.driver.main(get_dataset_piecewise=True, regrid_dataset_piecewise=True, merge_piecewise_dataset=True)#
Driver file to run the large data workflow
- CrocoDash.extract_forcings.driver.test_driver()#
Test that all the imports work
CrocoDash.extract_forcings.utils module#
- CrocoDash.extract_forcings.utils.check_date_continuity(boundary_file_list: dict)#
Check for overlaps or missing dates between consecutive files.
- CrocoDash.extract_forcings.utils.load_config(config_path: str = 'config.json') dict#
Load a JSON config file.
- Parameters:
config_path (str, optional) – Path to the JSON config file. Default is “config.json”.
- Returns:
The loaded configuration as a dictionary.
- Return type:
dict
- CrocoDash.extract_forcings.utils.parse_dataset_folder(folder: str | Path, input_dataset_regex: str, date_format: str)#
Parse a folder to find and extract dataset file information based on a regex pattern.
- Parameters:
folder (str or Path) – Path to the folder containing the dataset files.
input_dataset_regex (str) – Regular expression pattern to match dataset filenames. Example: “(north|east|south|west)_unprocessed.(d{8})_(d{8}).nc”
date_format (str) – Date format string used to parse dates in filenames (e.g., “%Y%m%d”).
- Returns:
Dictionary mapping boundaries to a list of tuples with: - Start date (datetime) - End date (datetime) - Full file path (Path)
Example: {
”north”: [(datetime(2000, 1, 1), datetime(2000, 1, 2), Path(“/path/to/north_20000101_20000102.nc”))], “east”: [(datetime(2000, 1, 3), datetime(2000, 1, 4), Path(“/path/to/east_20000103_20000104.nc”))]
}
- Return type:
dict
- CrocoDash.extract_forcings.utils.write_config(config: dict, config_path: str = 'config.json') None#
Write or update a JSON config file.
- Parameters:
config (dict) – Configuration dictionary to save.
config_path (str, optional) – Path to the JSON config file. Default is “config.json”.
- Return type:
None