Skip to content

Commit 6a25bae

Browse files
added variable name tas to example datasets; edited docstrings
1 parent 6f5cd4e commit 6a25bae

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

CMethods.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ def linear_scaling(cls,
417417
(1.) X^{*LS}_{sim,p}(i) = X_{sim,p}(i) + \mu_{m}(X_{obs,h}(i)) - \mu_{m}(X_{sim,h}(i))
418418
Mult ('*'):
419419
(2.) X^{*LS}_{sim,h}(i) = X_{sim,h}(i) + \mu_{m}(X_{obs,h}(i)) - \mu_{m}(X_{sim,h}(i))
420+
420421
----- R E F E R E N C E S -----
421422
422423
Based on the equations of Teutschbein, Claudia and Seibert, Jan (2012) Bias correction of regional climate model simulations for hydrological climate-change impact studies: Review and evaluation of different methods
@@ -471,9 +472,9 @@ def variance_scaling(cls,
471472
(3.) X^{VS(1)}_{sim,h}(i) = X^{*LS}_{sim,h}(i) - \mu_{m}(X^{*LS}_{sim,h}(i))
472473
(4.) X^{VS(1)}_{sim,p}(i) = X^{*LS}_{sim,p}(i) - \mu_{m}(X^{*LS}_{sim,p}(i))
473474
474-
(6.) X^{VS(2)}_{sim,p}(i) = X^{VS(1)}_{sim,p}(i) \cdot \left[\frac{\sigma_{m}(X_{obs,h}(i))}{\sigma_{m}(X^{VS(1)}_{sim,h}(i))}\right]
475+
(5.) X^{VS(2)}_{sim,p}(i) = X^{VS(1)}_{sim,p}(i) \cdot \left[\frac{\sigma_{m}(X_{obs,h}(i))}{\sigma_{m}(X^{VS(1)}_{sim,h}(i))}\right]
475476
476-
(8.) X^{*VS}_{sim,p}(i) = X^{VS(2)}_{sim,p}(i) + \mu_{m}(X^{*LS}_{sim,p}(i))
477+
(6.) X^{*VS}_{sim,p}(i) = X^{VS(2)}_{sim,p}(i) + \mu_{m}(X^{*LS}_{sim,p}(i))
477478
478479
----- R E F E R E N C E S -----
479480
@@ -489,9 +490,9 @@ def variance_scaling(cls,
489490
VS_1_simh = LS_simh - np.nanmean(LS_simh) # Eq. 3
490491
VS_1_simp = LS_simp - np.nanmean(LS_simp) # Eq. 4
491492

492-
VS_2_simp = VS_1_simp * (np.std(obs) / np.std(VS_1_simh)) # Eq. 6
493+
VS_2_simp = VS_1_simp * (np.std(obs) / np.std(VS_1_simh)) # Eq. 5
493494

494-
return VS_2_simp + np.nanmean(LS_simp) # Eq. 8
495+
return VS_2_simp + np.nanmean(LS_simp) # Eq. 6
495496

496497
# ? -----========= D E L T A - M E T H O D =========------
497498
@classmethod

examples.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 12,
12+
"execution_count": 1,
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
@@ -75,7 +75,7 @@
7575
},
7676
{
7777
"cell_type": "code",
78-
"execution_count": 5,
78+
"execution_count": 6,
7979
"metadata": {},
8080
"outputs": [],
8181
"source": [
@@ -84,21 +84,21 @@
8484
" dims=('lon', 'lat', 'time'),\n",
8585
" coords={'time': historical_time, 'lat': latitudes, 'lon': [0,1]},\n",
8686
" attrs={'units': '°C'},\n",
87-
").transpose('time','lat','lon')#.to_netcdf('obs.nc')\n",
87+
").transpose('time','lat','lon').to_dataset(name='tas')#.to_netcdf('obs.nc', )\n",
8888
"\n",
8989
"simh = xr.DataArray(\n",
9090
" data-2,\n",
9191
" dims=('lon', 'lat', 'time'),\n",
9292
" coords={'time': historical_time, 'lat': latitudes, 'lon': [0,1]},\n",
9393
" attrs={'units': '°C'},\n",
94-
").transpose('time','lat','lon')#.to_netcdf('contr.nc')\n",
94+
").transpose('time','lat','lon').to_dataset(name='tas')#.to_netcdf('contr.nc', )\n",
9595
"\n",
9696
"simp = xr.DataArray(\n",
9797
" data-1,\n",
9898
" dims=('lon', 'lat', 'time'),\n",
9999
" coords={'time': future_time, 'lat': latitudes, 'lon': [0,1]},\n",
100100
" attrs={'units': '°C'},\n",
101-
").transpose('time','lat','lon')#.to_netcdf('scen.nc')"
101+
").transpose('time','lat','lon').to_dataset(name='tas')#.to_netcdf('scen.nc', )"
102102
]
103103
},
104104
{

input_data/contr.nc

0 Bytes
Binary file not shown.

input_data/obs.nc

0 Bytes
Binary file not shown.

input_data/scen.nc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)