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

Units bug fix for _get_bound_pressure_height #1943

Merged
merged 2 commits into from Jun 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/metpy/calc/tools.py
Expand Up @@ -388,9 +388,8 @@ def _get_bound_pressure_height(pressure, bound, height=None, interpolate=True):
# Need to cast back to the input type since interp (up to at least numpy
# 1.13 always returns float64. This can cause upstream users problems,
# resulting in something like np.append() to upcast.
bound_pressure = units.Quantity(np.interp(np.atleast_1d(bound.m), height.m,
pressure.m).astype(np.result_type(bound)),
pressure.units)
bound_pressure = np.interp(np.atleast_1d(bound),
height, pressure).astype(np.result_type(bound))
else:
idx = (np.abs(height - bound)).argmin()
bound_pressure = pressure[idx]
Expand Down