Example #1
0
    def test_vMax(self):
        """Testing vMax"""

        #testing willoughby
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(vmax.vmax(self.pc[i], self.pe, "willoughby"), self.vmax["will"][i], 3)

        #testing holland
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(vmax.vmax(self.pc[i], self.pe, "holland"), self.vmax["holl"][i], 3)

        #testing atkinson
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(vmax.vmax(self.pc[i], self.pe, "atkinson"), self.vmax["atkin"][i], 3)

        #testing exceptions
        self.assertRaises(ValueError, vmax.vmax, 1500.0, 1000.0)
        self.assertRaises(NotImplementedError, vmax.vmax, 1000.0, 1500.0, "will")
Example #2
0
    def test_vMax(self):
        """Testing vMax"""

        #testing willoughby
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(
                vmax.vmax(self.pc[i], self.pe, "willoughby"),
                self.vmax["will"][i], 3)

        #testing holland
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(vmax.vmax(self.pc[i], self.pe, "holland"),
                                   self.vmax["holl"][i], 3)

        #testing atkinson
        for i in xrange(self.pc.size):
            self.assertAlmostEqual(vmax.vmax(self.pc[i], self.pe, "atkinson"),
                                   self.vmax["atkin"][i], 3)

        #testing exceptions
        self.assertRaises(ValueError, vmax.vmax, 1500.0, 1000.0)
        self.assertRaises(NotImplementedError, vmax.vmax, 1000.0, 1500.0,
                          "will")
Example #3
0
 def willoughby(self):
     """
     The Willoughby & Rahn (2004) relation, which makes beta a function of
     Vmax, rMax and latitude. We use Willoughby & Rahn's (2004) relation
     for Vmax *only*.
     This determines the beta parameter then calls Holland (which means the
     profile is cubic within Rmax) to calculate the wind profile.
     The beta term calculation is based on Atlantic and Eastern Pacific cyclone
     data, not Australian data.
     """
     vMax = vmax.vmax(self.pCentre, self.pEnv, type="willoughby")
     beta = 1.0036 + 0.0173*vMax  - 0.313*numpy.log(self.rMax) \
            + 0.0087*numpy.abs(self.cLat)
     P = self.holland(beta)
     return P
Example #4
0
 def willoughby(self):
     """
     The Willoughby & Rahn (2004) relation, which makes beta a function of
     Vmax, rMax and latitude. We use Willoughby & Rahn's (2004) relation
     for Vmax *only*.
     This determines the beta parameter then calls Holland (which means the
     profile is cubic within Rmax) to calculate the wind profile.
     The beta term calculation is based on Atlantic and Eastern Pacific cyclone
     data, not Australian data.
     """
     vMax = vmax.vmax(self.pCentre, self.pEnv, type="willoughby")
     beta = 1.0036 + 0.0173*vMax  - 0.313*numpy.log(self.rMax) \
            + 0.0087*numpy.abs(self.cLat)
     P = self.holland(beta)
     return P