Exemplo n.º 1
0
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
cfg.CONTINUE_ON_ERROR = False

# Read in the Benchmark RGI file
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', 'RGI50-03.02479') for s in rgidf['RGIId']
]]

utils.get_rgi_dir()

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

# Go - initialize working directories
# gdirs = workflow.init_glacier_regions(rgidf, reset=True, force=True)
gdirs = workflow.init_glacier_regions(rgidf)
Exemplo n.º 2
0
from oggm import graphics, utils

# Initialize OGGM
cfg.initialize()

# Local paths (where to write output and where to download input)
WORKING_DIR = '/work/ubuntu/run_alps/wd'
DATA_DIR = '/work/ubuntu/oggm-data'
PLOTS_DIR = '/work/ubuntu/run_alps/plots'
cfg.PATHS['working_dir'] = WORKING_DIR
cfg.PATHS['topo_dir'] = os.path.join(DATA_DIR, 'topo')
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')

# Climate file
hist_path = os.path.join(DATA_DIR, 'histalp_merged_with_cru_hydro_yrs.nc')
dl_hist_path = utils.aws_file_download(
    'alps/histalp_merged_with_cru_hydro_yrs.nc')
shutil.copy(dl_hist_path, hist_path)

cfg.PATHS['cru_dir'] = '~'
cfg.PATHS['climate_file'] = hist_path

# 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'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
cfg.CONTINUE_ON_ERROR = False
Exemplo n.º 3
0

# Initialize OGGM
cfg.initialize()

# Local paths (where to write output and where to download input)
WORKING_DIR = '/work/ubuntu/run_alps/wd'
DATA_DIR = '/work/ubuntu/oggm-data'
PLOTS_DIR = '/work/ubuntu/run_alps/plots'
cfg.PATHS['working_dir'] = WORKING_DIR
cfg.PATHS['topo_dir'] = os.path.join(DATA_DIR, 'topo')
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')

# Climate file
hist_path = os.path.join(DATA_DIR, 'histalp_merged_with_cru_hydro_yrs.nc')
utils.aws_file_download('alps/histalp_merged_with_cru_hydro_yrs.nc',
                        hist_path, reset=False)
cfg.PATHS['cru_dir'] = '~'
cfg.PATHS['climate_file'] = hist_path


# 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'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
cfg.CONTINUE_ON_ERROR = False
Exemplo n.º 4
0
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
cfg.CONTINUE_ON_ERROR = False

# Read in the Benchmark RGI file
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', 'RGI50-03.02479') for s in rgidf['RGIId']]]

utils.get_rgi_dir()

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

# Go - initialize working directories
# gdirs = workflow.init_glacier_regions(rgidf, reset=True, force=True)
gdirs = workflow.init_glacier_regions(rgidf)

# Prepro tasks
task_list = [
Exemplo n.º 5
0

# Initialize OGGM
cfg.initialize()

# Local paths (where to write output and where to download input)
WORKING_DIR = '/work/ubuntu/run_alps/wd'
DATA_DIR = '/work/ubuntu/oggm-data'
PLOTS_DIR = '/work/ubuntu/run_alps/plots'
cfg.PATHS['working_dir'] = WORKING_DIR
cfg.PATHS['topo_dir'] = os.path.join(DATA_DIR, 'topo')
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')

# Climate file
hist_path = os.path.join(DATA_DIR, 'histalp_merged_with_cru_hydro_yrs.nc')
dl_hist_path = utils.aws_file_download('alps/histalp_merged_with_cru_hydro_yrs.nc')
shutil.copy(dl_hist_path, hist_path)

cfg.PATHS['cru_dir'] = '~'
cfg.PATHS['climate_file'] = hist_path


# 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'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
Exemplo n.º 6
0
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')

# 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'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
cfg.CONTINUE_ON_ERROR = False

# Read in the Benchmark RGI file
rgi_pkl_path = os.path.join(DATA_DIR, 'rgi_benchmark.pkl')
utils.aws_file_download('rgi_benchmark.pkl', rgi_pkl_path, reset=False)
rgidf = pd.read_pickle(rgi_pkl_path)

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

# Go - initialize working directories
# gdirs = workflow.init_glacier_regions(rgidf, reset=True, force=True)
gdirs = workflow.init_glacier_regions(rgidf)

# Prepro tasks
task_list = [
    tasks.glacier_masks,
    tasks.compute_centerlines,
    tasks.compute_downstream_lines,
    tasks.catchment_area,
    tasks.initialize_flowlines,
Exemplo n.º 7
0
cfg.PATHS['rgi_dir'] = os.path.join(DATA_DIR, 'rgi')

# 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'])

# Use multiprocessing?
cfg.PARAMS['use_multiprocessing'] = True
cfg.CONTINUE_ON_ERROR = False

# Read in the Benchmark RGI file
rgi_pkl_path = os.path.join(DATA_DIR, 'rgi_benchmark.pkl')
utils.aws_file_download('rgi_benchmark.pkl', rgi_pkl_path, reset=False)
rgidf = pd.read_pickle(rgi_pkl_path)

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

# Go - initialize working directories
# gdirs = workflow.init_glacier_regions(rgidf, reset=True, force=True)
gdirs = workflow.init_glacier_regions(rgidf)

# Prepro tasks
task_list = [
    tasks.glacier_masks,
    tasks.compute_centerlines,
    tasks.compute_downstream_lines,
    tasks.catchment_area,
    tasks.initialize_flowlines,