def test_rmaxDefaults(self): """Test rmax returns correct value based on defaults""" dp = 25 lat = -15 eps = 0 rmw = trackSize.rmax(dp, lat, eps) self.assertAlmostEqual(rmw, 39.21410711, places=1)
def test_rmaxWithIncompleteCoeffs(self): """Test rmax falls back to default coefficients if not enough given""" coeffs = [4.45, -0.05, 0.0002] eps = 0 rmw = trackSize.rmax(self.dparray, self.latarray, eps, coeffs=coeffs) self.numpyAssertAlmostEqual(rmw, self.rmaxout, prec=0.1)
def test_rmaxWithCoeffs(self): """Test rmax with user-defined coefficients""" eps = 0 coeffs = [3.5, -0.004, 0.7, 0.002, .001] rmw = trackSize.rmax(self.dparray, self.latarray, eps, coeffs) self.numpyAssertAlmostEqual(rmw, self.rmaxoutcoeffs)
def test_rmaxArrayInput(self): """Test rmax with array input""" eps = 0 rmw = trackSize.rmax(self.dparray, self.latarray, eps) self.numpyAssertAlmostEqual(rmw, self.rmaxout, prec=0.1)