California Wine Industry Environmental Impact Analyzer

California Wine Industry Environmental Impact Analyzer

It analyzes and visualizes how environmental factors, especially wildfires, drought, and weather, affect California's wine industry across major regions.

🍷 As a person who enjoys a glass of wine and the fascinating journey from grape to glass, I wanted to share the story of how the environment shapes every bottle.

Wildfires, drought, heat, and even smoky skies all play a part in the yield, grape quality, and the flavors we love. This project is my way of exploring and showing how nature’s twists and turns impact California’s wine regions.

So pour a glass, explore the data, and see how each wine region tells a story written by the land, the weather, and a little bit of luck!

Key features: CA Wine Impact Analyzer App

  • Interactive Dashboard: Written in Python, this app shows wine production, quality, revenue, and environmental impact metrics by year and region.
  • Wildfire Analysis: Visualizes major wildfires, their impact on wine regions, and smoke exposure.
  • Weather Patterns: Explores temperature, rainfall, drought, and their correlations with wine outcomes.
  • Regional Comparison: Compares production, quality, and environmental stress across regions and years.
  • Prediction Models: Uses machine learning to predict wine quality and yield based on environmental scenarios.
  • Climate Projections: Simulates future impacts under different climate change scenarios and suggests adaptation strategies.

This is sample data for demonstration At some point, I will get around to pulling in real data.

def load_wine_regions():
    """Load California wine regions GeoJSON data"""
    # For a real app, you would use actual GeoJSON data of wine regions
    # This is a simplified example with fictional data
    regions = {
        "Napa Valley": {"lat": 38.5025, "lon": -122.2654, "acres": 45000, "primary_grapes": ["Cabernet Sauvignon", "Chardonnay"]},
        "Sonoma County": {"lat": 38.5111, "lon": -122.7884, "acres": 60000, "primary_grapes": ["Pinot Noir", "Chardonnay"]},
        "Paso Robles": {"lat": 35.6369, "lon": -120.6545, "acres": 40000, "primary_grapes": ["Cabernet Sauvignon", "Zinfandel"]},
        "Santa Barbara": {"lat": 34.4208, "lon": -119.6982, "acres": 21000, "primary_grapes": ["Pinot Noir", "Chardonnay", "Syrah"]},
        "Mendocino County": {"lat": 39.0307, "lon": -123.0877, "acres": 18000, "primary_grapes": ["Chardonnay", "Pinot Noir"]},
        "Lodi": {"lat": 38.1301, "lon": -121.2744, "acres": 110000, "primary_grapes": ["Zinfandel", "Cabernet Sauvignon"]}
    }
    return regions

def load_wildfire_data():
    """Load historical California wildfire data"""
    # In a real app, you would fetch this from a CAL FIRE API or dataset
    # This is sample data for demonstration
    wildfires = pd.DataFrame({
        "name": ["Glass Fire", "LNU Lightning Complex", "August Complex", "Creek Fire", "SCU Lightning Complex", 
                "CZU Lightning Complex", "North Complex", "Kincade Fire", "Walker Fire", "Bobcat Fire"],
        "year": [2020, 2020, 2020, 2020, 2020, 2020, 2020, 2019, 2019, 2020],
        "acres_burned": [67484, 363220, 1032648, 379895, 396624, 86509, 318935, 77758, 54612, 115998],
        "lat": [38.5035, 38.6501, 39.8170, 37.1908, 37.4230, 37.1714, 39.8168, 38.7883, 39.9761, 34.2380],
        "lon": [-122.4753, -122.1179, -122.8210, -119.2659, -121.4408, -122.2229, -121.1204, -122.7884, -120.6679, -118.0870],
        "start_date": ["2020-09-27", "2020-08-17", "2020-08-16", "2020-09-04", "2020-08-18", "2020-08-16", "2020-08-17", "2019-10-23", "2019-09-04", "2020-09-06"],
        "containment_date": ["2020-10-20", "2020-10-02", "2020-11-12", "2020-12-24", "2020-10-01", "2020-09-22", "2020-12-03", "2019-11-06", "2019-09-26", "2020-12-18"],
        "affected_wine_regions": [["Napa Valley", "Sonoma County"], ["Napa Valley", "Sonoma County"], ["Mendocino County"], [], [], [], [], ["Sonoma County"], ["Mendocino County"], []]
    })

The app uses synthetic and sample data, interactive maps (Folium), charts (Plotly), and machine learning (RandomForestRegressor) to provide insights for growers, researchers, and policymakers.

Share this content

California Wine Industry Environmental Impact Analyzer | Marquese T Davis