Пример #1
0
    def test_ecef_to_geodetic(self):
        ncoords = 5
        lats = num.random.uniform(-90., 90, size=ncoords)
        lons = num.random.uniform(-180., 180, size=ncoords)
        alts = num.random.uniform(0, 10, size=ncoords)

        coords = num.array([lats, lons, alts]).T

        for ic in range(coords.shape[0]):
            xyz = orthodrome.geodetic_to_ecef(*coords[ic, :])
            latlonalt = orthodrome.ecef_to_geodetic(*xyz)

            assert_ae(coords[ic, :], latlonalt)
    def test_ecef_to_geodetic(self):
        ncoords = 5
        lats = num.random.uniform(-90., 90, size=ncoords)
        lons = num.random.uniform(-180., 180, size=ncoords)
        alts = num.random.uniform(0, 10, size=ncoords)

        coords = num.array([lats, lons, alts]).T

        for ic in range(coords.shape[0]):
            xyz = orthodrome.geodetic_to_ecef(*coords[ic, :])
            latlonalt = orthodrome.ecef_to_geodetic(*xyz)

            num.testing.assert_almost_equal(coords[ic, :], latlonalt)