Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Millan thickness and velocity to the shop #1443

Merged
merged 11 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Enhancements
Level 5 now replaces level 4 and creates the minigdirs (where only the files
for a model run are kept and no inversion is possible anymore) (:pull:`1425`).
By `Patrick Schmitt <https://github.com/pat-schmitt>`_
- Added support for Milland 22 velocity and thickness in the shop (:pull:`1443`).
By `Fabien Maussion <https://github.com/fmaussion>`_

Bug fixes
~~~~~~~~~
Expand Down
3 changes: 1 addition & 2 deletions oggm/shop/its_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def find_region(gdir):
def _reproject_and_scale(gdir, do_error=False):
"""Reproject and scale itslive data, avoid code duplication for error"""


reg = find_region(gdir)
if reg is None:
raise InvalidWorkflowError('There does not seem to be its_live data '
Expand Down Expand Up @@ -142,7 +141,7 @@ def _reproject_and_scale(gdir, do_error=False):

# Scale back velocities - https://github.com/OGGM/oggm/issues/1014
new_vel = np.sqrt(vx**2 + vy**2)
p_ok = new_vel > 1e-5 # avoid div by zero
p_ok = new_vel > 1 # avoid div by zero
vx[p_ok] = vx[p_ok] * orig_vel[p_ok] / new_vel[p_ok]
vy[p_ok] = vy[p_ok] * orig_vel[p_ok] / new_vel[p_ok]

Expand Down
Loading