diff --git a/README.MD b/README.MD index c234d8e..85db07c 100644 --- a/README.MD +++ b/README.MD @@ -9,7 +9,6 @@ The project consists of a main pipeline workflow that processes multiple modules - `main.py`: Main pipeline orchestrator that calls on the modules as needed - `batch_nimrod.py`: Module for batch processing multiple NIMROD files with configurable bounding boxes - `generate_timeseries.py`: Module for extracting cropped rain data and creating rainfall timeseries -- `combine_timeseries.py`: Module for combining grouped timeseries CSVs into consolidated datasets ## Features @@ -31,10 +30,6 @@ The project consists of a main pipeline workflow that processes multiple modules - Extract cropped rain data based on specified locations - Create rainfall timeseries CSVs for each location - Parse datetime from filename and create proper datetime index - -### combine_timeseries.py - -- Combine multiple timeseries CSV files into grouped datasets - Group locations by specified output groups - Create consolidated CSV files for each group diff --git a/main.py b/main.py index d244034..b038ccc 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,16 @@ logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" ) +def process_pipeline(dat_file): + # 1. Process DAT to ASC + asc_file = batch._process_single_file(dat_file) + if not asc_file: + return None + + # 2. Extract data from ASC + file_results = timeseries.process_asc_file(asc_file, locations) + return file_results + if __name__ == "__main__": os.makedirs(Path(Config.ASC_TOP_FOLDER), exist_ok=True) os.makedirs(Path(Config.COMBINED_FOLDER), exist_ok=True) @@ -45,16 +55,6 @@ if __name__ == "__main__": # Initialize results structure results = {loc[0]: {"dates": [], "values": []} for loc in locations} - def process_pipeline(dat_file): - # 1. Process DAT to ASC - asc_file = batch._process_single_file(dat_file) - if not asc_file: - return None - - # 2. Extract data from ASC - file_results = timeseries.process_asc_file(asc_file, locations) - return file_results - # Get list of DAT files dat_files = [ f for f in os.listdir(Path(Config.DAT_TOP_FOLDER)) if not f.startswith(".") diff --git a/pyproject.toml b/pyproject.toml index c3ecfef..1f10b49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "met-office" -version = "1.1.0" +version = "1.1.1" description = "Convert .dat nimrod files to .asc files" readme = "README.md" requires-python = ">=3.14" diff --git a/uv.lock b/uv.lock index a0b486f..127efef 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.14" [[package]] name = "met-office" -version = "1.1.0" +version = "1.1.1" source = { virtual = "." } dependencies = [ { name = "numpy" },