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.
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 You can either explore the data interactively in Jupyter Notebook or run the full pipeline from the command line.
jupyter notebook notebooks/city_climate_risk_explorer.ipynb 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
- Time series plots →
City coordinates from data/cities.csv are used to request daily climate parameters—temperature, precipitation, and solar radiation—from the NASA POWER API.
Raw climate data is cleaned and aggregated to compute mean, maximum, and total values per city.
A composite Climate Risk Score is calculated using normalized temperature, precipitation, and solar radiation metrics.
- Time series plots created with Matplotlib
- Interactive, color-coded map generated with Folium
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.
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.
- Example plot:
outputs/timeseries/Berlin_timeseries.png
- Example plot:
outputs/timeseries/London_timeseries.png
- Map:
outputs/climate_risk_map.html- Open interactive map (local)