Esempio n. 1
0
def absolute(u, v, x, y):
    rel = curl_2d(x, y, u, v, algorithm='order1_spherical', R_sphere=6378137.)

    xx, yy = np.meshgrid(x, y)
    f = coriolis(yy)
    zeta = rel + f
    return zeta
Esempio n. 2
0
 def __init__(self,
              R,
              pEnv,
              pCentre,
              rMax,
              cLat,
              cLon,
              beta=1.3,
              rMax2=250.,
              beta1=None,
              beta2=None):
     """
     Initialise required fields
     """
     self.R = R
     self.cLon = cLon
     self.cLat = cLat
     self.rMax = rMax
     self.dP = pEnv - pCentre
     self.pCentre = pCentre
     self.pEnv = pEnv
     # Density of air:
     self.rho = 1.15
     self.f = metutils.coriolis(cLat)
     self.beta = beta
     self.rMax2 = rMax2
     self.rMax2 = rMax2
     self.beta1 = beta1
     self.beta2 = beta2
     self.logger = logging.getLogger()
     self.logger.debug("Storm centre: %3f %3f" % (self.cLon, self.cLat))
     self.logger.debug("Coriolis parameter: %3f" % self.f)
Esempio n. 3
0
 def __init__(self, lat, lon, eP, cP, rMax, windSpeedModel):
     self.rho = 1.15  # density of air
     self.lat = lat
     self.lon = lon
     self.eP = eP
     self.cP = cP
     self.rMax = rMax
     self.speed = windSpeedModel(self)
     self.f = metutils.coriolis(lat)
     self.vMax_ = None
Esempio n. 4
0
 def __init__(self, lat, lon, eP, cP, rMax, windSpeedModel):
     self.rho = 1.15  # density of air
     self.lat = lat
     self.lon = lon
     self.eP = eP
     self.cP = cP
     self.rMax = rMax
     self.speed = windSpeedModel(self)
     self.f = metutils.coriolis(lat)
     self.vMax_ = None
Esempio n. 5
0
    def __init__(self, lat, lon, eP, cP, rMax, windSpeedModel):
        self.rho = 1.15  # density of air
        self.lat = lat
        self.lon = lon
        self.eP = eP
        self.cP = cP
        self.rMax = rMax
        self.speed = windSpeedModel(self)
        self.f = metutils.coriolis(lat)
        self.vMax_ = None

        if eP < 10000.:
            self.eP = metutils.convert(eP, 'hPa', 'Pa')
        else:
            self.eP = eP

        if cP < 10000.:
            self.cP = metutils.convert(cP, 'hPa', 'Pa')
        else:
            self.cP = cP
Esempio n. 6
0
 def __init__(self, R, pEnv, pCentre, rMax, cLat, cLon, beta=1.3,
              rMax2=250., beta1=None, beta2=None ):
     """
     Initialise required fields
     """
     self.R = R
     self.cLon = cLon
     self.cLat = cLat
     self.rMax = rMax
     self.dP = pEnv-pCentre
     self.pCentre = pCentre
     self.pEnv = pEnv
     # Density of air:
     self.rho = 1.15
     self.f = metutils.coriolis(cLat)
     self.beta = beta
     self.rMax2 = rMax2
     self.rMax2 = rMax2
     self.beta1 = beta1
     self.beta2 = beta2
     self.logger = logging.getLogger()
     self.logger.debug("Storm centre: %3f %3f" %(self.cLon, self.cLat))
     self.logger.debug("Coriolis parameter: %3f" % self.f)
Esempio n. 7
0
 def test_coriolisScalar(self):
     """Test Coriolis with a scalar value for latitude"""
     self.assertAlmostEqual(metutils.coriolis(self.lat[-1]), self.f[-1], 3) 
Esempio n. 8
0
 def test_coriolisArray(self):
     """Test Coriolis with an array of latitudes"""
     self.numpyAssertAlmostEqual(metutils.coriolis(self.lat), self.f)
Esempio n. 9
0
 def test_coriolisScalar(self):
     """Test Coriolis with a scalar value for latitude"""
     self.assertAlmostEqual(metutils.coriolis(self.lat[-1]), self.f[-1], 3)
Esempio n. 10
0
 def test_coriolisArray(self):
     """Test Coriolis with an array of latitudes"""
     self.numpyAssertAlmostEqual(metutils.coriolis(self.lat), self.f)