Skip to content

Commit

Permalink
Ignore broken(?) glaciers in run_benchmark.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoRoth committed May 3, 2017
1 parent 6e6e5e5 commit b6dee71
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions oggm/sandbox/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,30 @@
from oggm import workflow
from oggm.utils import get_demo_file
from oggm import tasks
from oggm.workflow import execute_entity_task
from oggm.workflow import execute_entity_task, reset_multiprocessing
from oggm import graphics, utils


# Initialize OGGM
cfg.initialize()

# Local paths (where to write output and where to download input)
WORKING_DIR = ''
DATA_DIR = ''
WORKING_DIR = os.path.expanduser('~/OGGM_wd_bench')
DATA_DIR = os.path.join(WORKING_DIR, 'datadir')

cfg.PATHS['working_dir'] = WORKING_DIR
cfg.PATHS['topo_dir'] = os.path.join(DATA_DIR, 'topo')
cfg.PATHS['cru_dir'] = os.path.join(DATA_DIR, 'cru')
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')
cfg.PATHS['tmp_dir'] = os.path.join(DATA_DIR, 'tmp')

# Currently OGGM wants some directories to exist
# (maybe I'll change this but it can also catch errors in the user config)
utils.mkdir(cfg.PATHS['working_dir'])
utils.mkdir(cfg.PATHS['topo_dir'])
utils.mkdir(cfg.PATHS['cru_dir'])
utils.mkdir(cfg.PATHS['rgi_dir'])
utils.mkdir(cfg.PATHS['tmp_dir'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
Expand All @@ -56,6 +58,11 @@
rgi_pkl_path = utils.aws_file_download('rgi_benchmark.pkl')
rgidf = pd.read_pickle(rgi_pkl_path)

# Remove glaciers causing issues
rgidf = rgidf.iloc[[s not in ('RGI50-11.00291') for s in rgidf['RGIId']]]

utils.get_rgi_dir()

log.info('Number of glaciers: {}'.format(len(rgidf)))

# Go - initialize working directories
Expand Down

0 comments on commit b6dee71

Please sign in to comment.