2
Most read
6
Most read
10
Most read
Model Demonstration of CLIMADA: A probabilistic risk
quantification and adaptation economics platform
Hands-on demonstrations during the NAP Expo 2019
Incheon, South Korea
Evelyn Mühlhofer, Weather and Climate Risks Group, Federal Institute of Technology
Zurich, Switzerland (evelyn.muehlhofer@usys.ethz.ch)
April 10, 2019
The inputs are mainly based on the tutorials available on GitHub (https://github.com/
CLIMADA-project/climada_python/tree/master/script/tutorial), elaborated by Gabriela Az-
nar Siguan (gabriela.aznar@usys.ethz.ch)
Overview
The functionality of CLIMADA is gathered in the following classes:
• Entity: socio-economic models
– Exposures: exposed values
* BlackMarble: regional economic model from nightlight intensities and economic
indicators
* LitPop: data model of economic exposure from nightlight intensities and popula-
tion count
– ImpactFuncSet: collection of impact functions per hazard
* ImpactFunc: one adjustable impact function
* IFTropCyclone: definition of impact functions for tropical cyclones
– DiscRates: discount rates per year
– MeasureSet: collection of measures for adaptation
• Hazard: meteorological models
– TropCyclone: tropicalcyclone events
1
Step 1: Generating a Hazard Set
The most operational hazard module is currently the one for Tropical Cyclones (TC), which is why
we will focus on this for demonstrative purposes.
As always, there are different ways of generating or reading in a hazard set from already
existing sources (e.g. MATLAB or Excel). In this demonstration, we will generate a hazard set from
scratch using historical data from IBTrACS, and processing them with the TropCyclone module.
In [135]: # Import required packages:
from climada.hazard import Hazard
from climada.hazard import TCTracks
from climada.hazard import Centroids, TropCyclone
%matplotlib inline
In [136]: # First, we generate a "container" for our hazard, the Hazard class.
hazard_tc = Hazard('TC')
Next, we download TC track data from IBTrACS For this, it is easies to manually download
the data from IBTrACS:
• Go to ftp://eclipse.ncdc.noaa.gov/pub/ibtracs//v04r00/provisional/netcdf/
• Download the data from the folder IBTrACS.ALL.v04r00.nc
• Save the downloaded file to climada_python/data/system.
In [137]: # Store tc tracks in a sub-class of the hazard class: TCTracks.
selected_ibtracs = TCTracks()
# Of the downloaded data, select Northern Indian basin between 1980 and 2018
selected_ibtracs.read_ibtracs_netcdf(year_range=(1980, 2018), basin='NI')
# Generate interpolated track values to 1h time steps
selected_ibtracs.equal_timestep(time_step_h=1, land_params=False)
#set equal time steps here to shorter!! min 1h
print('Number of tracks:', selected_ibtracs.size)
fig, ax = selected_ibtracs.plot()
2019-04-05 11:50:33,709 - climada.hazard.tc_tracks - INFO - Interpolating 92 tracks to 1h time s
Number of tracks: 92
2
In [142]: # We could generate more tracks, e.g. 5 probabilistic events for each historic one
selcted_ibtracs_prob = TCTracks()
selcted_ibtracs_prob.read_ibtracs_netcdf(year_range=(1980, 2018), basin='NI')
selcted_ibtracs_prob.equal_timestep(time_step_h=1, land_params=False)
selcted_ibtracs_prob.calc_random_walk(ens_size=5) # generate 5 prob. per 1 historic tr
fig, ax = selcted_ibtracs_prob.plot()
2019-04-05 11:57:51,963 - climada.hazard.tc_tracks - INFO - Interpolating 92 tracks to 1h time s
2019-04-05 11:57:56,482 - climada.hazard.tc_tracks - INFO - Computing 460 synthetic tracks.
2019-04-05 11:58:02,342 - climada.hazard.tc_tracks - DEBUG - No historical track of category Hur
3
From the tracks we now want to calculate actual windfields and map them to positions on the
ground ("centroids"). This is done as follows (for now, only with the historic tracks)
In [144]: # Construct centroids (we will narrow it down to the area of Bangladesh)
min_lat, max_lat, min_lon, max_lon = 20.766380, 26.536520, 92.666935, 88.121288
resol = 120
cent = Centroids()
cent.coord = (np.mgrid[min_lat : max_lat : complex(0, resol), min_lon : max_lon : comp
reshape(2, resol*resol).transpose()
cent.id = np.arange(cent.lat.size)
cent.check()
cent.plot()
2019-04-05 12:00:50,345 - climada.util.checker - DEBUG - Centroids.region_id not set.
Out[144]: (<Figure size 648x936 with 1 Axes>,
<cartopy.mpl.geoaxes.GeoAxesSubplot at 0x1a34692a58>)
4
In [145]: # construct tropical cyclones from historic tracks, with adequate windfields
tc_Bangladesh = TropCyclone()
tc_Bangladesh.set_from_tracks(selected_ibtracs, centroids=cent)
tc_Bangladesh.check()
# Version with probabilistic paths:
5
# tc_Bangladesh_prob = TropCyclone()
# tc_Bangladesh_prob.set_from_tracks(selected_ibtracs_prob, centroids=cent)
# tc_Bangladesh_prob.check()
2019-04-05 12:02:30,068 - climada.hazard.trop_cyclone - INFO - Mapping 552 tracks to 14400 centr
2019-04-05 12:03:05,949 - climada.hazard.trop_cyclone - DEBUG - Append events.
2019-04-05 12:03:06,977 - climada.hazard.trop_cyclone - DEBUG - Compute frequency.
2019-04-05 12:03:07,494 - climada.util.checker - DEBUG - Centroids.region_id not set.
In [146]: # plot most intense event
tc_Bangladesh.plot_intensity(-1)
# plot highest hazard intensity at each point
tc_Bangladesh.plot_intensity(0)
# plot highest hazard intensity for different return periods (10, 50, 75, 100 years)
_, _, res = tc_Bangladesh.plot_rp_intensity([10, 50, 75, 100])
2019-04-05 12:03:47,975 - climada.hazard.base - INFO - Computing exceedance intenstiy map for re
6
7
8
In [147]: # Now that we generated the hazard from the initial data,
# we just need to fill it into our intially created hazard container:
hazard_tc.append(tc_Bangladesh)
hazard_tc.check()
2019-04-05 12:04:29,595 - climada.util.checker - DEBUG - Centroids.region_id not set.
Step 2: Generating Exposure
Exposure can describe the geographical distribution of people, livelihoods and assets or infras-
tructure; all items potentially exposed to hazards. As shown in the overview, an "entity" class
exists, into which the exposed values ("exposure") are loaded as a sub-class.
Two models currently exist for generating such exposures (BlackMarble and LitPop) by de-
fault. Both contain estimates of the distribution of monetary asset values and population on a
global scale at 1x1km resolution.
9
There are other ways of generating exposures, e.g. from a GeoDataFrame of Python’s library
geopandas or from loading respective information from an excel-file.
In [81]: # Import required packages:
import numpy as np
import pandas as pd
from matplotlib import colors
from iso3166 import countries as iso_cntry
%matplotlib inline
from climada.entity import Entity
from climada.entity import Exposures
from climada.entity import BlackMarble
from climada.entity.exposures.litpop import LitPop
In [109]: # Initiate an entity class as "container" for exposures:
entity_trial = Entity()
# Generated a Black Marble exposure
exposure_trial = BlackMarble()
# Fill the generated exposure with actual values for a country (Bangladesh)
exposure_trial.set_countries(['Bangladesh'], 2013, res_km=1.0)
exposure_trial.set_geometry_points()
# Add the exposure as a sub-class to entity
entity_trial.exposures = Exposures(exposure_trial)
entity_trial.exposures['if_TC'] = entity_trial.exposures['if_']
entity_trial.exposures.assign_centroids(hazard_tc)
entity_trial.exposures.check()
In [110]: # plot exposure with major towns (pop_name=True):
entity_trial.exposures.plot_hexbin(pop_name=True)
# plot exposure with log-normal colormap for better contrasts:
norm=colors.LogNorm(vmin=500, vmax=4.0e9)
entity_trial.exposures.plot_hexbin(norm=norm)
Out[110]: (<Figure size 648x936 with 2 Axes>,
array([[<cartopy.mpl.geoaxes.GeoAxesSubplot object at 0x1a419f7eb8>]],
dtype=object))
10
11
Step 3: Defining Vulnerability (Impact Functions)
Impact Functions relate hazard intensity to the ensuing damage of the exposed assets or people.
Again, default functions exist, functions can be read in from excel or be manually created
(which is demonstrated here).
First, an Impact Function Set needs to be created (a "container" for the Impact Functions). This
set is then filled with an impact function, which we in turn create manually. Lastly, the impact
function set needs to be added to the "overall container", the entity.
In [111]: # loading necessary package:
from climada.entity import ImpactFuncSet
12
from climada.entity import ImpactFunc
import numpy as np
import matplotlib.pyplot as plt
In [112]: # Create Set:
imp_fun_set = ImpactFuncSet()
In [113]: # Create Impact Function from scratch
imp_fun = ImpactFunc()
imp_fun.haz_type = 'TC'
imp_fun.id = 1
imp_fun.name = 'TC random function'
imp_fun.intensity_unit = 'm/s'
imp_fun.intensity = np.linspace(0, 100, num=20)
imp_fun.mdd = np.sort(np.random.rand(20))
imp_fun.paa = np.sort(np.random.rand(20))
imp_fun.check()
In [114]: # Add Impact function to Set
imp_fun_set.add_func(imp_fun)
In [115]: # Add set to entity and plot
entity_trial.impact_funcs = imp_fun_set
entity_trial.impact_funcs.plot('TC')
Out[115]: (<Figure size 288x288 with 1 Axes>,
[<matplotlib.axes._subplots.AxesSubplot at 0x1a1c24ccc0>])
13
Risk Quantification, Damage Calculations ("Risk Today")
In [148]: # load necessary package
from climada.engine import Impact
In [149]: # Calculate impact (damage) by combining exposure, hazard and impact function
impact_trial = Impact()
impact_trial.calc(entity_trial.exposures, entity_trial.impact_funcs, hazard_tc)
2019-04-05 12:04:48,480 - climada.engine.impact - INFO - Exposures matching centroids found in c
2019-04-05 12:04:48,550 - climada.engine.impact - INFO - Calculating damage for 49270 assets (>0
In [150]: # Calculate impact exceedence frequency curve
freq_curve_fl = impact_trial.calc_freq_curve()
freq_curve_fl.plot();
print('Expected average annual impact: {:.3e} USD'.format(impact_trial.aai_agg))
# Plot average annual impact (damage) at each exposure
impact_trial.plot_eai_exposure(buffer_deg=1.0);
Expected average annual impact: 6.887e+08 USD
14
Towards Total Future Risk: Additional Risk from Socio-Economic Development & Cli-
mate Change
Steps 1-3 would now be repeated, but the exposure and hazard set would be modified, to capture
future scenarios:
• Population and Economic Growth --> Multiply asset and population values in exposure with
adequate factor
• Climate Change --> Increase frequency or intensity of event in hazard set
Step 4: Adaptation Measures Parametrization
Again, steps 1-3 are repeated. This time, hazard set and impact function would be modified, to
capture adaptation efforts:
15
• Impact at same intensity is lowered
• Frequency or intensity of hazard are lowered
Let’s create a new impact function, derived from the one above but representing the effects of an
adaptation measure on the impact e.g. building code (BC) set to resist winds up to 60 m/s:
In [151]: # effect of mdd_impact, paa_impact, hazard_inten_imp
%matplotlib inline
import numpy as np
from climada.entity import Measure
In [161]: # impact function which is 0 up to 62.5 m/s
imp_fun_BC = ImpactFunc()
imp_fun_BC.haz_type = 'TC'
imp_fun_BC.id = 2
imp_fun_BC.name = 'TC function with Building Code'
imp_fun_BC.intensity_unit = 'm/s'
imp_fun_BC.intensity = np.linspace(0, 100, num=20)
imp_fun_BC.mdd = np.append(np.zeros(13),np.sort(np.random.rand(7)))
imp_fun_BC.paa = np.append(np.zeros(13),np.sort(np.random.rand(7)))
imp_fun_BC.check()
In [158]: # Add Impact function to Set
imp_fun_set.add_func(imp_fun_BC)
In [159]: # Add set to entity and plot the old & new one
entity_trial.impact_funcs = imp_fun_set
entity_trial.impact_funcs.plot('TC')
Out[159]: (<Figure size 576x288 with 2 Axes>,
[<matplotlib.axes._subplots.AxesSubplot at 0x1a3a482518>,
<matplotlib.axes._subplots.AxesSubplot at 0x1a31c75128>])
16
Result: Adaptation Options Appraisal
The total risks with and without adaptation measures can now be compared (incl. under different
socio-economic and climate change scenarios). The difference is total future risk is hence the "re-
duced damage" or "benefit". Given that implementation costs are known for each of the measures,
cost-benefit measures may now be calculated.
17

More Related Content

PDF
DeepLocker - Concealing Targeted Attacks with AI Locksmithing
PDF
Hybrid quantum classical neural networks with pytorch and qiskit
PDF
Power ai tensorflowworkloadtutorial-20171117
PDF
AIML4 CNN lab256 1hr (111-1).pdf
PDF
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
PDF
maXbox starter65 machinelearning3
PDF
Machine Learning - Introduction
PDF
alexnet.pdf
DeepLocker - Concealing Targeted Attacks with AI Locksmithing
Hybrid quantum classical neural networks with pytorch and qiskit
Power ai tensorflowworkloadtutorial-20171117
AIML4 CNN lab256 1hr (111-1).pdf
Pydata DC 2018 (Skorch - A Union of Scikit-learn and PyTorch)
maXbox starter65 machinelearning3
Machine Learning - Introduction
alexnet.pdf

Similar to 6.3.2 CLIMADA model demo (20)

DOCX
assignment_7_sc report for soft comptuing
PDF
maxbox starter60 machine learning
PDF
Ns2: OTCL - PArt II
PDF
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
PDF
ML with python.pdf
PDF
I have to understand this code and i have to explain the each line of.pdf
PPTX
Composable Energy Modeling for ML-Driven Drone Applications
PDF
Machine learning with py torch
PDF
Linear Regression (Machine Learning)
PDF
Python for Machine Learning from Basics to Advanced.pdf
PDF
PID Tuning using Ziegler Nicholas - MATLAB Approach
PDF
analysis of data structure design programs
PPTX
Anais Dotis-Georgiou & Faith Chikwekwe [InfluxData] | Top 10 Hurdles for Flux...
PDF
GANS Project for Image idetification.pdf
PDF
C sharp chap6
PDF
Didactum SNMP Manual
DOCX
Data Structure in C (Lab Programs)
PDF
maXbox starter75 object detection
PDF
Metric-learn, a Scikit-learn compatible package
PDF
Introduction to cython: example of GCoptimization
assignment_7_sc report for soft comptuing
maxbox starter60 machine learning
Ns2: OTCL - PArt II
Need an detailed analysis of what this code-model is doing- Thanks #St.pdf
ML with python.pdf
I have to understand this code and i have to explain the each line of.pdf
Composable Energy Modeling for ML-Driven Drone Applications
Machine learning with py torch
Linear Regression (Machine Learning)
Python for Machine Learning from Basics to Advanced.pdf
PID Tuning using Ziegler Nicholas - MATLAB Approach
analysis of data structure design programs
Anais Dotis-Georgiou & Faith Chikwekwe [InfluxData] | Top 10 Hurdles for Flux...
GANS Project for Image idetification.pdf
C sharp chap6
Didactum SNMP Manual
Data Structure in C (Lab Programs)
maXbox starter75 object detection
Metric-learn, a Scikit-learn compatible package
Introduction to cython: example of GCoptimization
Ad

More from NAP Events (20)

PDF
The PCL Framework: A strategic approach to comprehensive risk management in r...
PDF
Overview of modalities
PDF
LDC Expert Group mandates and achievements
PDF
LDC Expert Group experiences, good practies and leasons learned
PDF
Future trends relevant to LDCs
PDF
Least Developed Countries undertakings under the convention and the paris agr...
PPTX
6.5 Adaptation forum part 2
PDF
6.4 nap book at expo 10 april weds
PDF
6.3.1 CLIMADA model demo
PDF
6.2 Marine fisheries focus on tuna
PDF
6.1.4 Methodologies for climate rational for adaptation - GCF
PDF
6.1.3 Methodologies for climate rational for adaptation
PDF
7.5.2 Regional TEM-A Part 1
PDF
7.5.1 Regional TEM-A Part 1
PDF
7.4.2 Synergy between UNFCCC and UNCCD
PDF
7.4.1 Synergy between UNFCCC and UNCCD
PDF
7.3.5 A system approach to the integration of the agriculture sector in the NAP
PDF
7.3.4 A system approach to the integration of the agriculture sector in the NAP
PDF
7.3.3 A system approach to the integration of the agriculture sector in the NAP
PDF
7.3.2 A system approach to the integration of the agriculture sector in the NAP
The PCL Framework: A strategic approach to comprehensive risk management in r...
Overview of modalities
LDC Expert Group mandates and achievements
LDC Expert Group experiences, good practies and leasons learned
Future trends relevant to LDCs
Least Developed Countries undertakings under the convention and the paris agr...
6.5 Adaptation forum part 2
6.4 nap book at expo 10 april weds
6.3.1 CLIMADA model demo
6.2 Marine fisheries focus on tuna
6.1.4 Methodologies for climate rational for adaptation - GCF
6.1.3 Methodologies for climate rational for adaptation
7.5.2 Regional TEM-A Part 1
7.5.1 Regional TEM-A Part 1
7.4.2 Synergy between UNFCCC and UNCCD
7.4.1 Synergy between UNFCCC and UNCCD
7.3.5 A system approach to the integration of the agriculture sector in the NAP
7.3.4 A system approach to the integration of the agriculture sector in the NAP
7.3.3 A system approach to the integration of the agriculture sector in the NAP
7.3.2 A system approach to the integration of the agriculture sector in the NAP
Ad

Recently uploaded (20)

PDF
Item # 7 - 2025-26 Budget 2025 Ad Valorem Tax
PDF
AP Vision-2047 and its importance & Role MI&MP.pdf
PDF
The City of Stuart CDBG, Florida - Small Cities CDBG FloridaCommerce -Report ...
PPTX
SlideEgg_66119-Responsible Sourcing.pptx
PPTX
InnoTech Mahamba Presentation yearly.pptx
PPTX
AHEPA Senior Living opens 90 new units in Des Moines
PPTX
Chief minister kissaan kendra for development.pptx
PPTX
Political science uebenjejejjwnnwnwnwnwbwb
PDF
The Council of Europe Landscape Convention: A key instrument for an innovativ...
PDF
Good-Citizenship-2.pdjshegmjaefhaljfhalfjqfwjhefjlw3r
PDF
Item # 1b - August 12, 2025 Special Meeting Minutes
PDF
Buy Naver Account in 2025 — And Why You Ought to Too (1).pdf
PDF
PPT Item # 8 - Pool Pocket Staff Report
PDF
POCSO ACT in India and its implications.
PDF
Covid-19 Immigration Effects - Key Slides - June 2025
PPTX
密歇根州立大学硕士毕业证MSU学历证书密歇根州立大学毕业完成信学历认证
PDF
Oil Industry Ethics Evolution Report (1).pdf
PPTX
RA 1131 Safe Spaces Act Symposium for out of School Youth
PDF
To dialogue with the “fringes”, from the “fringes”
PDF
Josh Bartch_ The Power of a Single Act of Giving.pdf
Item # 7 - 2025-26 Budget 2025 Ad Valorem Tax
AP Vision-2047 and its importance & Role MI&MP.pdf
The City of Stuart CDBG, Florida - Small Cities CDBG FloridaCommerce -Report ...
SlideEgg_66119-Responsible Sourcing.pptx
InnoTech Mahamba Presentation yearly.pptx
AHEPA Senior Living opens 90 new units in Des Moines
Chief minister kissaan kendra for development.pptx
Political science uebenjejejjwnnwnwnwnwbwb
The Council of Europe Landscape Convention: A key instrument for an innovativ...
Good-Citizenship-2.pdjshegmjaefhaljfhalfjqfwjhefjlw3r
Item # 1b - August 12, 2025 Special Meeting Minutes
Buy Naver Account in 2025 — And Why You Ought to Too (1).pdf
PPT Item # 8 - Pool Pocket Staff Report
POCSO ACT in India and its implications.
Covid-19 Immigration Effects - Key Slides - June 2025
密歇根州立大学硕士毕业证MSU学历证书密歇根州立大学毕业完成信学历认证
Oil Industry Ethics Evolution Report (1).pdf
RA 1131 Safe Spaces Act Symposium for out of School Youth
To dialogue with the “fringes”, from the “fringes”
Josh Bartch_ The Power of a Single Act of Giving.pdf

6.3.2 CLIMADA model demo

  • 1. Model Demonstration of CLIMADA: A probabilistic risk quantification and adaptation economics platform Hands-on demonstrations during the NAP Expo 2019 Incheon, South Korea Evelyn Mühlhofer, Weather and Climate Risks Group, Federal Institute of Technology Zurich, Switzerland ([email protected]) April 10, 2019 The inputs are mainly based on the tutorials available on GitHub (https://github.com/ CLIMADA-project/climada_python/tree/master/script/tutorial), elaborated by Gabriela Az- nar Siguan ([email protected]) Overview The functionality of CLIMADA is gathered in the following classes: • Entity: socio-economic models – Exposures: exposed values * BlackMarble: regional economic model from nightlight intensities and economic indicators * LitPop: data model of economic exposure from nightlight intensities and popula- tion count – ImpactFuncSet: collection of impact functions per hazard * ImpactFunc: one adjustable impact function * IFTropCyclone: definition of impact functions for tropical cyclones – DiscRates: discount rates per year – MeasureSet: collection of measures for adaptation • Hazard: meteorological models – TropCyclone: tropicalcyclone events 1
  • 2. Step 1: Generating a Hazard Set The most operational hazard module is currently the one for Tropical Cyclones (TC), which is why we will focus on this for demonstrative purposes. As always, there are different ways of generating or reading in a hazard set from already existing sources (e.g. MATLAB or Excel). In this demonstration, we will generate a hazard set from scratch using historical data from IBTrACS, and processing them with the TropCyclone module. In [135]: # Import required packages: from climada.hazard import Hazard from climada.hazard import TCTracks from climada.hazard import Centroids, TropCyclone %matplotlib inline In [136]: # First, we generate a "container" for our hazard, the Hazard class. hazard_tc = Hazard('TC') Next, we download TC track data from IBTrACS For this, it is easies to manually download the data from IBTrACS: • Go to ftp://eclipse.ncdc.noaa.gov/pub/ibtracs//v04r00/provisional/netcdf/ • Download the data from the folder IBTrACS.ALL.v04r00.nc • Save the downloaded file to climada_python/data/system. In [137]: # Store tc tracks in a sub-class of the hazard class: TCTracks. selected_ibtracs = TCTracks() # Of the downloaded data, select Northern Indian basin between 1980 and 2018 selected_ibtracs.read_ibtracs_netcdf(year_range=(1980, 2018), basin='NI') # Generate interpolated track values to 1h time steps selected_ibtracs.equal_timestep(time_step_h=1, land_params=False) #set equal time steps here to shorter!! min 1h print('Number of tracks:', selected_ibtracs.size) fig, ax = selected_ibtracs.plot() 2019-04-05 11:50:33,709 - climada.hazard.tc_tracks - INFO - Interpolating 92 tracks to 1h time s Number of tracks: 92 2
  • 3. In [142]: # We could generate more tracks, e.g. 5 probabilistic events for each historic one selcted_ibtracs_prob = TCTracks() selcted_ibtracs_prob.read_ibtracs_netcdf(year_range=(1980, 2018), basin='NI') selcted_ibtracs_prob.equal_timestep(time_step_h=1, land_params=False) selcted_ibtracs_prob.calc_random_walk(ens_size=5) # generate 5 prob. per 1 historic tr fig, ax = selcted_ibtracs_prob.plot() 2019-04-05 11:57:51,963 - climada.hazard.tc_tracks - INFO - Interpolating 92 tracks to 1h time s 2019-04-05 11:57:56,482 - climada.hazard.tc_tracks - INFO - Computing 460 synthetic tracks. 2019-04-05 11:58:02,342 - climada.hazard.tc_tracks - DEBUG - No historical track of category Hur 3
  • 4. From the tracks we now want to calculate actual windfields and map them to positions on the ground ("centroids"). This is done as follows (for now, only with the historic tracks) In [144]: # Construct centroids (we will narrow it down to the area of Bangladesh) min_lat, max_lat, min_lon, max_lon = 20.766380, 26.536520, 92.666935, 88.121288 resol = 120 cent = Centroids() cent.coord = (np.mgrid[min_lat : max_lat : complex(0, resol), min_lon : max_lon : comp reshape(2, resol*resol).transpose() cent.id = np.arange(cent.lat.size) cent.check() cent.plot() 2019-04-05 12:00:50,345 - climada.util.checker - DEBUG - Centroids.region_id not set. Out[144]: (<Figure size 648x936 with 1 Axes>, <cartopy.mpl.geoaxes.GeoAxesSubplot at 0x1a34692a58>) 4
  • 5. In [145]: # construct tropical cyclones from historic tracks, with adequate windfields tc_Bangladesh = TropCyclone() tc_Bangladesh.set_from_tracks(selected_ibtracs, centroids=cent) tc_Bangladesh.check() # Version with probabilistic paths: 5
  • 6. # tc_Bangladesh_prob = TropCyclone() # tc_Bangladesh_prob.set_from_tracks(selected_ibtracs_prob, centroids=cent) # tc_Bangladesh_prob.check() 2019-04-05 12:02:30,068 - climada.hazard.trop_cyclone - INFO - Mapping 552 tracks to 14400 centr 2019-04-05 12:03:05,949 - climada.hazard.trop_cyclone - DEBUG - Append events. 2019-04-05 12:03:06,977 - climada.hazard.trop_cyclone - DEBUG - Compute frequency. 2019-04-05 12:03:07,494 - climada.util.checker - DEBUG - Centroids.region_id not set. In [146]: # plot most intense event tc_Bangladesh.plot_intensity(-1) # plot highest hazard intensity at each point tc_Bangladesh.plot_intensity(0) # plot highest hazard intensity for different return periods (10, 50, 75, 100 years) _, _, res = tc_Bangladesh.plot_rp_intensity([10, 50, 75, 100]) 2019-04-05 12:03:47,975 - climada.hazard.base - INFO - Computing exceedance intenstiy map for re 6
  • 7. 7
  • 8. 8
  • 9. In [147]: # Now that we generated the hazard from the initial data, # we just need to fill it into our intially created hazard container: hazard_tc.append(tc_Bangladesh) hazard_tc.check() 2019-04-05 12:04:29,595 - climada.util.checker - DEBUG - Centroids.region_id not set. Step 2: Generating Exposure Exposure can describe the geographical distribution of people, livelihoods and assets or infras- tructure; all items potentially exposed to hazards. As shown in the overview, an "entity" class exists, into which the exposed values ("exposure") are loaded as a sub-class. Two models currently exist for generating such exposures (BlackMarble and LitPop) by de- fault. Both contain estimates of the distribution of monetary asset values and population on a global scale at 1x1km resolution. 9
  • 10. There are other ways of generating exposures, e.g. from a GeoDataFrame of Python’s library geopandas or from loading respective information from an excel-file. In [81]: # Import required packages: import numpy as np import pandas as pd from matplotlib import colors from iso3166 import countries as iso_cntry %matplotlib inline from climada.entity import Entity from climada.entity import Exposures from climada.entity import BlackMarble from climada.entity.exposures.litpop import LitPop In [109]: # Initiate an entity class as "container" for exposures: entity_trial = Entity() # Generated a Black Marble exposure exposure_trial = BlackMarble() # Fill the generated exposure with actual values for a country (Bangladesh) exposure_trial.set_countries(['Bangladesh'], 2013, res_km=1.0) exposure_trial.set_geometry_points() # Add the exposure as a sub-class to entity entity_trial.exposures = Exposures(exposure_trial) entity_trial.exposures['if_TC'] = entity_trial.exposures['if_'] entity_trial.exposures.assign_centroids(hazard_tc) entity_trial.exposures.check() In [110]: # plot exposure with major towns (pop_name=True): entity_trial.exposures.plot_hexbin(pop_name=True) # plot exposure with log-normal colormap for better contrasts: norm=colors.LogNorm(vmin=500, vmax=4.0e9) entity_trial.exposures.plot_hexbin(norm=norm) Out[110]: (<Figure size 648x936 with 2 Axes>, array([[<cartopy.mpl.geoaxes.GeoAxesSubplot object at 0x1a419f7eb8>]], dtype=object)) 10
  • 11. 11
  • 12. Step 3: Defining Vulnerability (Impact Functions) Impact Functions relate hazard intensity to the ensuing damage of the exposed assets or people. Again, default functions exist, functions can be read in from excel or be manually created (which is demonstrated here). First, an Impact Function Set needs to be created (a "container" for the Impact Functions). This set is then filled with an impact function, which we in turn create manually. Lastly, the impact function set needs to be added to the "overall container", the entity. In [111]: # loading necessary package: from climada.entity import ImpactFuncSet 12
  • 13. from climada.entity import ImpactFunc import numpy as np import matplotlib.pyplot as plt In [112]: # Create Set: imp_fun_set = ImpactFuncSet() In [113]: # Create Impact Function from scratch imp_fun = ImpactFunc() imp_fun.haz_type = 'TC' imp_fun.id = 1 imp_fun.name = 'TC random function' imp_fun.intensity_unit = 'm/s' imp_fun.intensity = np.linspace(0, 100, num=20) imp_fun.mdd = np.sort(np.random.rand(20)) imp_fun.paa = np.sort(np.random.rand(20)) imp_fun.check() In [114]: # Add Impact function to Set imp_fun_set.add_func(imp_fun) In [115]: # Add set to entity and plot entity_trial.impact_funcs = imp_fun_set entity_trial.impact_funcs.plot('TC') Out[115]: (<Figure size 288x288 with 1 Axes>, [<matplotlib.axes._subplots.AxesSubplot at 0x1a1c24ccc0>]) 13
  • 14. Risk Quantification, Damage Calculations ("Risk Today") In [148]: # load necessary package from climada.engine import Impact In [149]: # Calculate impact (damage) by combining exposure, hazard and impact function impact_trial = Impact() impact_trial.calc(entity_trial.exposures, entity_trial.impact_funcs, hazard_tc) 2019-04-05 12:04:48,480 - climada.engine.impact - INFO - Exposures matching centroids found in c 2019-04-05 12:04:48,550 - climada.engine.impact - INFO - Calculating damage for 49270 assets (>0 In [150]: # Calculate impact exceedence frequency curve freq_curve_fl = impact_trial.calc_freq_curve() freq_curve_fl.plot(); print('Expected average annual impact: {:.3e} USD'.format(impact_trial.aai_agg)) # Plot average annual impact (damage) at each exposure impact_trial.plot_eai_exposure(buffer_deg=1.0); Expected average annual impact: 6.887e+08 USD 14
  • 15. Towards Total Future Risk: Additional Risk from Socio-Economic Development & Cli- mate Change Steps 1-3 would now be repeated, but the exposure and hazard set would be modified, to capture future scenarios: • Population and Economic Growth --> Multiply asset and population values in exposure with adequate factor • Climate Change --> Increase frequency or intensity of event in hazard set Step 4: Adaptation Measures Parametrization Again, steps 1-3 are repeated. This time, hazard set and impact function would be modified, to capture adaptation efforts: 15
  • 16. • Impact at same intensity is lowered • Frequency or intensity of hazard are lowered Let’s create a new impact function, derived from the one above but representing the effects of an adaptation measure on the impact e.g. building code (BC) set to resist winds up to 60 m/s: In [151]: # effect of mdd_impact, paa_impact, hazard_inten_imp %matplotlib inline import numpy as np from climada.entity import Measure In [161]: # impact function which is 0 up to 62.5 m/s imp_fun_BC = ImpactFunc() imp_fun_BC.haz_type = 'TC' imp_fun_BC.id = 2 imp_fun_BC.name = 'TC function with Building Code' imp_fun_BC.intensity_unit = 'm/s' imp_fun_BC.intensity = np.linspace(0, 100, num=20) imp_fun_BC.mdd = np.append(np.zeros(13),np.sort(np.random.rand(7))) imp_fun_BC.paa = np.append(np.zeros(13),np.sort(np.random.rand(7))) imp_fun_BC.check() In [158]: # Add Impact function to Set imp_fun_set.add_func(imp_fun_BC) In [159]: # Add set to entity and plot the old & new one entity_trial.impact_funcs = imp_fun_set entity_trial.impact_funcs.plot('TC') Out[159]: (<Figure size 576x288 with 2 Axes>, [<matplotlib.axes._subplots.AxesSubplot at 0x1a3a482518>, <matplotlib.axes._subplots.AxesSubplot at 0x1a31c75128>]) 16
  • 17. Result: Adaptation Options Appraisal The total risks with and without adaptation measures can now be compared (incl. under different socio-economic and climate change scenarios). The difference is total future risk is hence the "re- duced damage" or "benefit". Given that implementation costs are known for each of the measures, cost-benefit measures may now be calculated. 17