Complete Köppen-Geiger filter review with Mixed climate class
Classify each county by area-weighted Köppen class shares: a county is predominantly its top class when that class covers at least 50% of its land and leads the runner-up by at least 5 percentage points; otherwise it is Mixed (133 of 3,143 counties in the 50 states and DC). - Add build_county_koppen_metric.py (writes data/metrics/koppen.csv) and apply_koppen_metric_to_climate_data.py (writes koppenZone plus koppenPrimaryClass/koppenSecondaryClass for Mixed counties). - Move shared helpers into scripts/common/ (county loading, Köppen legend, area-weighted raster shares); fix the 180th-meridian raster window for Aleutians West. - Add check_climate_data.py to validate the app CSV. - Draw Mixed counties in app.js as diagonal stripes of their top two classes, fixed to the ground and following the map at every zoom, with a crossfade only when the stripe size changes. Filtering a class also matches Mixed counties where it is primary or secondary. - Document the rule, display, and pipeline plan in docs/ and update the README and data-source notes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,10 +18,10 @@ from build_county_climate_data import (
|
||||
MONTH_NAMES,
|
||||
_as_monthly_climatology,
|
||||
_extract_grid_2d,
|
||||
_load_counties,
|
||||
_select_data_var,
|
||||
_zonal_mean,
|
||||
)
|
||||
from common.counties import load_counties
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
DEFAULT_CLIMATE_DATA = REPO_ROOT / "data" / "climate-data.csv"
|
||||
@@ -61,7 +61,7 @@ def build_precip_month_lookup(
|
||||
climatology_end_year: int,
|
||||
) -> dict[str, tuple[str, str]]:
|
||||
"""Calculate wettest and driest precipitation month for each county."""
|
||||
counties = _load_counties(counties_geojson)
|
||||
counties = load_counties(counties_geojson)
|
||||
monthly_prcp = xr.open_dataset(monthly_prcp_nc, decode_times=True)
|
||||
try:
|
||||
prcp_var = _select_data_var(monthly_prcp, "mlyprcp_norm")
|
||||
|
||||
Reference in New Issue
Block a user