本文整理汇总了Python中gnome.environment.Waves.compute_H方法的典型用法代码示例。如果您正苦于以下问题:Python Waves.compute_H方法的具体用法?Python Waves.compute_H怎么用?Python Waves.compute_H使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnome.environment.Waves
的用法示例。
在下文中一共展示了Waves.compute_H方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_compute_H_fetch_huge
# 需要导入模块: from gnome.environment import Waves [as 别名]
# 或者: from gnome.environment.Waves import compute_H [as 别名]
def test_compute_H_fetch_huge():
"""
With a huge fetch, should be same as fetch-unlimited
"""
water = copy(default_water)
water.fetch = 1e100 # 10km
w = Waves(test_wind_5, water)
H_f = w.compute_H(5) # five m/s wind
w.fetch = None
H_nf = w.compute_H(5)
assert H_f == H_nf
示例2: test_compute_H
# 需要导入模块: from gnome.environment import Waves [as 别名]
# 或者: from gnome.environment.Waves import compute_H [as 别名]
def test_compute_H():
"""can it compute a wave height at all?
fetch unlimited
"""
w = Waves(test_wind_5, default_water)
H = w.compute_H(5) # five m/s wind
print H
示例3: test_pseudo_wind
# 需要导入模块: from gnome.environment import Waves [as 别名]
# 或者: from gnome.environment.Waves import compute_H [as 别名]
def test_pseudo_wind(U):
"""
should reverse the wave height computation
at least for fetch-unlimited
"""
w = Waves(test_wind_5, default_water)
print "testing for U:", U
# 0.707 compensates for RMS wave height
assert round(w.pseudo_wind(w.compute_H(U) / 0.707), 5) == round(U, 8)
示例4: test_compute_H_fetch
# 需要导入模块: from gnome.environment import Waves [as 别名]
# 或者: from gnome.environment.Waves import compute_H [as 别名]
def test_compute_H_fetch():
"""can it compute a wave height at all?
fetch limited case
"""
water = copy(default_water)
water.fetch = 10000 # 10km
w = Waves(test_wind_5, water) # 10km
H = w.compute_H(5) # five m/s wind
print H