You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal package interpolation.py currently throws a UserWarning for interpolation test test_interp_hybrid_to_pressure_extrap_geopotential
interpolation.py:133: UserWarning: Interpolation point out of data bounds encountered
return func_interpolate(new_levels, xcoords, data, axis=interp_axis)
Warn if interpolated values are outside data bounds, will make these the values at end of data range.
Since the input values max value 70272.49076537043 is less than max interpolate value 100000 it can't interpolate to the bounds outside the range (without setting a fill_value). So, by default, It adds the values to the end of the range
An easy way to see this is interpolating to 4.5 when the range is to 4:
import metpy.interpolate
import numpy as np
x = np.array([1., 2., 3., 4.])
y = np.array([1., 2., 3., 4.])
x_interp = np.array([2.5, 3.5])
metpy.interpolate.interpolate_1d(x_interp, x, y)
Where the array position of the max value is out of bounds, so the array appends nan
metpy.interpolate.interpolate_1d(x_interp, x, y)
<stdin>:1: UserWarning: Interpolation point out of data bounds encountered
array([2.5, nan])
When the values are within range, it returns the interpolated values without a nan
import metpy.interpolate
import numpy as np
x = np.array([1., 2., 3., 4.])
y = np.array([1., 2., 3., 4.])
x_interp = np.array([2.5, 3.5])
metpy.interpolate.interpolate_1d(x_interp, x, y)
array([2.5, 3.5])
The text was updated successfully, but these errors were encountered:
Internal package
interpolation.py
currently throws a UserWarning for interpolation testtest_interp_hybrid_to_pressure_extrap_geopotential
The interpolation warning is generated by the test
test_interp_hybrid_to_pressure_extrap_geopotential
that is populated frompress_in
which is populated with the valuesTo be interpolated along the values
The test calls
interp_hybrid_to_pressure
aslinear
, so it ends up calling metpyinterpolate_1d
. Specifically, the error being thrown is because the interpolate values and the coordinates shapes are equal without a fill_valueMetpy will raise a warning that:
Since the input values max value
70272.49076537043
is less than max interpolate value100000
it can't interpolate to the bounds outside the range (without setting a fill_value). So, by default, It adds the values to the end of the rangeAn easy way to see this is interpolating to 4.5 when the range is to 4:
Where the array position of the max value is out of bounds, so the array appends
nan
When the values are within range, it returns the interpolated values without a nan
The text was updated successfully, but these errors were encountered: