Skip to content

Commit

Permalink
hotfix: near_sfc_height = 10 for wind power law features.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Sep 14, 2023
1 parent 90f7921 commit 611a3b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sup3r/preprocessing/feature_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,11 @@ class UWindPowerLaw(DerivedFeature):
method. Uses power law extrapolation to get values above surface
https://csl.noaa.gov/projects/lamar/windshearformula.html
https://www.tandfonline.com/doi/epdf/10.1080/00022470.1977.10470503
"""

ALPHA = 0.2
NEAR_SFC_HEIGHT = 10

@classmethod
def inputs(cls, feature):
Expand Down Expand Up @@ -774,18 +776,19 @@ def compute(cls, data, height):
Derived feature array
"""
near_surface_height = 1
return data['uas'] * (float(height) / near_surface_height)**cls.ALPHA
return data['uas'] * (float(height) / cls.NEAR_SFC_HEIGHT)**cls.ALPHA


class VWindPowerLaw(DerivedFeature):
"""V wind component feature class with needed inputs method and compute
method. Uses power law extrapolation to get values above surface
https://csl.noaa.gov/projects/lamar/windshearformula.html
https://www.tandfonline.com/doi/epdf/10.1080/00022470.1977.10470503
"""

ALPHA = 0.2
NEAR_SFC_HEIGHT = 10

@classmethod
def inputs(cls, feature):
Expand Down Expand Up @@ -821,8 +824,7 @@ def compute(cls, data, height):
Derived feature array
"""
near_surface_height = 1
return data['vas'] * (float(height) / near_surface_height)**cls.ALPHA
return data['vas'] * (float(height) / cls.NEAR_SFC_HEIGHT)**cls.ALPHA


class UWind(DerivedFeature):
Expand Down

0 comments on commit 611a3b3

Please sign in to comment.