Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
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)
Esempio n. 5
0
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
Esempio n. 6
0
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