Skip to content

Commit

Permalink
Better docs, untrack notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed May 19, 2023
1 parent d3480aa commit 1d18145
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 953 deletions.
13 changes: 9 additions & 4 deletions oggm/core/inversion.py
Expand Up @@ -723,20 +723,25 @@ def compute_inversion_velocities(gdir, glen_a=None, fs=None, filesuffix='',


@entity_task(log, writes=['gridded_data'])
def distribute_thickness_per_altitude(gdir, add_slope=True, topo='topo_smoothed',
def distribute_thickness_per_altitude(gdir, add_slope=True,
topo_variable='topo_smoothed',
smooth_radius=None,
dis_from_border_exp=0.25,
varname_suffix=''):
"""Compute a thickness map by redistributing mass along altitudinal bands.
This is a rather cosmetic task, not relevant for OGGM but for ITMIX.
This is a rather cosmetic task, not relevant for OGGM but for ITMIX or
for visualizations.
Parameters
----------
gdir : :py:class:`oggm.GlacierDirectory`
the glacier directory to process
add_slope : bool
whether a corrective slope factor should be used or not
topo_variable : str
the topography to read from `gridded_data.nc` (could be smoothed, or
smoothed differently).
smooth_radius : int
pixel size of the gaussian smoothing. Default is to use
cfg.PARAMS['smooth_window'] (i.e. a size in meters). Set to zero to
Expand All @@ -757,7 +762,7 @@ def distribute_thickness_per_altitude(gdir, add_slope=True, topo='topo_smoothed'
gridded_attributes(gdir)

with utils.ncDataset(grids_file) as nc:
topo_smoothed = nc.variables[topo][:]
topo = nc.variables[topo_variable][:]
glacier_mask = nc.variables['glacier_mask'][:]
dis_from_border = nc.variables['dis_from_border'][:]
if add_slope:
Expand Down Expand Up @@ -789,7 +794,7 @@ def distribute_thickness_per_altitude(gdir, add_slope=True, topo='topo_smoothed'
thick = glacier_mask * 0.
yglac, xglac = np.nonzero(glacier_mask == 1)
for y, x in zip(yglac, xglac):
phgt = topo_smoothed[y, x]
phgt = topo[y, x]
# take the ones in a 100m range
starth = 100.
while True:
Expand Down

0 comments on commit 1d18145

Please sign in to comment.