$ show nmcdev/meteva
MetEva is a Python library for meteorological forecast verification, developed by the China Meteorological Administration (NMC/CMA). It provides a comprehensive suite of tools for reading, processing, and verifying weather forecasts against observations. The library supports both station (point) and gridded data, with I/O for multiple formats including MICAPS, GRIB, NetCDF, GDS, and CMADaaS. Verification methods cover continuous (ME, MAE, RMSE, correlation), categorical (TS, ETS, POD, FAR), probability (Brier, ROC), ensemble (CRPS, spread-skill), and spatial (FSS, MODE, CRA, SAL, fuzzy logic) scores. It also includes operational product generation for time-series plots, spatial maps, and regulatory scoring. The codebase is large and feature-rich, but exhibits code duplication, hardcoded paths, and mixed Chinese/English comments, indicating an evolving codebase with some technical debt.
The LLM identified 3 files worth highlighting for reuse:
Core interpolation module for converting between gridded forecast data and station observations. Implements multiple methods (nearest neighbor, linear, cubic, IDW, Cressman) with support for global longitude wrapping, multi-dimensional coordinates (member, level, time, dtime), and efficient vectorized operations. This module encapsulates a common and non-trivial data engineering pattern in meteorology and could be extracted as a standalone interpolation library with minimal adaptation.
Utility module for defining colormaps and contour levels tailored to meteorological variables (temperature, precipitation, wind, humidity, etc.). Provides a unified function `def_cmap_clevs` to create custom colormaps from lists of colors and levels, and element-specific presets. The module handles missing values, colorbar extensions, and supports both continuous and discrete color schemes. It is self-contained and reusable in any meteorological plotting context.
Implementation of the Fractions Skill Score (FSS) for spatial forecast verification. FSS compares forecast and observed binary fields at multiple neighborhood scales, providing a scale-dependent skill measure. The module includes convolution-based smoothing, thresholding, and score computation. It is a well-known spatial verification technique, and the implementation is self-contained (using numpy/scipy) and could be reused in other verification frameworks.