This script processes historical climate data and compares it with ERA5 weather reanalysis data. It includes functionalities to:
- Read and process PSV data files, extracting and filtering observations based on temperature and pressure ranges.
- Load data in parallel for efficiency and assign location IDs based on first appearances.
- Extract and correlate ERA5 data with historical records, matching them by coordinates and time range.
- Plot KDEs for comparisons, computing metrics (MSE, RMSE and KL Divergence) to assess fit.
- Comparison plots and metrics are saved to the output directory.
- Comparison metrics are exported as CSV files.
Ensure directories for historical data, grib files and output are correctly specified before running the script. Set the minimum number of observation days needed.