Skip to content

Commit

Permalink
Merge df86890 into 09b49f3
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Jan 24, 2018
2 parents 09b49f3 + df86890 commit 3185e2c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
17 changes: 12 additions & 5 deletions docs/run_examples/_code/mb_crossval.py
Expand Up @@ -20,7 +20,8 @@

# Local paths (where to find the OGGM run output)
WORKING_DIR = path.join(path.expanduser('~'), 'tmp',
'OGGM_ref_mb_RGIV{}'.format(rgi_version))
'OGGM_ref_mb_RGIV{}_OGGM{}'.format(rgi_version,
oggm.__version__))
cfg.PATHS['working_dir'] = WORKING_DIR

# Read the rgi file
Expand Down Expand Up @@ -89,7 +90,13 @@
fn = path.join(WORKING_DIR, 'mb_crossval_rgi{}.pdf'.format(rgi_version))
plt.savefig(fn)

print('Median bias: {:.2f}'.format(cvdf['CV_MB_BIAS'].median()))
print('Mean bias: {:.2f}'.format(cvdf['CV_MB_BIAS'].mean()))
print('RMS: {:.2f}'.format(np.sqrt(np.mean(cvdf['CV_MB_BIAS']**2))))
print('Sigma bias: {:.2f}'.format(np.mean(cvdf['CV_MB_SIGMA_BIAS'])))
scores = 'Median bias: {:.2f}\n'.format(cvdf['CV_MB_BIAS'].median())
scores += 'Mean bias: {:.2f}\n'.format(cvdf['CV_MB_BIAS'].mean())
scores += 'RMS: {:.2f}\n'.format(np.sqrt(np.mean(cvdf['CV_MB_BIAS']**2)))
scores += 'Sigma bias: {:.2f}\n'.format(np.mean(cvdf['CV_MB_SIGMA_BIAS']))

# Output
print(scores)
fn = path.join(WORKING_DIR, 'scores.txt')
with open(fn, 'w') as f:
f.write(scores)
3 changes: 2 additions & 1 deletion docs/run_examples/_code/run_reference_mb_glaciers.py
Expand Up @@ -24,7 +24,8 @@

# Local paths (where to write the OGGM run output)
WORKING_DIR = path.join(path.expanduser('~'), 'tmp',
'OGGM_ref_mb_RGIV{}'.format(rgi_version))
'OGGM_ref_mb_RGIV{}_OGGM{}'.format(rgi_version,
oggm.__version__))
utils.mkdir(WORKING_DIR, reset=True)
cfg.PATHS['working_dir'] = WORKING_DIR

Expand Down
2 changes: 1 addition & 1 deletion oggm/utils.py
Expand Up @@ -60,7 +60,7 @@
# Github repository and commit hash/branch name/tag name on that repository
# The given commit will be downloaded from github and used as source for all sample data
SAMPLE_DATA_GH_REPO = 'OGGM/oggm-sample-data'
SAMPLE_DATA_COMMIT = 'c3d5a67182e0e6faa8de464753e4ffe156218cfe'
SAMPLE_DATA_COMMIT = '17fe98844aed27199d2dfc7fd8af2bc3e356dbd0'

CRU_SERVER = ('https://crudata.uea.ac.uk/cru/data/hrg/cru_ts_4.01/cruts'
'.1709081022.v4.01/')
Expand Down

0 comments on commit 3185e2c

Please sign in to comment.