35
35
zip (['cat05' , 'cat45' , 'intensity' ], range (3 ))
36
36
)
37
37
38
+ MAP_PERC_NAMES = dict (
39
+ zip (['5/10' , '25' , '50' , '75' , '90/95' ], range (5 ))
40
+ )
41
+
38
42
def get_knutson_scaling_factor (
39
- pct = 0 ,
43
+ percentile = '50' ,
40
44
basin = 'NA' ,
41
45
variable = 'cat05' ,
42
46
baseline = (1950 , 2018 )
@@ -62,13 +66,12 @@ def get_knutson_scaling_factor(
62
66
63
67
Parameters
64
68
----------
65
- pct: int
66
- percentile of interest:
67
- 0 = 5% or 10%
68
- 1 = 25%
69
- 2 = 50%
70
- 3 = 75%
71
- 4 = 95% or 90%
69
+ percentile: str
70
+ percentile of Knutson et al. 2020 estimates. These estimates come from a
71
+ review of state-of-the-art literature and models. See Knutson et al. 2020
72
+ for more details. Possible values are:
73
+ '5/10', '25', '50', '75', '90/95'
74
+ Default: '50'
72
75
basin : str
73
76
region of interest, possible choices are:
74
77
'NA', 'WP', 'EP', 'NI', 'SI', 'SP'
@@ -79,6 +82,11 @@ def get_knutson_scaling_factor(
79
82
the starting and ending years that define the historical
80
83
baseline. The historical baseline period must fall within
81
84
the GSMT data period, i.e., 1880-2100.
85
+ Returns
86
+ -------
87
+ future_change_variable : pd.DataFrame
88
+ data frame with future projections of the selected variables at different
89
+ times (indexes) and for RCPs 2.6, 4.5, 6.0 and 8.5 (columns).
82
90
"""
83
91
84
92
# this could become an input variable in the future
@@ -88,13 +96,16 @@ def get_knutson_scaling_factor(
88
96
}
89
97
90
98
base_start_year , base_end_year = baseline
91
- gmst_data , gmst_start_year , gmst_end_year , rcps = get_gmst_info ()
99
+ gmst_info = get_gmst_info ()
100
+
92
101
knutson_data = get_knutson_data ()
93
102
94
- nrcps , gmst_years = gmst_data .shape
103
+ nrcps , gmst_years = gmst_info [ ' gmst_data' ] .shape
95
104
96
- if ((base_start_year <= gmst_start_year ) or (base_start_year >= gmst_end_year ) or
97
- (base_end_year <= gmst_start_year ) or (base_end_year >= gmst_end_year )):
105
+ if ((base_start_year <= gmst_info ['gmst_start_year' ]) or
106
+ (base_start_year >= gmst_info ['gmst_end_year' ]) or
107
+ (base_end_year <= gmst_info ['gmst_start_year' ]) or
108
+ (base_end_year >= gmst_info ['gmst_end_year' ])):
98
109
99
110
raise ValueError ("The selected historical baseline falls outside"
100
111
"the GMST data period 1880-2100" )
@@ -103,10 +114,11 @@ def get_knutson_scaling_factor(
103
114
# (these annual values correspond to y in the paper)
104
115
105
116
var_id = MAP_VARS_NAMES [variable ]
117
+ perc_id = MAP_PERC_NAMES [percentile ]
106
118
107
119
try :
108
120
basin_id = MAP_BASINS_NAMES [basin ]
109
- knutson_value = knutson_data [var_id , basin_id , pct ]
121
+ knutson_value = knutson_data [var_id , basin_id , perc_id ]
110
122
111
123
except KeyError :
112
124
# no scaling factors are defined for this basin. Most likely SA.
@@ -117,12 +129,12 @@ def get_knutson_scaling_factor(
117
129
118
130
for i in range (nrcps ):
119
131
for j in range (gmst_years ):
120
- tc_properties [i , j ] = exp (beta * gmst_data [i , j ])
132
+ tc_properties [i , j ] = exp (beta * gmst_info [ ' gmst_data' ] [i , j ])
121
133
122
134
# calculate baselines for each RCP as averages of the annual values
123
135
124
- base_start_index = base_start_year - gmst_start_year
125
- base_end_index = base_end_year - gmst_start_year
136
+ base_start_index = base_start_year - gmst_info [ ' gmst_start_year' ]
137
+ base_end_index = base_end_year - gmst_info [ ' gmst_start_year' ]
126
138
127
139
baseline_properties = np .empty (nrcps )
128
140
for i in range (nrcps ):
@@ -140,7 +152,7 @@ def get_knutson_scaling_factor(
140
152
for window in range (windows_props ['windows' ]):
141
153
mid_year = windows_props ['start' ] + (window ) * windows_props ['interval' ]
142
154
mid_years [window ] = mid_year
143
- mid_index = mid_year - gmst_start_year
155
+ mid_index = mid_year - gmst_info [ ' gmst_start_year' ]
144
156
actual_smoothing = min (
145
157
windows_props ['smoothing' ],
146
158
gmst_years - mid_index - 1 ,
@@ -155,20 +167,38 @@ def get_knutson_scaling_factor(
155
167
) / baseline_properties [i ]
156
168
count += 1
157
169
158
- return pd .DataFrame (predicted_property_pcs ,
159
- index = mid_years , columns = rcps )
170
+ future_change_variable = pd .DataFrame (predicted_property_pcs ,
171
+ index = mid_years ,
172
+ columns = gmst_info ['rcps' ])
173
+ return future_change_variable
160
174
161
175
def get_gmst_info ():
162
176
"""
163
- Get Global Mean Surface Temperature data from 1880 to 2100 for RCPs 2.6, 4.5, 6.0 and 8.5
177
+ Get Global Mean Surface Temperature (GMST) data from 1880 to 2100 for
178
+ RCPs 2.6, 4.5, 6.0 and 8.5.
179
+
180
+ Returns
181
+ -------
182
+ gmst_info : dict
183
+ dictionary with keys:
184
+ - rcps: list of strings referring to RCPs 2.6, 4.5, 6.0 and 8.5
185
+ - gmst_start_year: integer with the GMST data starting year, 1880
186
+ - gmst_start_year: integer with the GMST data ending year, 2100
187
+ - gmst_data: array with GMST data across RCPs (first dim) and years (second dim)
164
188
"""
165
- rcps = ['2.6' , '4.5' , '6.0' , '8.5' ]
166
- gmst_start_year = 1880
167
- gmst_end_year = 2100
168
189
169
- gmst_data = np .empty ((len (rcps ), gmst_end_year - gmst_start_year + 1 ))
190
+ gmst_info = {}
191
+
192
+ gmst_info .update ({'rcps' : ['2.6' , '4.5' , '6.0' , '8.5' ]})
193
+ gmst_info ({'gmst_start_year' : 1880 })
194
+ gmst_info ({'gmst_end_year' : 2100 })
170
195
171
- gmst_data [0 ] = [
196
+ gmst_info .update ({'gmst_data' :
197
+ np .empty ((len (gmst_info ['rcps' ]),
198
+ gmst_info ['gmst_end_year' ]- gmst_info ['gmst_start_year' ]+ 1 ))
199
+ })
200
+
201
+ gmst_info ['gmst_data' ][0 ] = [
172
202
- 0.16 ,- 0.08 ,- 0.1 ,- 0.16 ,- 0.28 ,- 0.32 ,- 0.3 ,- 0.35 ,- 0.16 ,- 0.1 ,
173
203
- 0.35 ,- 0.22 ,- 0.27 ,- 0.31 ,- 0.3 ,- 0.22 ,- 0.11 ,- 0.11 ,- 0.26 ,- 0.17 ,
174
204
- 0.08 ,- 0.15 ,- 0.28 ,- 0.37 , - 0.47 ,- 0.26 ,- 0.22 ,- 0.39 ,- 0.43 ,- 0.48 ,
@@ -200,7 +230,7 @@ def get_gmst_info():
200
230
1.297514286 ,1.312114286 ,1.276714286 ,1.281414286 ,1.276414286
201
231
]
202
232
203
- gmst_data [1 ] = [
233
+ gmst_info [ ' gmst_data' ] [1 ] = [
204
234
- 0.16 ,- 0.08 ,- 0.1 ,- 0.16 ,- 0.28 ,- 0.32 ,- 0.3 ,- 0.35 ,- 0.16 ,- 0.1 ,
205
235
- 0.35 , - 0.22 ,- 0.27 ,- 0.31 ,- 0.3 ,- 0.22 ,- 0.11 ,- 0.11 ,- 0.26 ,- 0.17 ,
206
236
- 0.08 ,- 0.15 ,- 0.28 ,- 0.37 ,- 0.47 ,- 0.26 ,- 0.22 ,- 0.39 ,- 0.43 ,- 0.48 ,
@@ -229,7 +259,7 @@ def get_gmst_info():
229
259
2.186492857 ,2.181092857 ,2.217592857 ,2.210492857 ,2.223692857
230
260
]
231
261
232
- gmst_data [2 ] = [
262
+ gmst_info [ ' gmst_data' ] [2 ] = [
233
263
- 0.16 ,- 0.08 ,- 0.1 ,- 0.16 ,- 0.28 ,- 0.32 ,- 0.3 ,- 0.35 ,- 0.16 ,- 0.1 ,- 0.35 ,- 0.22 ,- 0.27 ,
234
264
- 0.31 ,- 0.3 ,- 0.22 ,- 0.11 ,- 0.11 ,- 0.26 ,- 0.17 ,- 0.08 ,- 0.15 ,- 0.28 ,- 0.37 ,- 0.47 ,- 0.26 ,
235
265
- 0.22 ,- 0.39 ,- 0.43 ,- 0.48 ,- 0.43 ,- 0.44 ,- 0.36 ,- 0.34 ,- 0.15 ,- 0.14 ,- 0.36 ,- 0.46 ,- 0.29 ,
@@ -253,7 +283,7 @@ def get_gmst_info():
253
283
2.644714286 ,2.688414286 ,2.688514286 ,2.685314286 ,2.724614286 ,2.746214286 ,2.773814286
254
284
]
255
285
256
- gmst_data [3 ] = [
286
+ gmst_info [ ' gmst_data' ] [3 ] = [
257
287
- 0.16 ,- 0.08 ,- 0.1 ,- 0.16 ,- 0.28 ,- 0.32 ,- 0.3 ,- 0.35 ,- 0.16 ,- 0.1 ,- 0.35 ,- 0.22 ,- 0.27 ,
258
288
- 0.31 ,- 0.3 ,- 0.22 ,- 0.11 ,- 0.11 ,- 0.26 ,- 0.17 ,- 0.08 ,- 0.15 ,- 0.28 ,- 0.37 ,- 0.47 ,- 0.26 ,
259
289
- 0.22 ,- 0.39 ,- 0.43 ,- 0.48 ,- 0.43 ,- 0.44 ,- 0.36 ,- 0.34 ,- 0.15 ,- 0.14 ,- 0.36 ,- 0.46 ,- 0.29 ,
@@ -277,7 +307,7 @@ def get_gmst_info():
277
307
4.172064286 ,4.225264286 ,4.275064286 ,4.339064286 ,4.375864286 ,4.408064286 ,4.477764286
278
308
]
279
309
280
- return gmst_data , gmst_start_year , gmst_end_year , rcps
310
+ return gmst_info
281
311
282
312
def get_knutson_data ():
283
313
"""
@@ -286,39 +316,51 @@ def get_knutson_data():
286
316
Tropical cyclones and climate change assessment. Part II: Projected
287
317
response to anthropogenic warming. Bull. Amer. Meteor. Soc., 101 (3), E303–E322,
288
318
https://doi.org/10.1175/BAMS-D-18-0194.1.
289
-
290
- for 4 variables (i.e., cat05 frequency, cat45 frequency, intensity precipitation rate),
319
+
320
+ for 4 variables (i.e., cat05 frequency, cat45 frequency, intensity, precipitation rate),
291
321
6 regions (i.e., N. Atl, NW Pac., NE Pac., N. Ind, S. Ind., SW Pac.) and
292
- 5 metrics (i.e., 5% or 10%, 25%, median, 75%, 95% or 90%).
322
+ 5 metrics (i.e., 5% or 10%, 25%, 50%, 75%, 95% or 90%).
323
+
324
+ Returns
325
+ -------
326
+ knutson_data : np.array of dimension (4x6x5)
327
+ array contaning data used by Knutson et al. (2020) to project changes in cat05 frequency,
328
+ cat45 frequency, intensity and precipitation rate (first array's dimension), for the
329
+ N. Atl, NW Pac., NE Pac., N. Ind, S. Ind., SW Pac. regions (second array's dimension)
330
+ for the 5%/10%, 25%, 50%, 75%, 95%/90% percentiles (thirs array's dimension).
293
331
"""
294
332
295
- knutson_data = np .empty ((4 , 6 , 5 ))
333
+ knutson_data = np .empty ((4 ,6 , 5 ))
296
334
297
- # fig 1 in Knutson et al. 2020 (except min, max metrics and global region)
335
+ # fig 1 in Knutson et al. 2020
336
+ # (except min, max metrics and global region): cat05 frequency
298
337
knutson_data [0 ,0 ]= [- 34.49 ,- 24.875 ,- 14.444 ,3.019 ,28.737 ]
299
338
knutson_data [0 ,1 ]= [- 30.444 ,- 20 ,- 10.27 ,0.377 ,17.252 ]
300
339
knutson_data [0 ,2 ]= [- 32.075 ,- 18.491 ,- 3.774 ,11.606 ,36.682 ]
301
340
knutson_data [0 ,3 ]= [- 35.094 ,- 15.115 ,- 4.465 ,5.785 ,29.405 ]
302
341
knutson_data [0 ,4 ]= [- 32.778 ,- 22.522 ,- 17.297 ,- 8.995 ,7.241 ]
303
342
knutson_data [0 ,5 ]= [- 40.417 ,- 26.321 ,- 18.113 ,- 8.21 ,4.689 ]
304
343
305
- # fig 2 in Knutson et al. 2020 (except min, max metrics and global region)
344
+ # fig 2 in Knutson et al. 2020
345
+ # (except min, max metrics and global region): cat45 frequency
306
346
knutson_data [1 ,0 ]= [- 38.038 ,- 22.264 ,11.321 ,38.302 ,81.874 ]
307
347
knutson_data [1 ,1 ]= [- 25.811 ,- 14.34 ,- 4.75 ,16.146 ,41.979 ]
308
348
knutson_data [1 ,2 ]= [- 24.83 ,- 6.792 ,22.642 ,57.297 ,104.315 ]
309
349
knutson_data [1 ,3 ]= [- 30.566 ,- 16.415 ,5.283 ,38.491 ,79.119 ]
310
350
knutson_data [1 ,4 ]= [- 23.229 ,- 13.611 ,4.528 ,26.645 ,63.514 ]
311
351
knutson_data [1 ,5 ]= [- 42.453 ,- 29.434 ,- 14.467 ,- 0.541 ,19.061 ]
312
352
313
- # fig 3 in Knutson et al. 2020 (except min, max metrics and global region)
353
+ # fig 3 in Knutson et al. 2020
354
+ # (except min, max metrics and global region): intensity
314
355
knutson_data [2 ,0 ]= [0.543 ,1.547 ,2.943 ,4.734 ,6.821 ]
315
356
knutson_data [2 ,1 ]= [1.939 ,3.205 ,5.328 ,6.549 ,9.306 ]
316
357
knutson_data [2 ,2 ]= [- 2.217 ,0.602 ,5.472 ,9.191 ,10.368 ]
317
358
knutson_data [2 ,3 ]= [- 0.973 ,1.944 ,4.324 ,6.15 ,7.808 ]
318
359
knutson_data [2 ,4 ]= [1.605 ,3.455 ,5.405 ,7.69 ,10.884 ]
319
360
knutson_data [2 ,5 ]= [- 6.318 ,- 0.783 ,0.938 ,5.314 ,12.213 ]
320
361
321
- # fig 4 in Knutson et al. 2020 (except min, max metrics and global region)
362
+ # fig 4 in Knutson et al. 2020:
363
+ # (except min, max metrics and global region): precipitation rate
322
364
knutson_data [3 ,0 ]= [5.848 ,9.122 ,15.869 ,20.352 ,22.803 ]
323
365
knutson_data [3 ,1 ]= [6.273 ,12.121 ,16.486 ,18.323 ,23.784 ]
324
366
knutson_data [3 ,2 ]= [6.014 ,8.108 ,21.081 ,29.324 ,31.838 ]
0 commit comments