Skip to content

annaewald/city-climate-risk-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

City Climate Risk Explorer

Python License: MIT Jupyter

This project estimates and visualizes city-level climate risk based on open NASA POWER climate datasets. It demonstrates geospatial data analysis, API integration, data visualization, and modular Python project design.

Installation

Clone the repository and install the required dependencies:

git clone https://github.com/annaewaldrd/city-climate-risk-explorer.git  
cd city-climate-risk-explorer  
pip install -r requirements.txt  

Quick Start

You can either explore the data interactively in Jupyter Notebook or run the full pipeline from the command line.

Option 1: Interactive Notebook

jupyter notebook notebooks/city_climate_risk_explorer.ipynb  

Option 2: Run Full Analysis

python quick_run.py  

This will:

  • Fetch NASA POWER climate data for all cities in data/cities.csv
  • Compute climate risk scores
  • Save results including:
    • Time series plots → outputs/timeseries/
    • Interactive HTML map → outputs/climate_risk_map.html
    • Cached raw NASA POWER data → outputs/fetched_data.pkl
    • Summary table → outputs/results.csv

Methods

1. Data Collection

City coordinates from data/cities.csv are used to request daily climate parameters—temperature, precipitation, and solar radiation—from the NASA POWER API.

2. Data Processing

Raw climate data is cleaned and aggregated to compute mean, maximum, and total values per city.

3. Climate Risk Score

A composite Climate Risk Score is calculated using normalized temperature, precipitation, and solar radiation metrics.

4. Visualization

  • Time series plots created with Matplotlib
  • Interactive, color-coded map generated with Folium

Data

Example input file data/cities.csv (small subset for clarity):

city,lat,lon
Berlin,52.52,13.405
Munich,48.137,11.575
Hamburg,53.551,9.993
London,51.5074,-0.1278
Copenhagen,55.6761,12.5683

Note: Your actual CSV can contain more cities; this is just a small example.

Project structure

city-climate-risk-explorer/
│
├── LICENSE
├── data/
│   └── cities.csv
├── notebooks/
│   └── city_climate_risk_explorer.ipynb
├── outputs/
│   ├── timeseries/
│   ├── climate_risk_map.html
│   └── results.csv
├── src/
│   ├── fetch_data.py
│   ├── calculate_risk.py
│   ├── visualize.py
│   └── utils.py
├── quick_run.py
├── requirements.txt
├── .gitignore
└── README.md

All output files (plots, maps, and CSV summaries) are generated automatically in the outputs/ folder.

Visual Preview

  • Example plot: outputs/timeseries/Berlin_timeseries.png Berlin Plot
  • Example plot: outputs/timeseries/London_timeseries.png London Plot
  • Map: outputs/climate_risk_map.html - Open interactive map (local)

About

Explore city-level climate risk using NASA POWER data, with interactive maps and time series plots.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published