Skip to content
New issue

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

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

Already on GitHub? # to your account

Add notes about power law interpolation vs linear #186

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
32 changes: 31 additions & 1 deletion rex/renewable_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,17 @@ class WindResource(AbstractInterpolatedResource):
"""
Class to handle Wind BaseResource .h5 files
Notes
-----
Interpolation between hub-heights is performed using linear
interpolation. While wind follows a log profile macroscopically,
using power law interpolation doesn't allow for negative wind shear,
which we see often at the taller hub heights we care about. In other
words, power law interpolation is a bad assumption for near surface
wind, and linear interpolation is a much better approach.
Extrapolation beyond the resource data hub heights is still
performed using power law interpolation.
See Also
--------
resource.AbstractInterpolatedResource : Parent class
Expand Down Expand Up @@ -1073,6 +1084,14 @@ def power_law_interp(ts_1, h_1, ts_2, h_2, h, mean=True):
-------
out : ndarray
Time-series array at height h
Notes
-----
While wind follows a log profile macroscopically, using power
law interpolation doesn't allow for negative wind shear, which
we see often at the taller hub heights we care about. This means
yous should prefer linear interpolation over power law
interpolation when possible for near surface wind.
"""
if h_1 > h_2:
h_1, h_2 = h_2, h_1
Expand Down Expand Up @@ -1235,7 +1254,18 @@ def _get_ds_interpolated(self, ds_name, ds_slice):
return super()._get_ds_interpolated(ds_name, ds_slice)

def _get_calculated_ds(self, val, ds_name, var_name, ds_slice):
"""Get interpolated/extrapolated values for the dataset. """
"""Get interpolated/extrapolated values for the dataset.
Note that interpolation between hub-heights is performed using
linear interpolation. While wind follows a log profile
macroscopically, using power law interpolation doesn't allow for
negative wind shear, which we see often at the taller hub
heights we care about. In other words, power law interpolation
is a bad assumption for near surface wind, and linear
interpolation is a much better approach. Extrapolation beyond
the resource data hub heights is still performed using power law
interpolation.
"""
heights = self._interpolation_variable[var_name]
(h1, h2), extrapolate = self._get_nearest_val(val, heights)

Expand Down
Loading