Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/w/h/WHIPS-1.2.3/process_sat/function_unittests.py   WHIPS(Download)
    def test_wrap_lon_neg180_180(self):
        knownIn = [0, 360, 180, 47.5, -47.5, -80, -180, -365, -725, 410]
        knownOut = [0, 0, 180, 47.5, -47.5, -80, 180, -5, -5, 50]
        compOut = [utils.wrap_lon_neg180_180(lon) for lon in knownIn]
        self.assertListEqual(knownOut, compOut)
 
    def test_lon_0_360_recoverable(self):
        inputData = numpy.random.rand(20)*360
        intermediateData = [utils.wrap_lon_neg180_180(lon) for lon in inputData]
    def test_lon_neg180_180_recoverable(self):
        inputData = numpy.random.rand(20)*360 - 180
        intermediateData = [utils.wrap_lon_0_360(lon) for lon in inputData]
        finalData = numpy.array([utils.wrap_lon_neg180_180(lon) for lon in intermediateData])
        numpy.testing.assert_array_almost_equal(inputData, finalData, decimal=5)