Skip to content

Commit 1bad40b

Browse files
committed
Merge remote-tracking branch 'davidnbresch/master'
2 parents 168e4d8 + 0640683 commit 1bad40b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

climada/engine/impact.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,23 +226,25 @@ def _exp_impact(self, exp_iimp, exposures, hazard, imp_fun, insure_flag):
226226
self.at_event += np.squeeze(np.asarray(np.sum(impact, axis=1)))
227227
self.tot_value += np.sum(exposures.value[exp_iimp])
228228

229-
def plot_eai_exposure(self, ignore_zero=True, **kwargs):
229+
def plot_eai_exposure(self, ignore_zero=True, var_name=None, **kwargs):
230230
"""Plot expected annual impact of each exposure.
231231
232232
Parameters:
233-
ignore_zero (bool): ignore zero impact values at exposures
233+
ignore_zero (bool, optional): ignore zero impact values
234+
var_name (str, optional): name in colorbar
234235
kwargs (optional): arguments for hexbin matplotlib function
235236
236237
Returns:
237238
matplotlib.figure.Figure, cartopy.mpl.geoaxes.GeoAxesSubplot
238239
"""
239240
title = 'Expected annual impact'
240-
col_name = 'Impact ' + self.unit
241+
if var_name is None:
242+
var_name = 'Impact (' + self.unit + ')'
241243
if ignore_zero:
242244
pos_vals = self.eai_exp > 0
243245
else:
244246
pos_vals = np.ones((self.eai_exp.size,), dtype=bool)
245247
if 'reduce_C_function' not in kwargs:
246248
kwargs['reduce_C_function'] = np.sum
247249
return plot.geo_bin_from_array(self.eai_exp[pos_vals], \
248-
self.coord_exp[pos_vals], col_name, title, **kwargs)
250+
self.coord_exp[pos_vals], var_name, title, **kwargs)

climada/hazard/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def _compute_stats(self, return_periods, orig=False):
669669
return inten_stats
670670

671671
def _loc_return_inten(self, return_periods, cen_pos, inten, freq):
672-
""" Compute local intensity for given return period.
672+
""" Compute local exceedence intensity for given return period.
673673
674674
Parameters:
675675
return_periods (np.array): return periods to consider

0 commit comments

Comments
 (0)