Beispiel #1
0
    def get_path_profile(self, path, time, variable, numpoints=100):
        distances, times, lat, lon, bearings = \
            geo.path_to_points(path, numpoints)

        result, depth = self.get_profile(lat, lon, time, variable)

        return np.array([lat, lon]), distances, result.transpose(), depth
Beispiel #2
0
    def test_path_to_points(self):
        points = [[1, 1], [10, 10]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=None)
        self.assertAlmostEqual(b[0], 44.5, places=1)
        self.assertAlmostEqual(lat[4], 5.0, places=1)
        self.assertAlmostEqual(lon[4], 5.0, places=1)

        points = [[0, 0], [10, 10], [20, 20]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=None)
        self.assertAlmostEqual(lat[-1], 20.0, places=1)
        self.assertAlmostEqual(lon[-1], 20.0, places=1)

        points = [[0, 0], [10, 10], [20, 20]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=[0, 1])
        self.assertAlmostEqual(lat[-1], 20.0, places=1)
        self.assertAlmostEqual(lon[-1], 20.0, places=1)
    def test_path_to_points(self):
        points = [[1, 1], [10, 10]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=None)
        self.assertAlmostEqual(b[0], 44.5, places=1)
        self.assertAlmostEqual(lat[4], 5.0, places=1)
        self.assertAlmostEqual(lon[4], 5.0, places=1)

        points = [[0, 0], [10, 10], [20, 20]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=None)
        self.assertAlmostEqual(lat[-1], 20.0, places=1)
        self.assertAlmostEqual(lon[-1], 20.0, places=1)

        points = [[0, 0], [10, 10], [20, 20]]
        dist, t, lat, lon, b = geo.path_to_points(points, n=10, times=[0, 1])
        self.assertAlmostEqual(lat[-1], 20.0, places=1)
        self.assertAlmostEqual(lon[-1], 20.0, places=1)
Beispiel #4
0
    def get_path_profile(self, path, time, variable, numpoints=100):
        distances, times, lat, lon, bearings = \
            geo.path_to_points(path, numpoints)

        result, depth = self.get_profile(lat, lon, time, variable)

        return np.array([lat, lon]), distances, result.transpose(), depth
Beispiel #5
0
    def get_path(self,
                 path,
                 depth,
                 time,
                 variable,
                 numpoints=100,
                 times=None,
                 return_depth=False):
        if times is None:
            if hasattr(time, "__len__"):
                times = self.timestamps[time]
            else:
                times = None
        distances, times, lat, lon, bearings = \
            geo.path_to_points(path, numpoints, times=times)

        if return_depth:
            result, dep = self.get_point(lat,
                                         lon,
                                         depth,
                                         time,
                                         variable,
                                         return_depth=return_depth)
            return np.array([lat, lon]), distances, times, result, dep
        else:
            result = self.get_point(lat,
                                    lon,
                                    depth,
                                    time,
                                    variable,
                                    return_depth=return_depth)
            return np.array([lat, lon]), distances, times, result
Beispiel #6
0
    def get_path(self, path, depth, time, variable, numpoints=100, times=None,
                 return_depth=False):
        if times is None:
            if hasattr(time, "__len__"):
                times = self.timestamps[time]
            else:
                times = None
        distances, times, lat, lon, bearings = \
            geo.path_to_points(path, numpoints, times=times)

        if return_depth:
            result, dep = self.get_point(lat, lon, depth, time, variable,
                                         return_depth=return_depth)
            return np.array([lat, lon]), distances, times, result, dep
        else:
            result = self.get_point(lat, lon, depth, time, variable,
                                    return_depth=return_depth)
            return np.array([lat, lon]), distances, times, result